Twitter | Pretraživanje | |
Luke Edwards
Introducing `klona` – a tiny (281B) and fast utility to deep clone Arrays, Objects, Dates, RegExps & more~! It works in Node & all browsers, and so far it's the fastest version I've found. GitHub: PS: totally inspired me to do this yesterday
Reply Retweet Označi sa "sviđa mi se" More
Luke Edwards 16. sij
Odgovor korisniku/ci @_developit
I'm _definitely_ going to be adding additional "modes" to `klona`. You may have seen me do this with other modules like `dimport`, `totalist`, `throttles`, etc... IMO this is a perfect fit. Would love to hear your feedback on what I'm planning so far:
Reply Retweet Označi sa "sviđa mi se"
Jose J. Breijo 10. sij
Odgovor korisniku/ci @lukeed05 @_developit
Hey 👋. Great work as always. Just curious: Since the cloning of objects relies on recursion, which depth should be the theorical limit before a stack overflow?
Reply Retweet Označi sa "sviđa mi se"
Luke Edwards 10. sij
Odgovor korisniku/ci @josebreijo @_developit
Thank you, food question! I'll have to check when I'm back to a computer. I know it depends on the browser/context you're in. Will circle back
Reply Retweet Označi sa "sviđa mi se"
Hovhannes Babayan 10. sij
Odgovor korisniku/ci @lukeed05 @_developit
Impressed with size! Cloning Map and Set in this way is not supported in IE11 It creates a map/set but without items instead.
Reply Retweet Označi sa "sviđa mi se"
Luke Edwards 10. sij
Odgovor korisniku/ci @bhovhannes @_developit
Dang, TIL. That's a pretty useless Set/Map then. I can think of a few important libs that aren't aware of this either. Don't usually do this, but think I'm going to play the "dead browser" card.
Reply Retweet Označi sa "sviđa mi se"
Paulus Schoutsen 10. sij
Odgovor korisniku/ci @lukeed05 @_developit
Reply Retweet Označi sa "sviđa mi se"
Luke Edwards 10. sij
Odgovor korisniku/ci @balloob @_developit
Oo nice! 🍻 Are you saying you want it added to benchmark? I'm sure it'll be one of the faster items, but it'll definitely fail the validation step, so not sure how you feel about that
Reply Retweet Označi sa "sviđa mi se"
Andrea Giammarchi 10. sij
Odgovor korisniku/ci @lukeed05 @_developit
Cloning is a big word ... there are many things here not cloned: * Symbols * Accessors * Not enumerable properties * Inheritance The lib looks great for some ad-hoc use case though, but I'd put caveats/limits/non-goals on top of the readme 👋
Reply Retweet Označi sa "sviđa mi se"
Luke Edwards 10. sij
Odgovor korisniku/ci @WebReflection @_developit
For sure 👍 I had all these originally but stripped for common case. I'm planning on adding an opt-in mode/entry for complete support and docs describing the differences
Reply Retweet Označi sa "sviđa mi se"
Anton 10. sij
Odgovor korisniku/ci @lukeed05 @_developit
Great name since it means 'to clone' in Swedish 😄
Reply Retweet Označi sa "sviđa mi se"
Luke Edwards 10. sij
Odgovor korisniku/ci @cocoanton @_developit
Haha yeah 😄 and the sheep for Dolly!
Reply Retweet Označi sa "sviđa mi se"