Clone Lab
Deeply clone arrays, maps, sets, dates, plain objects, and class instances.
Install
With npm:
npm i --save clone-lab
Or with yarn:
yarn add -D clone-lab
Example
// @flow; name: string; { thisname = name; } dateOfBirth: Date; character: Set<string>; { supername; thisdateOfBirth = dateOfBirth; thischaracter = character; } parents: Map<string Parent> = ; const child = 'Holly';const mother = 'Offred' '1970-01-01T03:24:00' 'kind' 'devotional';const father = 'Nick' '1975-01-01T05:12:00' 'calm' 'brave';childparents;childparents; const clonedChild = ;
Limitations
Cycles are not supported at this moment, i.e. this does not work:
next: Node; const node = ;nodenext = node; ; // error
License
MIT