Skip to content

Commit

Permalink
Merge branch 'release/v1.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhalff committed Jul 18, 2019
2 parents 3e78944 + fa5fe12 commit 295c17e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

## 2019-07-18 Version 1.8.1
* allows allow to set root level property using dot.str

## 2019-07-18 Version 1.8.0
* [[`cdc691424b`](https://github.com/rhalff/dot-object/commit/cdc691424b)] - Options to remove array elements and reindex the array. (Fixed by MechJosh0 #36)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "git",
"url": "git://github.com/rhalff/dot-object.git"
},
"version": "1.8.0",
"version": "1.8.1",
"homepage": "https://github.com/rhalff/dot-object",
"moduleType": [
"amd",
Expand Down
2 changes: 1 addition & 1 deletion dist/dot-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
DotObject.prototype.str = function(path, v, obj, mod) {
if (path.indexOf(this.separator) !== -1) {
this._fill(path.split(this.separator), obj, v, mod)
} else if (!hasOwnProperty.call(obj, path) || this.override) {
} else {
obj[path] = _process(v, mod)
}

Expand Down
2 changes: 1 addition & 1 deletion dist/dot-object.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ DotObject.prototype.object = function (obj, mods) {
DotObject.prototype.str = function (path, v, obj, mod) {
if (path.indexOf(this.separator) !== -1) {
this._fill(path.split(this.separator), obj, v, mod)
} else if (!hasOwnProperty.call(obj, path) || this.override) {
} else {
obj[path] = _process(v, mod)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dot-object",
"description": "dot-object makes it possible to transform and read (JSON) objects using dot notation.",
"version": "1.8.0",
"version": "1.8.1",
"author": {
"name": "Rob Halff",
"email": "rob.halff@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion src/dot-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ DotObject.prototype.object = function (obj, mods) {
DotObject.prototype.str = function (path, v, obj, mod) {
if (path.indexOf(this.separator) !== -1) {
this._fill(path.split(this.separator), obj, v, mod)
} else if (!hasOwnProperty.call(obj, path) || this.override) {
} else {
obj[path] = _process(v, mod)
}

Expand Down
8 changes: 8 additions & 0 deletions test/str.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ describe('str:', function () {
}
})
})

it('can set root level property regardless whether override is set', function () {
Dot.str('a', 'b', {
a: 1
}).should.deepEqual({
a: 'b'
})
})
})

0 comments on commit 295c17e

Please sign in to comment.