@spscommerce/utils 7.1.4 → 7.2.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.
package/README.md CHANGED
@@ -34,10 +34,7 @@ npm install --save @spscommerce/utils
34
34
  </tr>
35
35
  </thead>
36
36
  <tbody class="sps-table__body">
37
- <tr class="sps-table__row"><td class="sps-table__cell"><a href="https://lodash.com/">lodash.isempty</a></td><td class="sps-table__cell text-right">^4.4.0</td></tr>
38
- <tr class="sps-table__row"><td class="sps-table__cell"><a href="https://lodash.com/">lodash.isnil</a></td><td class="sps-table__cell text-right">^4.0.0</td></tr>
39
- <tr class="sps-table__row"><td class="sps-table__cell"><a href="https://lodash.com/">lodash.isplainobject</a></td><td class="sps-table__cell text-right">^4.0.6</td></tr>
40
- <tr class="sps-table__row"><td class="sps-table__cell"><a href="https://lodash.com/">lodash.padstart</a></td><td class="sps-table__cell text-right">^4.6.1</td></tr>
37
+ <tr class="sps-table__row"><td class="sps-table__cell">raf-stub</td><td class="sps-table__cell text-right">^2.0.2</td></tr>
41
38
  </tbody>
42
39
  </table>
43
40
  </div>
@@ -1 +1 @@
1
- export declare function flatten(arg: any): any;
1
+ export declare function flatten(arg: unknown): typeof arg | unknown[];
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Tests if candidate is a subset of array
3
3
  */
4
- export declare function isSubset(candidate: any[], array: any[]): boolean;
4
+ export declare function isSubset(candidate: unknown[], array: unknown[]): boolean;
@@ -1,11 +1,4 @@
1
1
  /**
2
2
  * Decorator that applies `debounce`
3
3
  */
