mobily / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
1.11k stars 31 forks source link

Feature request: Object Copying #44

Closed kee-oth closed 1 year ago

kee-oth commented 2 years ago

Hi!

Is a D.copy function planned?

Thanks!

mobily commented 2 years ago

@kee-oth not sure, what's the purpose of D.copy, since all ts-belt functions return immutable data

mobily commented 1 year ago

closing due to inactivity, feel free to reopen the issue if you need so :)

john-trashlab commented 1 year ago

What if we wanted to use an immutable input as input into a mutable function in the pipeline and thus needed to deep clone the object/array?

ex.

pipe(
  readOnlyArrayofReadOnlyObjects,
  D.deepClone,
  F.toMutable,
  customMutatingFunction
)