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
Before:
const statement = { type: 'IfStatement', test: { type: 'BinaryExpression', left: { type: 'MemberExpression', object: { type: 'Identifier', name: OBJECT_VARIABLE }, property: { type: 'Identifier', name: 'language' } }, right: { type: 'Literal', value: language }, operator: '===' }, consequent: { type: 'BlockStatement', body: [ getTemplateAssignmentExpression(options.variables.template, { type: 'Literal', value: text.content }) ] }, alternate: null }
After:
const statement = new IfStatement({ test: new BinaryExpression({ left: new MemberExpression({ object: new Identifier({ name: OBJECT_VARIABLE }), property: new Identifier({ name: 'language' }) }), right: new Literal({ value: language }), operator: '===' }), consequent: new BlockStatement({ body: [ getTemplateAssignmentExpression(options.variables.template, { type: 'Literal', value: text.content }) ] }) })
Those classes could throw if you forget to set a required property, e.g. BinaryExpression would throw if operator wouldn't be passed.
BinaryExpression
operator
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Before:
After:
Those classes could throw if you forget to set a required property, e.g.
BinaryExpression
would throw ifoperator
wouldn't be passed.The text was updated successfully, but these errors were encountered: