This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clone(obj) { | |
if (Object(obj) !== obj) return obj; | |
if (typeof obj.toJSON == 'function') { | |
return obj.toJSON(); | |
} | |
var type = toString.call(obj).slice(8, -1); | |
if (type in CLONE) { | |
return CLONE[type].call(obj, clone); | |
} | |
var copy = {}; |