mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
chore: upgrade typescript
This commit is contained in:
@@ -20,7 +20,7 @@ export class Expression {
|
||||
public constructor (tokens: IterableIterator<Token>) {
|
||||
this.postfix = [...toPostfix(tokens)]
|
||||
}
|
||||
public * evaluate (ctx: Context, lenient: boolean): any {
|
||||
public * evaluate (ctx: Context, lenient: boolean): Generator<unknown, unknown, unknown> {
|
||||
assert(ctx, 'unable to evaluate: context not defined')
|
||||
const operands: any[] = []
|
||||
for (const token of this.postfix) {
|
||||
@@ -51,8 +51,8 @@ function evalPropertyAccessToken (token: PropertyAccessToken, ctx: Context, leni
|
||||
try {
|
||||
return ctx.get([token.propertyName, ...props])
|
||||
} catch (e) {
|
||||
if (lenient && e.name === 'InternalUndefinedVariableError') return null
|
||||
throw (new UndefinedVariableError(e, token))
|
||||
if (lenient && (e as Error).name === 'InternalUndefinedVariableError') return null
|
||||
throw (new UndefinedVariableError(e as Error, token))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user