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

lutils-clone

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lutils-clone - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name" : "lutils-clone",
"description" : "Reliably and recursively clone javascript objects",
"version" : "0.1.3",
"version" : "0.1.4",
"author" : { "name": "nfour" },

@@ -6,0 +6,0 @@ "repository" : {

# clone `lutils-clone`
Reliably and recursively clone javascript objects
`npm install lutils-clone`
## API

@@ -9,24 +11,26 @@

```js
import clone from 'lutils-clone'
var test = new class Test {}
const test = new class Test {}
var obj = {
a: { b: 2 },
const obj = {
a : { b: 2 },
fn : function() {}
test,
fn: function() {}
}
var newObj = clone(obj)
const newObj = clone(obj)
newObj.a.b = 5 // 5
obj.a.b // 2
newObj.a === obj.a // false
newObj.test === test // false
newObj.a.b = 5 // 5
obj.a.b // 2
newObj.a === obj.a // false
newObj.test === test // false
newObj.test.__proto__ === test.__proto__ // true
newObj.fn === obj.fn // true
newObj.fn === obj.fn // true
```
## Advanced usage
### Options

@@ -33,0 +37,0 @@ ```js

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