Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically detect maps (feature request) #14

Open
qpwo opened this issue Feb 24, 2021 · 0 comments
Open

Automatically detect maps (feature request) #14

qpwo opened this issue Feb 24, 2021 · 0 comments

Comments

@qpwo
Copy link

qpwo commented Feb 24, 2021

Sometimes there are maps in JSON:

{
    "x": 5,
    "y": 6,
    "should_be_in_ts": {
        "metadata": "goes here",
        "or": "whatever"
    },
    "should_be_ts_map_not_an_interface": {
        "key1": {
            "a": 1,
            "b": 2
        },
        "key2": {
            "a": 3,
            "b": 4
        },
        "key3": {
            "a": 5,
            "b": 6
        },
        "key4": {
            "a": 7,
            "b": 8
        },
        "key5": {
            "a": 9,
            "b": 10
        }
    }
}

I wonder if it would be possible to automatically detect these somehow. If for example you each value for should_be_ts_map_not_an_interface had a bunch of different keys then it's probably a map and not an interface. Or if there are a thousand keys, it's definitely a map. Etc.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant