Socket
Socket
Sign inDemoInstall

clone

Package Overview
Dependencies
0
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.7 to 0.1.0

clonePrototype.js

7

clone.js
module.exports = clone;
/**
* Clones an Object using deep cloning.
* Clones (copies) an Object using deep copying.
*

@@ -64,3 +64,3 @@ * This function supports circular references by default, but if you are certain

else
child = parent; //Just a simple shallow clone will do
child = parent; //Just a simple shallow copy will do
return child;

@@ -108,1 +108,4 @@ }

}
// see: clonePrototype.js
clone.clonePrototype = require('./clonePrototype.js');

@@ -11,3 +11,3 @@ {

],
"version": "0.0.7",
"version": "0.1.0",
"repository": {

@@ -41,2 +41,2 @@ "type": "git",

}
}
}

@@ -124,3 +124,3 @@ if(module.parent === null) {

_(aCopy.c[0] == a.c[0]);
//console.log(util.inspect(aCopy, true, null) );

@@ -143,1 +143,20 @@ //console.log("------------------------------------------------------------");

};
exports['clonePrototype'] = function(test) {
test.expect(3); // how many tests?
var a = {
a: "aaa",
x: 123,
y: 45.65
};
var b = clone.clonePrototype(a);
test.strictEqual(b.a, a.a);
test.strictEqual(b.x, a.x);
test.strictEqual(b.y, a.y);
test.done();
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc