package.dist.cjs.utils.clone.cjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
Responsive and accessible React UI components built with React and Emotion
The newest version!
"use strict";
'use strict';
function clone(obj) {
if (obj === null || typeof obj !== "object") return obj;
if (Array.isArray(obj)) return obj.map((prop) => clone(prop));
const _clone = Object.create(Object.getPrototypeOf(obj));
for (const key of Object.keys(obj)) {
_clone[key] = clone(obj[key]);
}
return _clone;
}
exports.clone = clone;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy