@neovici/cosmoz-utils 6.14.2 → 6.15.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/dist/function.d.ts +1 -3
- package/dist/function.js +1 -3
- package/package.json +1 -1
package/dist/function.d.ts
CHANGED
|
@@ -6,7 +6,5 @@ export declare function constant(): () => undefined;
|
|
|
6
6
|
export declare function constant<T>(v: T): () => T;
|
|
7
7
|
export declare const constTrue: () => true, constUndefined: () => undefined, noop: () => undefined, identity: <T>(obj: T) => T, or: <A, F extends OrFn<A>>(...fns: F[]) => (...args: A[]) => boolean;
|
|
8
8
|
export declare const once: <A extends Arr, R, F extends OnceFn<A, R> = OnceFn<A, R>>(fn: F, check?: OnceCheckFn<A>) => (...args: A) => any;
|
|
9
|
-
export
|
|
10
|
-
export type InvokedParameters<F> = F extends (...args: infer A) => any ? A : never;
|
|
11
|
-
export declare function invoke<F>(fn: F, ...args: InvokedParameters<F>): InvokedType<F>;
|
|
9
|
+
export declare const invoke: <T, A extends unknown[]>(fn: T | ((...args: A) => T), ...args: A) => T;
|
|
12
10
|
export {};
|
package/dist/function.js
CHANGED
|
@@ -6,6 +6,4 @@ export const once = (fn, check = constTrue) => {
|
|
|
6
6
|
let result;
|
|
7
7
|
return (...args) => (result ??= check(args) ? fn(...args) : undefined);
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
return typeof fn === 'function' ? fn(...args) : fn;
|
|
11
|
-
}
|
|
9
|
+
export const invoke = (fn, ...args) => (typeof fn === 'function' ? fn(...args) : fn);
|