Wrapper for fast object cloning using
JSON.parse&JSON.stringify. see Benchmarks.
Notes:
- cannot clone
RegExp(returns{}) NaNvalues will be converted tonullDateobjects will be converted to ISO strings (equivalent of runningDate.toISOString())- you can reconstruct the Date by calling
new Date(string)
- you can reconstruct the Date by calling
npm install --only=production --save stringify-cloneconst clone = require('stringify-clone')
clone({
foo: 'bar'
})©️ ahmadnassri.com · License: ISC · Github: @ahmadnassri · Twitter: @ahmadnassri