utils.d.ts 770 B

123456789101112131415161718192021
  1. /// <reference types="node" />
  2. declare type Sequence = number[] | Buffer | Uint8Array;
  3. /**
  4. * Check whether two sequences (e.g. Arrays of numbers) are equal.
  5. *
  6. * @param arr1 - One of the arrays to compare.
  7. * @param arr2 - The other array to compare.
  8. */
  9. export declare function seqEqual(arr1: Sequence, arr2: Sequence): boolean;
  10. /**
  11. * Concatenate all `arguments` into a single array. Each argument can be either
  12. * a single element or a sequence, which has a `length` property and supports
  13. * element retrieval via sequence[ix].
  14. *
  15. * > concatArgs(1, [2, 3], Buffer.from([4,5]), new Uint8Array([6, 7]));
  16. * [1,2,3,4,5,6,7]
  17. *
  18. * @returns Array of concatenated arguments
  19. */
  20. export declare function concatArgs(...args: Array<number | Sequence>): number[];
  21. export {};