Skip to content

Add recursive conversion routines? #122

Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions