A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/tc39/proposal-record-tuple/issues/122 below:

Add recursive conversion routines? · Issue #122 · tc39/proposal-record-tuple · GitHub

Various people have raised the feature request that a recursive conversion routine should be built-in, to convert structures of Objects and Arrays to Records and Tuples. Lots of JS immutable data structure libraries have this capability.

The current draft proposal does not contain recursive conversion routines, though of course they can be implemented in JS. I think these are often used inappropriately (e.g., to clone, which should be unnecessary), and I'm not convinced we should encourage this pattern with a built-in function.

I'd be open to adding this, if we have good use cases. One option is that we could make a depth limit parameter, as the README suggests. I'm not sure if this would result in feeling too low-level, though (and people could always get around it by using a large value...).

cc @rauschma


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4