Skip to content

Commit 5850324

Browse files
committed
chore: switch Binary.isAssignmentOperation to type guard function
1 parent 4929577 commit 5850324

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/compiler/src/expression_parser

packages/compiler/src/expression_parser/ast.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ export class Interpolation extends AST {
268268
}
269269
}
270270

271+
type AssignmentOperation = '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '**=' | '&&=' | '||=' | '??=';
272+
271273
export class Binary extends AST {
272274
constructor(
273275
span: ParseSpan,
@@ -282,7 +284,7 @@ export class Binary extends AST {
282284
return visitor.visitBinary(this, context);
283285
}
284286

285-
static isAssignmentOperation(op: string): boolean {
287+
static isAssignmentOperation(op: string): op is AssignmentOperation {
286288
return (
287289
op === '=' ||
288290
op === '+=' ||

0 commit comments

Comments
 (0)