Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dot-wild

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-wild - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

5

CHANGELOG.md

@@ -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 @@

12

lib/index.js

@@ -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 = () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc