cafe-utility 21.1.0 → 21.3.0

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 +18 -1
  2. package/index.js +1228 -1186
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -225,6 +225,7 @@ declare function parseQueryString(queryString: string): Record<string, string>;
225
225
  declare function hasKey(object: Record<string, any>, key: string): boolean;
226
226
  declare function selectMax<T>(object: Record<string, T>, mapper: (item: T) => number): [string, T] | null;
227
227
  declare function reposition(array: Record<string, unknown>[], key: string, current: number, delta: number): void;
228
+ declare function unwrapSingleKey(object: Record<string, unknown>): unknown;
228
229
  declare function buildUrl(baseUrl?: string | null, path?: string | null, query?: Record<string, any> | null): string;
229
230
  declare function parseCsv(string: string, delimiter?: string, quote?: string): string[];
230
231
  declare function humanizeProgress(state: Progress): string;
@@ -424,6 +425,14 @@ declare function createHierarchy<T>(items: T[], idKey: keyof T, parentKey: keyof
424
425
  declare function log2Reduce<T>(array: T[], reducer: (a: T, b: T) => T): T;
425
426
  declare function partition(bytes: Uint8Array, size: number): Uint8Array[];
426
427
  declare function concatBytes(...arrays: Uint8Array[]): Uint8Array;
428
+ declare function isPng(bytes: Uint8Array): boolean;
429
+ declare function isJpg(bytes: Uint8Array): boolean;
430
+ declare function isWebp(bytes: Uint8Array): boolean;
431
+ declare function isImage(bytes: Uint8Array): boolean;
432
+ declare function numberToUint64LE(number: number): Uint8Array;
433
+ declare function uint64LEToNumber(bytes: Uint8Array): number;
434
+ declare function numberToUint64BE(number: number): Uint8Array;
435
+ declare function uint64BEToNumber(bytes: Uint8Array): number;
427
436
  interface Uint8ArrayIO {
428
437
  max: () => number;
429
438
  }
@@ -446,7 +455,6 @@ declare class Chunk {
446
455
  writer: Uint8ArrayWriter;
447
456
  hashFn: (a: Uint8Array, b: Uint8Array) => Uint8Array;
448
457
  constructor(capacity: number, hashFn: (a: Uint8Array, b: Uint8Array) => Uint8Array, span?: number);
449
- buildSpan(): Uint8Array;
450
458
  build(): Uint8Array;
451
459
  hash(): Uint8Array;
452
460
  }
@@ -500,6 +508,10 @@ export declare const Binary: {
500
508
  merkleStart: typeof merkleStart;
501
509
  merkleAppend: typeof merkleAppend;
502
510
  merkleFinalize: typeof merkleFinalize;
511
+ numberToUint64LE: typeof numberToUint64LE;
512
+ uint64LEToNumber: typeof uint64LEToNumber;
513
+ numberToUint64BE: typeof numberToUint64BE;
514
+ uint64BEToNumber: typeof uint64BEToNumber;
503
515
  };
504
516
  export declare const Random: {
505
517
  intBetween: typeof intBetween;
@@ -676,6 +688,7 @@ export declare const Objects: {
676
688
  hasKey: typeof hasKey;
677
689
  selectMax: typeof selectMax;
678
690
  reposition: typeof reposition;
691
+ unwrapSingleKey: typeof unwrapSingleKey;
679
692
  };
680
693
  export declare const Types: {
681
694
  isFunction: typeof isFunction;
@@ -712,6 +725,10 @@ export declare const Types: {
712
725
  asNullable: typeof asNullable;
713
726
  enforceObjectShape: typeof enforceObjectShape;
714
727
  enforceArrayShape: typeof enforceArrayShape;
728
+ isPng: typeof isPng;
729
+ isJpg: typeof isJpg;
730
+ isWebp: typeof isWebp;
731
+ isImage: typeof isImage;
715
732
  };
716
733
  export declare const Strings: {
717
734
  tokenizeByCount: typeof tokenizeByCount;