@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.
@@ -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 R | ((...args: unknown[]) => R)>(input: F, ...args: unknown[]) => R;
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
@@ -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 R | ((...args: unknown[]) => R)>(input: F, ...args: unknown[]) => R;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
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 = <R, F extends ((...args: unknown[]) => R) | R>(
197
- input: F,
198
- ...args: unknown[]
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
  };