cafe-utility 26.6.0 → 26.6.1

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 (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +3 -3
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -511,7 +511,7 @@ declare function proximity(one: Uint8Array, other: Uint8Array, max: number): num
511
511
  declare function commonPrefix(one: Uint8Array, other: Uint8Array): Uint8Array;
512
512
  declare function setBit(bytes: Uint8Array, index: number, value: 0 | 1): void;
513
513
  declare function getBit(bytes: Uint8Array, index: number): 0 | 1;
514
- declare function binaryIndexOf(array: Uint8Array, value: Uint8Array): number;
514
+ declare function binaryIndexOf(array: Uint8Array, value: Uint8Array, start?: number): number;
515
515
  interface Uint8ArrayIO {
516
516
  max: () => number;
517
517
  }
package/index.js CHANGED
@@ -2443,9 +2443,9 @@ function getBit(n, e) {
2443
2443
  r = e % 8
2444
2444
  return (n[t] >> (7 - r)) & 1
2445
2445
  }
2446
- function binaryIndexOf(n, e) {
2447
- for (let t = 0; t < n.length; t++)
2448
- for (let r = 0; r < e.length && n[t + r] === e[r]; r++) if (r === e.length - 1) return t
2446
+ function binaryIndexOf(n, e, t = 0) {
2447
+ for (let r = t; r < n.length; r++)
2448
+ for (let o = 0; o < e.length && n[r + o] === e[o]; o++) if (o === e.length - 1) return r
2449
2449
  return -1
2450
2450
  }
2451
2451
  class Uint8ArrayReader {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cafe-utility",
3
- "version": "26.6.0",
3
+ "version": "26.6.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "exports": {