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

shallow-clone

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shallow-clone - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

utils.js

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

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