The source code of a study about cloning in Javascript.
- Node.js version v18.10.0
npm run methods
npm run test
You can select a clone method by defining the METHOD environment variable.
METHOD=cloneLib NODE_ENV=test npx jest
Alternatively you can set it using dotenv.
echo METHOD="cloneLib" > .env
npm run test
echo METHOD="cloneLib" > .env
npm run test test/deep-clone/arrays.spec.js