diff --git a/package.json b/package.json index d40e9c1..5e57808 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "description": "Read and write binary data on ArrayBuffers", "author": "Michaƫl Zasso", "type": "module", - "exports": "./lib/iobuffer.js", + "exports": { + ".": "./lib/iobuffer.js" + }, "files": [ "lib", "src" @@ -23,15 +25,16 @@ "tsc": "npm run clean && npm run tsc-build", "tsc-build": "tsc --project tsconfig.build.json" }, + "dependencies": {}, "devDependencies": { - "@types/node": "^24.0.14", + "@types/node": "^24.2.1", "@vitest/coverage-v8": "^3.2.4", "@zakodium/tsconfig": "^1.0.2", - "eslint": "^9.31.0", + "eslint": "^9.33.0", "eslint-config-cheminfo-typescript": "^19.0.0", "prettier": "^3.6.2", "rimraf": "^6.0.1", - "typescript": "^5.8.3", + "typescript": "^5.9.2", "vitest": "^3.2.4" }, "repository": { diff --git a/src/iobuffer.ts b/src/iobuffer.ts index e650041..59a0c6f 100644 --- a/src/iobuffer.ts +++ b/src/iobuffer.ts @@ -306,7 +306,7 @@ export class IOBuffer { /** * Creates an array of corresponding to the type `type` and size `size`. - * For example type `uint8` will create a `Uint8Array`. + * For example, type `uint8` will create a `Uint8Array`. * @param size - size of the resulting array * @param type - number type of elements to read * @returns The read array. @@ -325,12 +325,12 @@ export class IOBuffer { ) { const slice = new Uint8Array(this.buffer.slice(offset, offset + bytes)); slice.reverse(); - const returnArray = new typedArrays[type](slice.buffer); + const returnArray = new typedArrays[type](slice.buffer as ArrayBuffer); this.offset += bytes; returnArray.reverse(); return returnArray as InstanceType; } - const returnArray = new typedArrays[type](slice); + const returnArray = new typedArrays[type](slice as ArrayBuffer); this.offset += bytes; return returnArray as InstanceType; } diff --git a/tsconfig.build.json b/tsconfig.build.json index ba24b0a..1fec47c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.json", - "compilerOptions": {}, - "exclude": ["**/__tests__"] + "include": ["src"], + "exclude": ["**/__tests__", "**/*.test.ts"] } diff --git a/tsconfig.json b/tsconfig.json index b66204a..976fdcf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,5 +4,5 @@ "types": ["node"], "outDir": "lib" }, - "include": ["src"] + "include": ["src", "vite*.ts"] }