@spscommerce/utils 5.10.2 → 5.10.5-ie

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 (73) hide show
  1. package/package.json +5 -5
  2. package/rollup.config.js +22 -0
  3. package/vite.config.js +1 -1
  4. package/lib/array/flatten.d.ts +0 -1
  5. package/lib/array/flatten.spec.d.ts +0 -1
  6. package/lib/array/index.d.ts +0 -3
  7. package/lib/array/is-subset.d.ts +0 -4
  8. package/lib/array/is-subset.spec.d.ts +0 -1
  9. package/lib/array/range.d.ts +0 -5
  10. package/lib/array/range.spec.d.ts +0 -1
  11. package/lib/classes/custom-event.d.ts +0 -4
  12. package/lib/classes/index.d.ts +0 -1
  13. package/lib/data/doctypes.d.ts +0 -4
  14. package/lib/data/index.d.ts +0 -1
  15. package/lib/decorators/cast-to-number.d.ts +0 -5
  16. package/lib/decorators/debounced.broken_spec.d.ts +0 -0
  17. package/lib/decorators/debounced.d.ts +0 -11
  18. package/lib/decorators/index.d.ts +0 -5
  19. package/lib/decorators/locked-to-animation-frames.d.ts +0 -4
  20. package/lib/decorators/locked-to-animation-frames.spec.d.ts +0 -0
  21. package/lib/decorators/simple-metadata-decorator-applicator.d.ts +0 -11
  22. package/lib/decorators/tick-delay.d.ts +0 -6
  23. package/lib/function/debounce.d.ts +0 -9
  24. package/lib/function/debounce.spec.d.ts +0 -1
  25. package/lib/function/debounced-function.interface.d.ts +0 -10
  26. package/lib/function/delayed-function.interface.d.ts +0 -10
  27. package/lib/function/index.d.ts +0 -6
  28. package/lib/function/lock-to-animation-frames.d.ts +0 -7
  29. package/lib/function/lock-to-animation-frames.spec.d.ts +0 -0
  30. package/lib/function/on-next-tick.d.ts +0 -8
  31. package/lib/function/on-next-tick.spec.d.ts +0 -1
  32. package/lib/function/op.d.ts +0 -32
  33. package/lib/function/op.spec.d.ts +0 -1
  34. package/lib/index.cjs.js +0 -1
  35. package/lib/index.d.ts +0 -9
  36. package/lib/index.es.js +0 -1024
  37. package/lib/number/constrain.d.ts +0 -7
  38. package/lib/number/decimal-round.d.ts +0 -7
  39. package/lib/number/decimal-round.spec.d.ts +0 -1
  40. package/lib/number/index.d.ts +0 -3
  41. package/lib/number/to-file-size-string.d.ts +0 -5
  42. package/lib/object/copy-property.d.ts +0 -6
  43. package/lib/object/copy-property.spec.d.ts +0 -1
  44. package/lib/object/crumble-path.d.ts +0 -6
  45. package/lib/object/crumble-path.spec.d.ts +0 -1
  46. package/lib/object/deep-freeze.d.ts +0 -1
  47. package/lib/object/deep-freeze.spec.d.ts +0 -1
  48. package/lib/object/diff.d.ts +0 -12
  49. package/lib/object/diff.spec.d.ts +0 -1
  50. package/lib/object/for-each-entry-deep.d.ts +0 -4
  51. package/lib/object/for-each-entry-deep.spec.d.ts +0 -1
  52. package/lib/object/for-each-nested-object.d.ts +0 -4
  53. package/lib/object/for-each-nested-object.spec.d.ts +0 -1
  54. package/lib/object/get-path.d.ts +0 -5
  55. package/lib/object/get-path.spec.d.ts +0 -1
  56. package/lib/object/index.d.ts +0 -13
  57. package/lib/object/merge-deep.d.ts +0 -4
  58. package/lib/object/merge-deep.spec.d.ts +0 -1
  59. package/lib/object/merge-properties-deep.d.ts +0 -4
  60. package/lib/object/merge-properties-deep.spec.d.ts +0 -1
  61. package/lib/object/omit.d.ts +0 -1
  62. package/lib/object/omit.spec.d.ts +0 -1
  63. package/lib/object/set-path.d.ts +0 -2
  64. package/lib/object/set-path.spec.d.ts +0 -1
  65. package/lib/object/traverse-path.d.ts +0 -2
  66. package/lib/object/values.d.ts +0 -2
  67. package/lib/object/values.spec.d.ts +0 -1
  68. package/lib/string/code.template-tag.d.ts +0 -2
  69. package/lib/string/index.d.ts +0 -3
  70. package/lib/string/parse-file-size.d.ts +0 -5
  71. package/lib/string/template.d.ts +0 -15
  72. package/lib/string/template.spec.d.ts +0 -1
  73. package/lib/typings.d.ts +0 -1
