Comparing version 0.3.9 to 0.3.10
(function() { | ||
var cloneObject, clonePropertiesTo, createObject, extend, isFunction; | ||
var cloneObject, clonePropertiesTo, createObject, extend, getPrototypeOf, isFunction; | ||
@@ -12,8 +12,11 @@ isFunction = require('./is/type/function'); | ||
getPrototypeOf = require('inherits-ex/lib/getPrototypeOf'); | ||
module.exports = cloneObject = function(aObject, tryCloneFn) { | ||
var ctor, result; | ||
var ctor, proto, result; | ||
if (tryCloneFn !== false && isFunction(aObject.clone)) { | ||
result = aObject.clone(); | ||
} else { | ||
ctor = aObject.Class || aObject.constructor; | ||
proto = getPrototypeOf(aObject); | ||
ctor = proto.hasOwnProperty('Class') ? proto.Class : aObject.constructor; | ||
result = createObject(ctor); | ||
@@ -20,0 +23,0 @@ clonePropertiesTo(result, aObject); |
@@ -0,1 +1,3 @@ | ||
module.exports = require('inherits-ex/lib/isEmptyFunction'); | ||
/* | ||
module.exports = function(aFunc) { | ||
@@ -5,1 +7,2 @@ var result = /^function\s*\S*\s*\(.*\)\s*{[\s;]*}$/.test(aFunc.toString()); | ||
} | ||
*/ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/snowyu/util-ex.js", | ||
"version": "0.3.9", | ||
"version": "0.3.10", | ||
"author": { | ||
@@ -59,5 +59,5 @@ "name": "Riceball LEE", | ||
"dependencies": { | ||
"inherits-ex": "~1.0.6", | ||
"inherits-ex": "^1.1.2", | ||
"xtend": "^4.0.0" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
module.exports = require('inherits-ex/lib/isEmptyFunction'); | ||
/* | ||
module.exports = function(aFunc) { | ||
@@ -5,1 +7,2 @@ var result = /^function\s*\S*\s*\(.*\)\s*{[\s;]*}$/.test(aFunc.toString()); | ||
} | ||
*/ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
105957
1721
+ Addedinherits-ex@1.6.0(transitive)
- Removedinherits-ex@1.0.9(transitive)
Updatedinherits-ex@^1.1.2