New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

core-extensions

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-extensions - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

30

index.js

@@ -12,3 +12,2 @@ "use strict";

var target = null;
var type = typeof this;

@@ -18,5 +17,26 @@ if ( this instanceof Date ) {

}
else if ( Object.isObject( this ) || Array.isArray( this ) ) {
target = JSON.parse( JSON.stringify( this ) ); // probably a slightly more efficient way to do this, but this is ok for now
else if ( Array.isArray( this ) ) {
target = [];
for ( var i = 0; i < this.length; i++ ) {
if ( Array.isArray( this[i] ) || Object.isObject( this[i] ) ) {
target[i] = this[i].clone();
}
else {
target[i] = this[i];
}
}
}
else if ( Object.isObject( this ) ) {
target = {};
for ( var field in this ) {
if ( this.hasOwnProperty( field ) ) {
if ( Array.isArray( this[field] ) || Object.isObject( this[field] ) ) {
target[field] = this[field].clone();
}
else {
target[field] = this[field];
}
}
}
}
else { // functions, etc. not clonable yet, just pass through

@@ -85,6 +105,2 @@ target = this;

if ( typeof target === 'function' || typeof source === 'function' ) {
throw new Error( 'mixin does not support function values' );
}
// if target exists and is an array...

@@ -91,0 +107,0 @@ if ( Array.isArray( target ) ) {

@@ -5,3 +5,3 @@ {

"author": "Anthony Hildoer <anthony@bluerival.com>",
"version": "0.1.0",
"version": "0.1.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -162,2 +162,4 @@ 'use strict';

}
},
func: function () {
}

@@ -185,2 +187,4 @@ };

'one',
function () {
},
1,

@@ -187,0 +191,0 @@ 'onepointone',

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