@@ -1,7 +0,0 @@
1
- /**
2
- * Constrains a number to the given range. If the number is below the
3
- * low end of the range, the low end will be returned. If the number is
4
- * above the top end of the range, the top end will be returned. Otherwise
5
- * the number itself will be returned.
6
- */
7
- export declare function constrain(n: number, range: [number, number]): number;
@@ -1,7 +0,0 @@
1
- /**
2
- * Progressively rounds `num` to `decimalPlaces` places. This differs from other
3
- * rounding methods out there such as lodash's, which are not progressive. For example,
4
- * `(0.149).toFixed(1)` and lodash `_.round(0.149, 1)` both return `0.1`, but this
5
- * function rounds `0.149` to `0.15` and then `0.15` to `0.2` and returns `0.2`.
6
- */
7
- export declare function decimalRound(num: number, decimalPlaces?: number): number;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./constrain";
2
- export * from "./decimal-round";
3
- export * from "./to-file-size-string";
@@ -1,5 +0,0 @@
1
- /**
2
- * Converts a file size in bytes to a human-friendly string. For example,
3
- * `toFileSizeString(2048)` will return `"2.00KB"`.
4
- */
5
- export declare function toFileSizeString(n: number, precision?: number): string;
@@ -1,6 +0,0 @@
1
- /**
2
- * Copy a property from one object to another using its property descriptor.
3
- * In other words, if it's a getter/setter on `sourceObject` it'll be the same
4
- * getter/setter on `destObject`. If it's just a value it'll be just a value.
5
- */
6
- export declare function copyProperty(propName: PropertyKey, sourceObject: any, destObject: any): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- /**
2
- * Converts a path to crumbs.
3
- * For example:
4
- * "a.b[0].c" -> ["a", "b", "0", "c"]
5
- */
6
- export declare function crumblePath(path: string | PropertyKey | PropertyKey[]): PropertyKey[];
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function deepFreeze(obj: any): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- export declare enum DiffChange {
2
- ADDITION = 0,
3
- DELETION = 1,
4
- ALTERATION = 2
5
- }
6
- export interface DiffEntry {
7
- type: DiffChange;
8
- key: PropertyKey;
9
- parentPath: PropertyKey[];
10
- objects: [Record<PropertyKey, unknown>, Record<PropertyKey, unknown>];
11
- }
12
- export declare function diff(o1: Record<PropertyKey, unknown>, o2: Record<PropertyKey, unknown>, parentPath?: PropertyKey[]): DiffEntry[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Recursively navigate a nested object & call `fn` for each key/value pair
3
- */
4
- export declare function forEachEntryDeep(object: any, fn: (key: string, value: any, object: any) => any): any;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Recursively navigate a nested object & call `fn` for each subobject
3
- */
4
- export declare function forEachNestedObject(object: any, fn: (path: PropertyKey[], object: any) => any, path?: PropertyKey[]): any;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Get the value at `path` starting from `object`.
3
- * Allows optional chaining, e.g. `get(obj, 'a.b?.c')`
4
- */
5
- export declare function getPath<T>(object: any, path: string | PropertyKey | PropertyKey[], defaultValue?: T, allOptional?: boolean): T;
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- export * from "./crumble-path";
2
- export * from "./copy-property";
3
- export * from "./deep-freeze";
4
- export * from "./diff";
5
- export * from "./for-each-entry-deep";
6
- export * from "./for-each-nested-object";
7
- export * from "./get-path";
8
- export * from "./omit";
9
- export * from "./set-path";
10
- export * from "./traverse-path";
11
- export * from "./merge-deep";
12
- export * from "./merge-properties-deep";
13
- export * from "./values";
@@ -1,4 +0,0 @@
1
- /**
2
- * Recursive merge of any number of objects
3
- */
4
- export declare function mergeDeep(...objectsToMerge: any[]): any;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Recursive merge of any number of objects using `copyProperty()` rather than assignment
3
- */
4
- export declare function mergePropertiesDeep(...objectsToMerge: any[]): any;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function omit(obj: any, ...keys: PropertyKey[]): {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** Set the value at `path` on `object`. */
2
- export declare function setPath(object: any, path: PropertyKey | PropertyKey[], newValue: any): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** Generator for iterating down a path on an object. */
2
- export declare function traversePath(object: any, path: any): Generator<any, void, unknown>;
@@ -1,2 +0,0 @@
1
- /** Returns the values of an object. */
2
- export declare function values(object: any): any[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** Template tag function for making strings containing code blocks easier to deal with. */
2
- export declare function code(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
@@ -1,3 +0,0 @@
1
- export * from "./code.template-tag";
2
- export * from "./parse-file-size";
3
- export * from "./template";
@@ -1,5 +0,0 @@
1
- /**
2
- * Parses a string as a file size and returns the size in bytes. For example,
3
- * `parseFileSize("2KB")` will return `2048`.
4
- */
5
- export declare function parseFileSize(fileSize: string): number;
@@ -1,15 +0,0 @@
1
- declare type TemplateFn = (data: any) => string;
2
- /**
3
- * Every string templating thing out there whether lodash, doT, handlebars, etc
4
- * is extremely complicated to cover a variety of use cases. This just has two
5
- * very simple features and great caution should be exercised in making it any more
6
- * complex than that. A value can be interpolated like so:
7
- * `<%= foo.bar %>`
8
- * And a basic "if" conditional can be used like so:
9
- * `<%? a?.b?.c %>This part will only appear if a.b.c is truthy!</%>`
10
- * You can put interpolations inside a conditional, as you'd expect. That's it.
11
- */
12
- export declare function template(string: string): TemplateFn;
13
- export declare function isTemplate(x: any): x is string;
14
- export declare function isTemplateFn(x: any): x is TemplateFn;
15
- export {};
@@ -1 +0,0 @@
1
- export {};
package/lib/typings.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare type Eventually<T> = T | Promise<T>;