Skip to content

Commit

Permalink
fix: add missing optional property to types
Browse files Browse the repository at this point in the history
(was missing from #185)
  • Loading branch information
6utt3rfly committed Oct 13, 2021
1 parent 1e91c02 commit e2f758e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions typings/tsd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ declare module 'jsep' {
computed: boolean;
object: Expression;
property: Expression;
optional?: boolean;
}

export interface ThisExpression extends Expression {
Expand Down

4 comments on commit e2f758e

@pchaneyo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting this error when I build with tsc :

slang@1.0.0 build
tsc

node_modules/jsep/typings/tsd.d.ts:56:4 - error TS2411: Property 'optional' of type 'boolean | undefined' is not assignable to 'string' index type 'baseTypes | Expression | (baseTypes | Expression)[]'.

56 optional?: boolean;
~~~~~~~~

@pchaneyo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove this error, I have removed the question mark of line 56

@6utt3rfly
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pchaneyo ! I've created Issue #200 and PR #202 to hopefully address this. The optional property isn't set to false for MemberExpression in order to maintain some backward compatibility, which is why it's defined as optional?: boolean. Hopefully the PR's fix works for you as well?

@pchaneyo
Copy link

@pchaneyo pchaneyo commented on e2f758e Nov 26, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.