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
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions src/iobuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<TypedArrays[T]>;
}
const returnArray = new typedArrays[type](slice);
const returnArray = new typedArrays[type](slice as ArrayBuffer);
this.offset += bytes;
return returnArray as InstanceType<TypedArrays[T]>;
}
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {},
"exclude": ["**/__tests__"]
"include": ["src"],
"exclude": ["**/__tests__", "**/*.test.ts"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"types": ["node"],
"outDir": "lib"
},
"include": ["src"]
"include": ["src", "vite*.ts"]
}