@etsoo/shared 1.1.1 → 1.1.2
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/lib/cjs/Utils.d.ts +1 -1
- package/lib/mjs/Utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/Utils.ts +6 -3
package/lib/cjs/Utils.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare namespace Utils {
|
|
|
75
75
|
* @param args Arguments
|
|
76
76
|
* @returns Result
|
|
77
77
|
*/
|
|
78
|
-
const getResult: <R, F extends
|
|
78
|
+
const getResult: <R extends DataTypes.Simple, F extends (...args: any[]) => R>(input: R | F, ...args: Parameters<F>) => R;
|
|
79
79
|
/**
|
|
80
80
|
* Get time zone
|
|
81
81
|
* @returns Timezone
|
package/lib/mjs/Utils.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare namespace Utils {
|
|
|
75
75
|
* @param args Arguments
|
|
76
76
|
* @returns Result
|
|
77
77
|
*/
|
|
78
|
-
const getResult: <R, F extends
|
|
78
|
+
const getResult: <R extends DataTypes.Simple, F extends (...args: any[]) => R>(input: R | F, ...args: Parameters<F>) => R;
|
|
79
79
|
/**
|
|
80
80
|
* Get time zone
|
|
81
81
|
* @returns Timezone
|
package/package.json
CHANGED
package/src/Utils.ts
CHANGED
|
@@ -193,9 +193,12 @@ export namespace Utils {
|
|
|
193
193
|
* @param args Arguments
|
|
194
194
|
* @returns Result
|
|
195
195
|
*/
|
|
196
|
-
export const getResult = <
|
|
197
|
-
|
|
198
|
-
...args:
|
|
196
|
+
export const getResult = <
|
|
197
|
+
R extends DataTypes.Simple,
|
|
198
|
+
F extends (...args: any[]) => R
|
|
199
|
+
>(
|
|
200
|
+
input: F | R,
|
|
201
|
+
...args: Parameters<F>
|
|
199
202
|
): R => {
|
|
200
203
|
return typeof input === 'function' ? input(...args) : input;
|
|
201
204
|
};
|