From 59690338f2a089f45505718c94b86dcb2d32f29d Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Wed, 25 Sep 2024 19:48:22 -0700 Subject: [PATCH] Target ES2015 --- src/index.ts | 10 +++++----- tsconfig.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index 922df0b..7ead0a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -179,22 +179,22 @@ function* lexer(str: string): Generator { } class Iter { - #peek?: LexToken; + private _peek?: LexToken; constructor(private tokens: Generator) {} peek(): LexToken { - if (!this.#peek) { + if (!this._peek) { const next = this.tokens.next(); - this.#peek = next.value; + this._peek = next.value; } - return this.#peek; + return this._peek; } tryConsume(type: TokenType): string | undefined { const token = this.peek(); if (token.type !== type) return; - this.#peek = undefined; // Reset after consumed. + this._peek = undefined; // Reset after consumed. return token.value; } diff --git a/tsconfig.json b/tsconfig.json index 83a86d2..03b0dd0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "@borderless/ts-scripts/configs/tsconfig.json", "compilerOptions": { - "target": "ES2020", - "lib": ["ES2020"], + "target": "ES2015", + "lib": ["ES2015"], "rootDir": "src", "outDir": "dist", "module": "NodeNext",