Repository URL to install this package:
|
Version:
0.7.10 ▾
|
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";module.exports=function clone(x){let r;if(null==x)return x;if(x.constructor===Array){r=[];for(let i=0,n=x.length;i<n;i++)r[i]=clone(x[i])}else{if("object"!=typeof x)return x;r={};for(const key in x)x.hasOwnProperty(key)&&(r[key]=clone(x[key]))}return r};