Comparing version 2.2.2 to 2.2.3
@@ -0,1 +1,6 @@ | ||
## v2.2.3 (2017-07-02) | ||
* Fix bug that missing date instance when clone | ||
## v2.2.2 (2017-06-09) | ||
@@ -2,0 +7,0 @@ |
@@ -6,3 +6,4 @@ "use strict"; | ||
*/ | ||
var isObj = require('is-obj'); | ||
var isObj = require('is-plain-object'); | ||
var clone = require('clone-deep'); | ||
var isArray = function (val) { return Array.isArray(val); }; | ||
@@ -47,11 +48,2 @@ var isString = function (val) { return typeof val === 'string'; }; | ||
}; | ||
var clone = function (obj) { | ||
if (!isData(obj)) | ||
return obj; | ||
var result = isArray(obj) ? [] : {}; | ||
each(obj, function (value, key) { | ||
result[key] = clone(value); | ||
}); | ||
return result; | ||
}; | ||
var merge = function (obj, source) { | ||
@@ -58,0 +50,0 @@ each(source, function (value, key) { |
{ | ||
"name": "dot-wild", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Use powerful dot notation (dot path + wildcard) to manipulate properties of JSON", | ||
@@ -9,6 +9,7 @@ "main": "lib/index.js", | ||
"build": "tsc", | ||
"watch": "npm run build -- -w & npm run test:unit -- -w", | ||
"watch": "npm run build -- -w & npm run test:watch", | ||
"test": "npm run test:lint && npm run test:unit", | ||
"test:lint": "tslint -c tslint.json 'src/**/*.ts' 'test/**/*.ts'", | ||
"test:unit": "mocha --compilers ts:ts-node/register,tsx:ts-node/register 'test/**/*.spec.ts'", | ||
"test:watch": "npm run test:unit -- -w", | ||
"docs": "typedoc --excludeNotExported --excludePrivate --out docs/ src/ && touch docs/.nojekyll", | ||
@@ -59,3 +60,4 @@ "prepublish": "npm run build" | ||
"dependencies": { | ||
"is-obj": "^1.0.1" | ||
"clone-deep": "^0.3.0", | ||
"is-plain-object": "^2.0.3" | ||
}, | ||
@@ -62,0 +64,0 @@ "files": [ |
@@ -225,6 +225,41 @@ import * as assert from 'power-assert'; | ||
assertT2(); | ||
const date1 = new Date(); | ||
const date2 = new Date(); | ||
const values = { | ||
foo: date1, | ||
bar: { | ||
baz: date2, | ||
}, | ||
}; | ||
const assertDate = () => { | ||
assert.deepStrictEqual(values, { | ||
foo: date1, | ||
bar: { | ||
baz: date2, | ||
}, | ||
}); | ||
}; | ||
assert.deepStrictEqual(dot.set(values, 'hoge', date1), { | ||
foo: date1, | ||
bar: { | ||
baz: date2, | ||
}, | ||
hoge: date1, | ||
}); | ||
assertDate(); | ||
assert.deepStrictEqual(dot.set(values, 'hoge', date1), { | ||
foo: date1, | ||
bar: { | ||
baz: date2, | ||
}, | ||
hoge: date1, | ||
}); | ||
assertDate(); | ||
}); | ||
it.only('remove()', () => { | ||
it('remove()', () => { | ||
const t1 = { foo: { bar: 'baz' } }; | ||
@@ -231,0 +266,0 @@ const assertT1 = () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44467
1032
2
+ Addedclone-deep@^0.3.0
+ Addedis-plain-object@^2.0.3
+ Addedclone-deep@0.3.0(transitive)
+ Addedfor-in@0.1.81.0.2(transitive)
+ Addedfor-own@1.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedkind-of@2.0.13.2.2(transitive)
+ Addedlazy-cache@0.2.7(transitive)
+ Addedmixin-object@2.0.1(transitive)
+ Addedshallow-clone@0.1.2(transitive)
- Removedis-obj@^1.0.1
- Removedis-obj@1.0.1(transitive)