clone.js 286 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 define(['./isObject', './isArray', './extend'], function (isObject, isArray, extend) { // Create a (shallow-cloned) duplicate of an object. function clone(obj) { if (!isObject(obj)) return obj; return isArray(obj) ? obj.slice() : extend({}, obj); } return clone; });