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
This is a:
Which concerns:
This is a PR I'd like to work on someday after fixing more important issues.
I typically use babel-plugin-flow-runtime with "optInOnly": true for API argument validation. The code looks like the following:
babel-plugin-flow-runtime
"optInOnly": true
// @flow // @flow-runtime enable import reify from 'flow-runtime' import type {Type} from 'flow-runtime' type InitUserAttributes = { email: string, password: string, } type InitUserAttributesType = (reify: Type<InitUserAttributes>) export function createUser(attributes: InitUserAttributes) { InitUserAttributesType.assert(attributes) ... }
It would be nice if I could shorten this to
// @flow // @flow-runtime enable import type {Assert} from 'flow-runtime' type InitUserAttributes = { email: string, password: string, } export function createUser(attributes: Assert<InitUserAttributes>) { ... }
Basically type Assert<T> = T, but babel-plugin-flow-runtime would insert runtime assertions for any arguments using the Assert type.
type Assert<T> = T
Assert
babel-plugin-flow-runtime: 0.18.0
0.18.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is a:
Which concerns:
This is a PR I'd like to work on someday after fixing more important issues.
What is the current behaviour?
I typically use
babel-plugin-flow-runtime
with"optInOnly": true
for API argument validation. The code looks like the following:What is the expected behaviour?
It would be nice if I could shorten this to
Basically
type Assert<T> = T
, butbabel-plugin-flow-runtime
would insert runtime assertions for any arguments using theAssert
type.Which package versions are you using?
babel-plugin-flow-runtime
:0.18.0
The text was updated successfully, but these errors were encountered: