@nxtedition/slice 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +3 -0
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -159,6 +159,9 @@ export class Slice {
159
159
  }
160
160
 
161
161
  at(index ) {
162
+ if (index >= this.byteLength || index < -this.byteLength) {
163
+ throw new RangeError(`Index out of range: ${index}`)
164
+ }
162
165
  return index >= 0
163
166
  ? this.buffer[this.byteOffset + index]
164
167
  : this.buffer[this.byteOffset + this.byteLength + index]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/slice",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -28,5 +28,5 @@
28
28
  "rimraf": "^6.1.2",
29
29
  "typescript": "^5.9.3"
30
30
  },
31
- "gitHead": "12c38fec15bd155797cb1edae372a81061715df3"
31
+ "gitHead": "f385fe31237669bf5f9ac1fb5154e5a353710d01"
32
32
  }