We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the example:
const JsonToTS = require('json-to-ts') const json = { cats: [ {name: 'Kittin'}, {name: 'Mittin'} ], favoriteNumber: 42, favoriteWord: 'Hello' } JsonToTS(json).forEach( typeInterface => { console.log(typeInterface) })
I am in a situation where I would expect
interface Cat { name: CatLiteralString; }
rather than string
string
However I can understand situations where one would want string rather than a literal...
So my thinking is maybe we could have an option allowing us to define keys that should be string literals?
for example
JsonToTS(json,{ literals: ['name'] })
which could maybe naively treat all string name properties as literals ?
name
Thoughts?
The text was updated successfully, but these errors were encountered:
+1 on this one
Sorry, something went wrong.
No branches or pull requests
In the example:
I am in a situation where I would expect
rather than
string
However I can understand situations where one would want
string
rather than a literal...So my thinking is maybe we could have an option allowing us to define keys that should be string literals?
for example
which could maybe naively treat all string
name
properties as literals ?Thoughts?
The text was updated successfully, but these errors were encountered: