@nxtedition/slice 1.1.1 → 1.1.3

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 +6 -0
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -42,6 +42,12 @@ export class Slice {
42
42
  throw new RangeError(`Invalid maxByteLength: ${maxByteLength}`)
43
43
  }
44
44
 
45
+ if (byteOffset + byteLength > buffer.byteLength) {
46
+ throw new RangeError(
47
+ `byteOffset + byteLength (${byteOffset + byteLength}) exceeds buffer size (${buffer.byteLength})`,
48
+ )
49
+ }
50
+
45
51
  this.buffer = buffer
46
52
  this.byteOffset = byteOffset
47
53
  this.byteLength = byteLength
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/slice",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -30,5 +30,5 @@
30
30
  "tsd": "^0.33.0",
31
31
  "typescript": "^5.9.3"
32
32
  },
33
- "gitHead": "7c9c7457c885c644c7a1e70ef894d4727ce240d6"
33
+ "gitHead": "a95ef1b72677b853fd7943f7071c266f1789e134"
34
34
  }