diff --git a/package-lock.json b/package-lock.json index 687c9b3..413a6fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "eslint-plugin-unused-imports": "^4.1.4", "nodemon": "^3.1.9", "tsc-alias": "^1.8.10", - "typescript": "5.6.3", + "typescript": "5.7.2", "xo": "^0.60.0" }, "engines": { @@ -6261,9 +6261,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6724,19 +6724,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/xo/node_modules/typescript": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", - "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/yaml": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", diff --git a/package.json b/package.json index 496d54f..3942b12 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "eslint-plugin-unused-imports": "^4.1.4", "nodemon": "^3.1.9", "tsc-alias": "^1.8.10", - "typescript": "5.6.3", + "typescript": "5.7.2", "xo": "^0.60.0" }, "keywords": [ diff --git a/src/bin/helpers.ts b/src/bin/helpers.ts index 8e9fa2b..7d10c7d 100644 --- a/src/bin/helpers.ts +++ b/src/bin/helpers.ts @@ -41,7 +41,7 @@ async function fileExists(filename: string): Promise { export async function streamToBuffer(input: NodeJS.ReadableStream): Promise { return new Promise((resolve, reject) => { - const chunks: ArrayBuffer[] = [] + const chunks: ArrayBufferLike[] = [] input.on('data', (chunk: Buffer) => { chunks.push(chunk.buffer) diff --git a/src/common/BinaryIO.ts b/src/common/BinaryIO.ts index e107889..7c8919c 100644 --- a/src/common/BinaryIO.ts +++ b/src/common/BinaryIO.ts @@ -2,7 +2,7 @@ import { decodeText, encodeText, repeat } from '@common/helpers.js' import { LITTLE_ENDIAN, TRUNCATE_ZERO_BYTES, KEEP_ZERO_BYTES, BYTE_OF_AN_UNKNOWN_CHAR } from '@common/constants.js' import { type ArxQuaternion, type ArxRotation, type ArxVector3 } from '@common/types.js' -export class BinaryIO extends DataView { +export class BinaryIO extends DataView { static sizeOfFloat32(): 4 { return 4 as const } diff --git a/src/common/helpers.ts b/src/common/helpers.ts index 0e6a05a..3e9363a 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -78,7 +78,7 @@ export function clamp(min: number, max: number, n: number): number { /** * @see https://stackoverflow.com/a/49129872/1806628 */ -export function concatArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer { +export function concatArrayBuffers(buffers: ArrayBufferLike[]): ArrayBuffer { if (buffers.length === 0) { return new ArrayBuffer(0) } diff --git a/src/dlf/ZoneAndPathHeader.ts b/src/dlf/ZoneAndPathHeader.ts index 3d6f23f..02738fc 100644 --- a/src/dlf/ZoneAndPathHeader.ts +++ b/src/dlf/ZoneAndPathHeader.ts @@ -88,8 +88,8 @@ export class ZoneAndPathHeader { } } - static allocateFrom(zoneOrPath: ArxZone | ArxPath): Uint8Array { - const buffer = new Uint8Array(ZoneAndPathHeader.sizeOf()) + static allocateFrom(zoneOrPath: ArxZone | ArxPath): ArrayBuffer { + const buffer = new ArrayBuffer(ZoneAndPathHeader.sizeOf()) const binary = new BinaryIO(buffer) const { pos } = zoneOrPath.points[0] diff --git a/src/ftl/FTL.ts b/src/ftl/FTL.ts index b586e5e..d401032 100644 --- a/src/ftl/FTL.ts +++ b/src/ftl/FTL.ts @@ -77,7 +77,7 @@ export class FTL { const groups = concatArrayBuffers(json.groups.map(Group.accumulateFrom)) const indices = concatArrayBuffers( json.groups.map(({ indices }) => { - const buffer = new Uint8Array(BinaryIO.sizeOfInt32Array(indices.length)) + const buffer = new ArrayBuffer(BinaryIO.sizeOfInt32Array(indices.length)) const binary = new BinaryIO(buffer) binary.writeInt32Array(indices) return buffer