-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix build error for special characters #64
base: dev
Are you sure you want to change the base?
Conversation
Thank you for the PR! It looks like you've changed the line endings of the file though, could you please use the line endings defined in the .prettierrc.json file? Also, could you please use the |
@rmagur1203 Are you still planning to make the edits required on this PR? |
In prettierrc, the end of line is set to crlf, but in reality it seems to be set to lf. |
@@ -171,7 +174,7 @@ export function _not(exp: ts.Expression): ts.Expression { | |||
export function _access(exp: ts.Expression, key: string | number | ts.Expression): ts.Expression { | |||
if (typeof key === "string") { | |||
if (isInt(key)) return factory.createElementAccessExpression(exp, ts.factory.createNumericLiteral(key)); | |||
return ts.factory.createPropertyAccessExpression(exp, key); | |||
return ts.factory.createElementAccessExpression(exp, ts.factory.createStringLiteral(key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this always create element access expressions? It would be nice to create element access expressions only when necessary because otherwise code turns to this:
// We don't want this
errs["push"]("Expected value to be an object");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sure looks good to use createElementAccessExpression only when there are special characters, but since it is only used to access data and is a built file, it doesn't seem to matter much.
#63