shallow-clone
Advanced tools
Comparing version 0.1.1 to 0.1.2
15
index.js
@@ -10,6 +10,3 @@ /*! | ||
var lazy = require('lazy-cache')(require); | ||
lazy.isObject = lazy('is-extendable'); | ||
lazy.mixin = lazy('mixin-object'); | ||
lazy.typeOf = lazy('kind-of'); | ||
var utils = require('./utils'); | ||
@@ -24,4 +21,3 @@ /** | ||
function clone(val) { | ||
var typeOf = lazy.typeOf(); | ||
var type = typeOf(val); | ||
var type = utils.typeOf(val); | ||
@@ -43,7 +39,4 @@ if (clone.hasOwnProperty(type)) { | ||
clone.object = function cloneObject(obj) { | ||
var isObject = lazy.isObject(); | ||
var mixin = lazy.mixin(); | ||
if (isObject(obj)) { | ||
return mixin({}, obj); | ||
if (utils.isObject(obj)) { | ||
return utils.mixin({}, obj); | ||
} else { | ||
@@ -50,0 +43,0 @@ return obj; |
{ | ||
"name": "shallow-clone", | ||
"description": "Make a shallow clone of an object, array or primitive.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/shallow-clone", | ||
@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -25,5 +26,5 @@ "main": "index.js", | ||
"is-extendable": "^0.1.1", | ||
"kind-of": "^2.0.0", | ||
"lazy-cache": "^0.1.0", | ||
"mixin-object": "^2.0.0" | ||
"kind-of": "^2.0.1", | ||
"lazy-cache": "^0.2.3", | ||
"mixin-object": "^2.0.1" | ||
}, | ||
@@ -30,0 +31,0 @@ "devDependencies": { |
@@ -32,3 +32,3 @@ # shallow-clone [![NPM version](https://badge.fury.io/js/shallow-clone.svg)](http://badge.fury.io/js/shallow-clone) | ||
// array elements are not | ||
assert.deepEqual(actual[0] === expected[0], true); | ||
assert.deepEqual(actual[0], expected[0]); // true | ||
``` | ||
@@ -35,0 +35,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
5987
5
54
2
1
+ Addedlazy-cache@0.2.7(transitive)
- Removedansi-wrap@0.1.0(transitive)
- Removedansi-yellow@0.1.1(transitive)
- Removedlazy-cache@0.1.0(transitive)
Updatedkind-of@^2.0.1
Updatedlazy-cache@^0.2.3
Updatedmixin-object@^2.0.1