eden-class
Advanced tools
Comparing version 0.0.4 to 0.0.5
40
class.js
@@ -32,22 +32,3 @@ module.exports = require('classified-magic')(function(prototype) { | ||
prototype.capture = function(deep) { | ||
var j, key, | ||
destination = {}, | ||
keys = Object.keys(this), | ||
i = keys.length; | ||
while (i--) { | ||
key = keys[i]; | ||
destination[key] = this[key]; | ||
if(deep | ||
&& typeof this[key] === 'object' | ||
&& this[key] !== null | ||
&& !_isNative(this[key])) { | ||
destination[key] = this.capture(this[key], {}, deep); | ||
} else if(deep && this[key] instanceof Array) { | ||
destination[key] = this.capture(this[key], [], deep); | ||
} | ||
} | ||
return destination; | ||
return _copy(this, {}, deep); | ||
}; | ||
@@ -205,2 +186,21 @@ | ||
-------------------------------*/ | ||
var _copy = function(source, destination, deep) { | ||
var j, key, keys = Object.keys(source), i = keys.length; | ||
while (i--) { | ||
key = keys[i]; | ||
destination[key] = source[key]; | ||
if(deep | ||
&& typeof source[key] === 'object' | ||
&& source[key] !== null | ||
&& !_isNative(source[key])) { | ||
destination[key] = _copy(source[key], {}, deep); | ||
} else if(deep && source[key] instanceof Array) { | ||
destination[key] = _copy(source[key], [], deep); | ||
} | ||
} | ||
return destination; | ||
}; | ||
@@ -207,0 +207,0 @@ var _isNative = function(value) { |
{ | ||
"name": "eden-class", | ||
"description": "Eden JS Base Class", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Christian Blanquera", |
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
11531