diff --git a/CHANGELOG.md b/CHANGELOG.md index 513958a..4caa96a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # ChangeLog +## 2019-11-02 Version 2.1.1 +* Wrong array conversion when brackets are used (Reported by vladshcherbin #27) + ## 2019-11-02 Version 2.1.0 * fix delete function not being wrapped. (Reported by murphyke #40) diff --git a/bower.json b/bower.json index 0a1915e..f82525f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "dot-object", - "version": "2.1.0", + "version": "2.1.1", "description": "dot-object makes it possible to transform and read (JSON) objects using dot notation.", "main": "dist/dot-object.js", "authors": [ diff --git a/dist/dot-object.js b/dist/dot-object.js index 2f11f7a..58114f0 100644 --- a/dist/dot-object.js +++ b/dist/dot-object.js @@ -165,8 +165,10 @@ * @param {Function|Array} mod optional modifier */ DotObject.prototype.str = function(path, v, obj, mod) { + var ok = parsePath(path, this.separator).join(this.separator) + if (path.indexOf(this.separator) !== -1) { - this._fill(path.split(this.separator), obj, v, mod) + this._fill(ok.split(this.separator), obj, v, mod) } else { obj[path] = _process(v, mod) } diff --git a/dist/dot-object.min.js b/dist/dot-object.min.js index e79e5d5..4ddab83 100644 --- a/dist/dot-object.min.js +++ b/dist/dot-object.min.js @@ -1 +1 @@ -!function(t){"use strict";function s(t,r){var e,i;if("function"==typeof r)void 0!==(i=r(t))&&(t=i);else if(Array.isArray(r))for(e=0;e