@jymfony/util
Advanced tools
Comparing version 0.1.0-alpha.3 to 0.1.0-alpha.4
@@ -30,2 +30,3 @@ require('./lib/Error/trigger_deprecated'); | ||
require('./lib/String/version_compare'); | ||
require('./lib/String/wordwrap'); | ||
@@ -32,0 +33,0 @@ require('./lib/Regex/quote'); |
@@ -5,5 +5,19 @@ 'use strict'; | ||
const primitives = [ Number, String, Boolean ]; | ||
global.__jymfony.clone = function clone(object) { | ||
if (! isObject(object)) { | ||
throw new InvalidArgumentException('Cannot clone a non-object'); | ||
} | ||
let deepClone = function (object) { | ||
const surrogateCtor = function () { }; | ||
surrogateCtor.prototype = object.constructor.prototype; | ||
const target = new surrogateCtor(); | ||
for (let k of Object.keys(object)) { | ||
target[k] = object[k]; | ||
} | ||
return target; | ||
}; | ||
global.__jymfony.deepClone = function deepClone(object) { | ||
if (! object ) { | ||
@@ -40,3 +54,1 @@ return object; | ||
}; | ||
global.__jymfony.deepClone = deepClone; |
{ | ||
"name": "@jymfony/util", | ||
"version": "0.1.0-alpha.3", | ||
"version": "0.1.0-alpha.4", | ||
"description": "Jymfony util functions", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@jymfony/exceptions": "0.1.0-alpha.3" | ||
"@jymfony/exceptions": "0.1.0-alpha.4" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102361
56
3053
+ Added@jymfony/exceptions@0.1.0-alpha.4(transitive)
- Removed@jymfony/exceptions@0.1.0-alpha.3(transitive)