setup-maven-cached/node_modules/underscore/amd/clone.js

12 lines
286 B
JavaScript
Raw Normal View History

2022-06-28 16:39:30 +08:00
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;
});