Skip to content

Commit

Permalink
[Bugfix]: get nested key when doesnt exist in underlying content (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer authored May 9, 2021
1 parent 81e66c5 commit 103a801
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@glimmer/tracking": "^1.0.1",
"ember-auto-import": "^1.5.2",
"ember-cli-babel": "^7.19.0",
"validated-changeset": "~0.14.3"
"validated-changeset": "~0.14.4"
},
"devDependencies": {
"@ember/optional-features": "^1.0.0",
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/changeset-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,17 @@ module('Unit | Utility | changeset', function (hooks) {
}
});

test('#get works if content is undefined for nested key', async function (assert) {
const model = {};

const c = Changeset(model);
c.set('foo.bar.cat', {
color: 'red',
});
const cat = c.get('foo.bar.cat');
assert.equal(cat.color, 'red');
});

/**
* #set
*/
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13517,10 +13517,10 @@ validate-npm-package-name@~2.2.2:
dependencies:
builtins "0.0.7"

validated-changeset@~0.14.3:
version "0.14.3"
resolved "https://registry.yarnpkg.com/validated-changeset/-/validated-changeset-0.14.3.tgz#c17b6f493e1d03a13f9a5660e586175758151f90"
integrity sha512-D2WV7j4m8/wHW+pwFdhvVw9sPiq5r6edkSUTVcp9RadERC7dyubeoioZCo26y7TbGN0sPBzmjj9MDV0gS4r3cA==
validated-changeset@~0.14.4:
version "0.14.4"
resolved "https://registry.yarnpkg.com/validated-changeset/-/validated-changeset-0.14.4.tgz#b8314a1fed15230901e12dec6ffb0eeea6edefbd"
integrity sha512-g0DFT5gbQcvz7r7QMCxbugAQU9kvjSgNlA9JtBM+RZzFE6B1RtW7EXOF7BA/PvAycqmONaqalFbCwA7Ih3l8UQ==

vary@~1.1.2:
version "1.1.2"
Expand Down

0 comments on commit 103a801

Please sign in to comment.