davidmarkclements / rfdc

Really Fast Deep Clone
MIT License
635 stars 24 forks source link

feat: support cloning sets and maps #23

Closed JammSpread closed 3 years ago

JammSpread commented 3 years ago

Adds deep cloning functionality for objects of type Set and Map. Fixes #17.

codecov[bot] commented 3 years ago

Codecov Report

Merging #23 (4b284f2) into master (a6cb5f0) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #23   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          112       136   +24     
=========================================
+ Hits           112       136   +24     
Impacted Files Coverage Δ
index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a6cb5f0...4b284f2. Read the comment docs.

JammSpread commented 3 years ago

Should Symbol.iterator be checked for and cloned if possible? This wouldn't be copying all the symbol properties (#12) necessarily. This would allow support (even if partial) for iterables in general.

mcollina commented 3 years ago

I would not copy non-enumerable properties. This is designed to be a fast replacement for JSON.parse(JSON.stringify(o)).

davidmarkclements commented 3 years ago

I would not copy non-enumerable properties. This is designed to be a fast replacement for JSON.parse(JSON.stringify(o)).

agreed

davidmarkclements commented 3 years ago

thanks @JammSpread 4.3.0 released