4
- export declare function debounced(ms: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {
5
- configurable?: boolean;
6
- enumerable?: boolean;
7
- value?: any;
8
- writable?: boolean;
9
- get?(): any;
10
- set?(v: any): void;
11
- };
4
+ export declare function debounced(ms: number): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Decorator that applies `lockToAnimationFrames`
3
3
  */
4
- export declare function lockedToAnimationFrames(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
4
+ export declare function lockedToAnimationFrames(target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
@@ -1,5 +1,5 @@
1
- export type MetadataProperty<T, K = any> = T | ((classInstance: K) => T);
2
- export type MetadataObject<K> = Record<string, MetadataProperty<any, K>>;
1
+ export type MetadataProperty<T, K = unknown> = T | ((classInstance: K) => T);
2
+ export type MetadataObject<K> = Record<string, MetadataProperty<unknown, K>>;
3
3
  /**
4
4
  * This would be simpler to understand as a factory that returns a decorator function,
5
5
  * but TypeScript AoT compliation doesn't allow that. This lets you create a decorator
@@ -8,4 +8,4 @@ export type MetadataObject<K> = Record<string, MetadataProperty<any, K>>;
8
8
  * decorator but calling this method and returning the result is the only thing it
9
9
  * needs to do.
10
10
  */
11
- export declare function simpleMetadataDecoratorApplicator<T extends MetadataObject<K>, K>(metadata: Partial<T>, defaults: T, target: any, key: PropertyKey, descriptor: TypedPropertyDescriptor<K>): TypedPropertyDescriptor<K>;
11
+ export declare function simpleMetadataDecoratorApplicator<T extends MetadataObject<K>, K>(metadata: Partial<T>, defaults: T, target: unknown, key: PropertyKey, descriptor: TypedPropertyDescriptor<K>): TypedPropertyDescriptor<K>;
@@ -1,6 +1,6 @@
1
1
  interface FunctionPropertyDescriptor extends PropertyDescriptor {
2
- value: (...args: unknown[]) => unknown;
2
+ value?: (...args: unknown[]) => unknown;
3
3
  }
4
4
  /** Method decorator that configures the method to always run the tick after it's invoked */
5
- export declare function tickDelay(target: any, propertyKey: string, descriptor: FunctionPropertyDescriptor): FunctionPropertyDescriptor;
5
+ export declare function tickDelay(target: object, propertyKey: string, descriptor: FunctionPropertyDescriptor): FunctionPropertyDescriptor;
6
6
  export {};
@@ -6,4 +6,4 @@ import type { DelayedFunction } from "./delayed-function.interface";
6
6
  * if you need to have something happen when the debounced function
7
7
  * finally gets called and returns a value.
8
8
  */
9
- export declare function debounce<T>(functionToDebounce: (...args: any[]) => Eventually<T>, milliseconds: number, thisArg?: any): DelayedFunction<Promise<T>>;
9
+ export declare function debounce<T>(functionToDebounce: (...args: unknown[]) => Eventually<T>, milliseconds: number, thisArg?: unknown): DelayedFunction<Promise<T>>;
@@ -1,10 +1,10 @@
1
1
  import type { DelayedFunction } from "./delayed-function.interface";
2
2
  /** docs:ignore */
3
3
  export interface DebouncedFunction<T> extends DelayedFunction<Promise<T>> {
4
- (...args: any[]): Promise<T>;
4
+ (...args: unknown[]): Promise<T>;
5
5
  _promise?: Promise<T>;
6
6
  _promiseCallbacks?: {
7
- resolve: any;
8
- reject: any;
7
+ resolve: unknown;
8
+ reject: unknown;
9
9
  };
10
10
  }
@@ -3,7 +3,7 @@
3
3
  * `lockToAnimationFrames`.
4
4
  */
5
5
  export interface DelayedFunction<T> {
6
- (...args: any[]): T;
6
+ (...args: unknown[]): T;
7
7
  pending?: boolean;
8
8
  reset?: () => boolean;
9
9
  id?: number;
@@ -4,4 +4,4 @@ import type { DelayedFunction } from "./delayed-function.interface";
4
4
  * the given function will run only in `requestAnimationFrame()` and at
5
5
  * most once per frame.
6
6
  */
7
- export declare function lockToAnimationFrames(functionToLock: () => any, thisArg?: any): DelayedFunction<any>;
7
+ export declare function lockToAnimationFrames(functionToLock: () => unknown, thisArg?: unknown): DelayedFunction<unknown>;
@@ -5,4 +5,4 @@
5
5
  * component class, performing that assignment on the next tick, i.e. when
6
6
  * all of Angular's current cycle is finished, will resolve that error.
7
7
  */
8
- export declare function onNextTick(fn: (...args: unknown[]) => unknown, thisArg?: any): void;
8
+ export declare function onNextTick(fn: (...args: unknown[]) => unknown, thisArg?: unknown): void;
@@ -3,30 +3,30 @@
3
3
  * with functional programming tools like map, filter, and reduce.
4
4
  */
5
5
  export declare const Op: {
6
- add: (a: any, b: any) => any;
7
- and: (a: any, b: any) => any;
8
- band: (a: any, b: any) => number;
9
- bor: (a: any, b: any) => number;
10
- bxor: (a: any, b: any) => number;
11
- bnot: (a: any) => number;
6
+ add: (a: number, b: number) => number;
7
+ and: (a: boolean, b: boolean) => boolean;
8
+ band: (a: number, b: number) => number;
9
+ bor: (a: number, b: number) => number;
10
+ bxor: (a: number, b: number) => number;
11
+ bnot: (a: number) => number;
12
12
  decr: (a: number) => number;
13
13
  div: (a: number, b: number) => number;
14
- eq: (a: any, b: any) => boolean;
14
+ eq: (a: unknown, b: unknown) => boolean;
15
15
  exp: (a: number, b: number) => number;
16
- gt: (a: any, b: any) => boolean;
17
- gte: (a: any, b: any) => boolean;
16
+ gt: (a: number, b: number) => boolean;
17
+ gte: (a: number, b: number) => boolean;
18
18
  incr: (a: number) => number;
19
- lshift: (a: any, b: any) => number;
20
- lt: (a: any, b: any) => boolean;
21
- lte: (a: any, b: any) => boolean;
19
+ lshift: (a: number, b: number) => number;
20
+ lt: (a: number, b: number) => boolean;
21
+ lte: (a: number, b: number) => boolean;
22
22
  mul: (a: number, b: number) => number;
23
23
  neg: (a: number) => number;
24
- neq: (a: any, b: any) => boolean;
25
- not: (a: any) => boolean;
26
- or: (a: any, b: any) => any;
24
+ neq: (a: number, b: number) => boolean;
25
+ not: (a: number) => boolean;
26
+ or: (a: boolean, b: boolean) => boolean;
27
27
  rem: (a: number, b: number) => number;
28
- rshift: (a: any, b: any) => number;
29
- rshift_zf: (a: any, b: any) => number;
28
+ rshift: (a: number, b: number) => number;
29
+ rshift_zf: (a: number, b: number) => number;
30
30
  sub: (a: number, b: number) => number;
31
- xor: (a: any, b: any) => boolean;
31
+ xor: (a: boolean, b: boolean) => boolean;
32
32
  };