Gitako/packages/pjax/lib/util/clone.js
EnixCoda 7e6feb621c
revert: use old pjax for Firefox compatibility
This reverts commit 8aaf55be59 and 0a4ee27
2020-04-06 19:16:36 +08:00

13 lines
276 B
JavaScript

module.exports = function(obj) {
/* istanbul ignore if */
if (null === obj || "object" !== typeof obj) {
return obj
}
var copy = obj.constructor()
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = obj[attr]
}
}
return copy
}