diff --git a/package-lock.json b/package-lock.json index 0dd0460f..fc168f4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "source-map": "0.6.1", "ts-jest": "24.3.0", "tsx": "4.19.2", - "typescript": "5.3.3", + "typescript": "5.9.3", "typescript-json-schema": "0.67.0", "uglify-es": "3.2.2", "uint8array-json-parser": "0.0.2" @@ -10839,9 +10839,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 0868b0c7..118cd4fa 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "source-map": "0.6.1", "ts-jest": "24.3.0", "tsx": "4.19.2", - "typescript": "5.3.3", + "typescript": "5.9.3", "typescript-json-schema": "0.67.0", "uglify-es": "3.2.2", "uint8array-json-parser": "0.0.2" diff --git a/src/global.d.ts b/src/global.d.ts deleted file mode 100644 index dc1f31bd..00000000 --- a/src/global.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare global { - // Mock modern Typescript constructs used in JfrView until we update our Typescript - interface SymbolConstructor { - readonly dispose: symbol - } -} - -export {} diff --git a/src/import/index.ts b/src/import/index.ts index 400166e7..a3e1eed9 100644 --- a/src/import/index.ts +++ b/src/import/index.ts @@ -38,7 +38,10 @@ export async function importProfileGroupFromBase64( b64contents: string, ): Promise { return await importProfileGroup( - MaybeCompressedDataReader.fromArrayBuffer(fileName, decodeBase64(b64contents).buffer), + MaybeCompressedDataReader.fromArrayBuffer( + fileName, + decodeBase64(b64contents).buffer as ArrayBuffer, + ), ) } diff --git a/src/import/utils.ts b/src/import/utils.ts index 9c78246e..cdbd6b8f 100644 --- a/src/import/utils.ts +++ b/src/import/utils.ts @@ -230,7 +230,7 @@ export class MaybeCompressedDataReader implements ProfileDataSource { ) { this.uncompressedData = maybeCompressedDataPromise.then(async (fileData: ArrayBuffer) => { try { - const result = pako.inflate(new Uint8Array(fileData)).buffer + const result = pako.inflate(new Uint8Array(fileData)).buffer as ArrayBuffer return result } catch (e) { return fileData diff --git a/src/lib/utils.test.ts b/src/lib/utils.test.ts index 5d02f5d8..aa6834ce 100644 --- a/src/lib/utils.test.ts +++ b/src/lib/utils.test.ts @@ -243,7 +243,7 @@ test('decodeBase64', () => { test('BufferBackedTextFileContent.firstChunk', async () => { await withMockedFileChunkSizeForTests(2, () => { const str = 'may\nyour\nrope\nbe\nlong' - const buffer = new TextEncoder().encode(str).buffer + const buffer = new TextEncoder().encode(str).buffer as ArrayBuffer const content = new BufferBackedTextFileContent(buffer) expect(content.firstChunk()).toEqual('ma') }) @@ -251,7 +251,7 @@ test('BufferBackedTextFileContent.firstChunk', async () => { test('BufferBackedTextFileContent.splitLines', async () => { function testWithString(str: string) { - const buffer = new TextEncoder().encode(str).buffer + const buffer = new TextEncoder().encode(str).buffer as ArrayBuffer const content = new BufferBackedTextFileContent(buffer) expect([...content.splitLines()]).toEqual(str.split('\n')) } @@ -270,7 +270,7 @@ test('BufferBackedTextFileContent.parseAsJSON', async () => { // parseAsJSON is special cased to permissively allow trailing commas // and a mission closing bracket const str = '[200,300,400,' - const buffer = new TextEncoder().encode(str).buffer + const buffer = new TextEncoder().encode(str).buffer as ArrayBuffer const content = new BufferBackedTextFileContent(buffer) expect(content.parseAsJSON()).toEqual([200, 300, 400]) diff --git a/tsconfig.json b/tsconfig.json index 69ec122f..9066b374 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "jsx": "react", "noUnusedLocals": true, "jsxFactory": "h", - "target": "es2015" + "target": "es2015", + "skipLibCheck": true } }