shallow-clone
Advanced tools
Comparing version
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 [](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 @@ |
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
5987
0.98%5
25%54
5.88%2
100%1
Infinity%+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated