@antv/t8
Version:
T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative T8 markdown syntax that can be used to describe the content of data interpretation reports.
29 lines (26 loc) • 832 B
JavaScript
;
function cloneDeep(value) {
if (value === null || typeof value !== 'object') {
return value;
}
if (value instanceof Date) {
return new Date(value.getTime());
}
if (value instanceof RegExp) {
return new RegExp(value.source, value.flags);
}
if (Array.isArray(value)) {
return value.map(function (item) { return cloneDeep(item); });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var clonedObj = {};
for (var key in value) {
if (Object.prototype.hasOwnProperty.call(value, key)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
clonedObj[key] = cloneDeep(value[key]);
}
}
return clonedObj;
}
exports.cloneDeep = cloneDeep;
//# sourceMappingURL=cloneDeep.js.map