@orpc/shared 0.25.0 → 0.27.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/index.js +2 -2
- package/dist/src/value.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -149,9 +149,9 @@ function createCallableObject(obj, handler) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/value.ts
|
|
152
|
-
function value(value2) {
|
|
152
|
+
function value(value2, ...args) {
|
|
153
153
|
if (typeof value2 === "function") {
|
|
154
|
-
return value2();
|
|
154
|
+
return value2(...args);
|
|
155
155
|
}
|
|
156
156
|
return value2;
|
|
157
157
|
}
|
package/dist/src/value.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
|
-
export type Value<T> = T | (() => Promisable<T>);
|
|
3
|
-
export declare function value<T extends Value<any
|
|
2
|
+
export type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => Promisable<T>);
|
|
3
|
+
export declare function value<T extends Value<any, TArgs>, TArgs extends any[] = []>(value: T, ...args: TArgs): Promise<T extends Value<infer U, any> ? U : never>;
|
|
4
4
|
//# sourceMappingURL=value.d.ts.map
|