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

Is there a way to convert string type as strict type? #17

Open
dotennin opened this issue Dec 12, 2019 · 1 comment
Open

Is there a way to convert string type as strict type? #17

dotennin opened this issue Dec 12, 2019 · 1 comment

Comments

@dotennin
Copy link

dotennin commented Dec 12, 2019

e.g.
before

[
  {
    "ScriptId": "1",
    "ScriptCode": "NWRESTRN",
  },
  {
    "ScriptId": "2",
    "ScriptCode": "REPHSRESHP",
  }
]

after

Interface Script {
    ScriptId: '1' | '2',
    ScriptCode: 'NWRESTRN' | 'REPHSRESHP'
}
@dotennin dotennin changed the title Is there a ways to convert to string type as strict type? Is there a way to convert to string type as strict type? Dec 12, 2019
@dotennin dotennin changed the title Is there a way to convert to string type as strict type? Is there a way to convert string type as strict type? Dec 12, 2019
@robgorham
Copy link

robgorham commented Feb 7, 2020

Wouldn't that call for the need for an additional argument? ie: enums=ScriptCode,ScriptId

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

2 participants