yummies 3.2.12 → 3.2.13
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/common.d.ts +9 -1
- package/common.d.ts.map +1 -1
- package/common.js +9 -3
- package/package.json +1 -1
package/common.d.ts
CHANGED
|
@@ -3,5 +3,13 @@ import { MaybeFn } from './utils/types.js';
|
|
|
3
3
|
* @deprecated use {MaybeFn} type
|
|
4
4
|
*/
|
|
5
5
|
export type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Calls the provided function with the given arguments if it is a function;
|
|
8
|
+
* otherwise, returns the value directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const callFunction: <TValue, TArgs extends any[] = []>(fn: MaybeFn<TValue, TArgs>, ...args: TArgs) => TValue;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated use {callFunction}
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveFnValue: <TValue, TArgs extends any[] = []>(fn: MaybeFn<TValue, TArgs>, ...args: TArgs) => TValue;
|
|
7
15
|
//# sourceMappingURL=common.d.ts.map
|
package/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3D,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAC1B,GAAG,MAAM,KAAK,WAOf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAdE,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,WAClD,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,WACjB,KAAK,WAY0B,CAAC"}
|
package/common.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Calls the provided function with the given arguments if it is a function;
|
|
3
|
+
* otherwise, returns the value directly.
|
|
4
|
+
*/
|
|
5
|
+
export const callFunction = (fn, ...args) => {
|
|
4
6
|
if (typeof fn === 'function') {
|
|
5
7
|
return fn(...args);
|
|
6
8
|
}
|
|
7
9
|
return fn;
|
|
8
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated use {callFunction}
|
|
13
|
+
*/
|
|
14
|
+
export const resolveFnValue = callFunction;
|