Philipp Horstenkamp 2b58149655
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
Added the underscore node_module.
2023-11-19 13:27:05 +01:00

10 lines
290 B
JavaScript

import isObject from './isObject.js';
import isArray from './isArray.js';
import extend from './extend.js';
// Create a (shallow-cloned) duplicate of an object.
export default function clone(obj) {
if (!isObject(obj)) return obj;
return isArray(obj) ? obj.slice() : extend({}, obj);
}