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
Documentation shows the following example for shape generator:
gen({ type: 'Place', name: gen.string, location: [ gen.number, gen.number ], address: { street: gen.string, city: gen.string } })
This works perfectly fine in plain JS in master.
master
But in TS:
gen({ type: 'Place' })
causes compilation error: Type 'string' is not assignable to type 'ValueGenerator<{}>'
Type 'string' is not assignable to type 'ValueGenerator<{}>'
gen({ location: [ gen.number, gen.number ], })
causes compilation error: Type 'ValueGenerator<number>[]' is not assignable to type 'ValueGenerator<{}>'.
Type 'ValueGenerator<number>[]' is not assignable to type 'ValueGenerator<{}>'.
gen({ address: { street: gen.string, city: gen.string } })
causes compilation error: Type '{ street: ValueGenerator<string>; city: ValueGenerator<string>; }' is not assignable to type 'ValueGenerator<{}>'.
Type '{ street: ValueGenerator<string>; city: ValueGenerator<string>; }' is not assignable to type 'ValueGenerator<{}>'.
The text was updated successfully, but these errors were encountered:
This looks like a more specific case of #79
Sorry, something went wrong.
Found an easy workaround:
gen({ type: 'Place', name: gen.string, location: [ gen.number, gen.number ], address: { street: gen.string, city: gen.string } } as {})
No branches or pull requests
Documentation shows the following example for shape generator:
This works perfectly fine in plain JS in
master
.But in TS:
causes compilation error:
Type 'string' is not assignable to type 'ValueGenerator<{}>'
causes compilation error:
Type 'ValueGenerator<number>[]' is not assignable to type 'ValueGenerator<{}>'.
causes compilation error:
Type '{ street: ValueGenerator<string>; city: ValueGenerator<string>; }' is not assignable to type 'ValueGenerator<{}>'.
The text was updated successfully, but these errors were encountered: