Skip to content

Commit 2f109db

Browse files
committed
enable erasableSyntaxOnly
1 parent e135a6d commit 2f109db

File tree

5 files changed

+139
-59
lines changed

5 files changed

+139
-59
lines changed

package-lock.json

Lines changed: 119 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"ts-loader": "latest",
8484
"ts-node": "latest",
8585
"tsconfig-paths": "latest",
86-
"typescript": "latest",
86+
"typescript": "^5.8.0-beta",
8787
"webpack": "latest",
8888
"webpack-cli": "latest"
8989
},

src/CachedKeyDecoder.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ export class CachedKeyDecoder implements KeyDecoder {
1616
hit = 0;
1717
miss = 0;
1818
private readonly caches: Array<Array<KeyCacheRecord>>;
19+
private readonly maxKeyLength: number;
20+
private readonly maxLengthPerKey: number;
1921

2022
constructor(
21-
readonly maxKeyLength = DEFAULT_MAX_KEY_LENGTH,
22-
readonly maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY,
23+
maxKeyLength = DEFAULT_MAX_KEY_LENGTH,
24+
maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY,
2325
) {
26+
this.maxKeyLength = maxKeyLength;
27+
this.maxLengthPerKey = maxLengthPerKey;
28+
2429
// avoid `new Array(N)`, which makes a sparse array,
2530
// because a sparse array is typically slower than a non-sparse array.
2631
this.caches = [];

src/ExtData.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
* ExtData is used to handle Extension Types that are not registered to ExtensionCodec.
33
*/
44
export class ExtData {
5+
readonly type: number;
6+
readonly data: Uint8Array;
7+
58
constructor(
6-
readonly type: number,
7-
readonly data: Uint8Array,
8-
) {}
9+
type: number,
10+
data: Uint8Array,
11+
) {
12+
this.type = type;
13+
this.data = data;
14+
}
915
}

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
5555
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
5656
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
57-
"forceConsistentCasingInFileNames": true
57+
"forceConsistentCasingInFileNames": true,
58+
59+
"erasableSyntaxOnly": true
5860

5961
/* Source Map Options */
6062
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */

0 commit comments

Comments
 (0)