UNPKG

@sprucelabs/schema

Version:

Static and dynamic binding plus runtime validation and transformation to ensure your app is sound. 🤓

11 lines (10 loc) • 437 B
import cloneDeep from './cloneDeep.js'; export default function cloneDeepPreservingInstances(v) { return cloneDeep(v, (value) => { var _a, _b; const name = (_b = (_a = value === null || value === void 0 ? void 0 : value.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name; if (name && name !== 'Object') { return value; } }); }