Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions src/global.d.ts

This file was deleted.

5 changes: 4 additions & 1 deletion src/import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export async function importProfileGroupFromBase64(
b64contents: string,
): Promise<ProfileGroup | null> {
return await importProfileGroup(
MaybeCompressedDataReader.fromArrayBuffer(fileName, decodeBase64(b64contents).buffer),
MaybeCompressedDataReader.fromArrayBuffer(
fileName,
decodeBase64(b64contents).buffer as ArrayBuffer,
),
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/import/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/lib/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ 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')
})
})

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'))
}
Expand All @@ -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])
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jsx": "react",
"noUnusedLocals": true,
"jsxFactory": "h",
"target": "es2015"
"target": "es2015",
"skipLibCheck": true
}
}