@orpc/shared 0.0.0-next.d9aa1c2 → 0.0.0-next.d9e58e7

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/README.md CHANGED
@@ -54,6 +54,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
54
54
  - [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
55
55
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
56
56
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
57
+ - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with NestJS.
57
58
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
58
59
  - [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
59
60
  - [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
package/dist/index.d.mts CHANGED
@@ -10,11 +10,21 @@ declare function splitInHalf<T>(arr: readonly T[]): [T[], T[]];
10
10
 
11
11
  type AnyFunction = (...args: any[]) => any;
12
12
  declare function once<T extends () => any>(fn: T): () => ReturnType<T>;
13
+ declare function sequential<A extends any[], R>(fn: (...args: A) => Promise<R>): (...args: A) => Promise<R>;
14
+ /**
15
+ * Executes the callback function after the current call stack has been cleared.
16
+ */
17
+ declare function defer(callback: () => void): void;
13
18
 
14
19
  type OmitChainMethodDeep<T extends object, K extends keyof any> = {
15
20
  [P in keyof Omit<T, K>]: T[P] extends AnyFunction ? ((...args: Parameters<T[P]>) => OmitChainMethodDeep<ReturnType<T[P]>, K>) : T[P];
16
21
  };
17
22
 
23
+ declare class SequentialIdGenerator {
24
+ private nextId;
25
+ generate(): number;
26
+ }
27
+
18
28
  type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
19
29
  type IntersectPick<T, U> = Pick<T, keyof T & keyof U>;
20
30
  type PromiseWithError<T, TError> = Promise<T> & {
@@ -34,10 +44,10 @@ type ThrowableError = Registry extends {
34
44
  } ? T : Error;
35
45
 
36
46
  type InterceptableOptions = Record<string, any>;
37
- type InterceptorOptions<TOptions extends InterceptableOptions, TResult, TError> = Omit<TOptions, 'next'> & {
38
- next(options?: TOptions): PromiseWithError<TResult, TError>;
47
+ type InterceptorOptions<TOptions extends InterceptableOptions, TResult> = Omit<TOptions, 'next'> & {
48
+ next(options?: TOptions): TResult;
39
49
  };
40
- type Interceptor<TOptions extends InterceptableOptions, TResult, TError> = (options: InterceptorOptions<TOptions, TResult, TError>) => Promisable<TResult>;
50
+ type Interceptor<TOptions extends InterceptableOptions, TResult> = (options: InterceptorOptions<TOptions, TResult>) => TResult;
41
51
  /**
42
52
  * Can used for interceptors or middlewares
43
53
  */
@@ -63,9 +73,14 @@ type OnFinishState<TResult, TError> = [error: TError, data: undefined, isSuccess
63
73
  declare function onFinish<T, TOptions extends {
64
74
  next(): any;
65
75
  }, TRest extends any[]>(callback: NoInfer<(state: OnFinishState<Awaited<ReturnType<TOptions['next']>>, ReturnType<TOptions['next']> extends PromiseWithError<any, infer E> ? E : ThrowableError>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => T | Promise<Awaited<ReturnType<TOptions['next']>>>;
66
- declare function intercept<TOptions extends InterceptableOptions, TResult, TError>(interceptors: Interceptor<TOptions, TResult, TError>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => Promisable<TResult>>): Promise<TResult>;
76
+ declare function intercept<TOptions extends InterceptableOptions, TResult>(interceptors: Interceptor<TOptions, TResult>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => TResult>): TResult;
67
77
 
68
78
  declare function isAsyncIteratorObject(maybe: unknown): maybe is AsyncIteratorObject<any, any, any>;
79
+ interface CreateAsyncIteratorObjectCleanupFn {
80
+ (reason: 'return' | 'throw' | 'next' | 'dispose'): Promise<void>;
81
+ }
82
+ declare function createAsyncIteratorObject<T, TReturn, TNext>(next: () => Promise<IteratorResult<T, TReturn>>, cleanup: CreateAsyncIteratorObjectCleanupFn): AsyncIteratorObject<T, TReturn, TNext> & AsyncGenerator<T, TReturn, TNext>;
83
+ declare function replicateAsyncIterator<T, TReturn, TNext>(source: AsyncIterator<T, TReturn, TNext>, count: number): (AsyncIteratorObject<T, TReturn, TNext> & AsyncGenerator<T, TReturn, TNext>)[];
69
84
 
70
85
  declare function parseEmptyableJSON(text: string | null | undefined): unknown;
71
86
  declare function stringifyJSON<T>(value: T): undefined extends T ? undefined | string : string;
@@ -85,9 +100,30 @@ declare function isObject(value: unknown): value is Record<PropertyKey, unknown>
85
100
  declare function isTypescriptObject(value: unknown): value is object & Record<PropertyKey, unknown>;
86
101
  declare function clone<T>(value: T): T;
87
102
  declare function get(object: object, path: readonly string[]): unknown;
103
+ declare function isPropertyKey(value: unknown): value is PropertyKey;
104
+ declare const NullProtoObj: ({
105
+ new <T extends Record<PropertyKey, unknown>>(): T;
106
+ });
107
+
108
+ interface AsyncIdQueueCloseOptions {
109
+ id?: number;
110
+ reason?: unknown;
111
+ }
112
+ declare class AsyncIdQueue<T> {
113
+ private readonly openIds;
114
+ private readonly items;
115
+ private readonly pendingPulls;
116
+ get length(): number;
117
+ open(id: number): void;
118
+ isOpen(id: number): boolean;
119
+ push(id: number, item: T): void;
120
+ pull(id: number): Promise<T>;
121
+ close({ id, reason }?: AsyncIdQueueCloseOptions): void;
122
+ assertOpen(id: number): void;
123
+ }
88
124
 
89
- type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => Promisable<T>);
90
- declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): Promise<T extends Value<infer U, any> ? U : never>;
125
+ type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => T);
126
+ declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): T extends Value<infer U, any> ? U : never;
91
127
 
92
- export { clone, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, splitInHalf, stringifyJSON, toArray, value };
93
- export type { AnyFunction, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, PromiseWithError, Registry, Segment, SetOptional, ThrowableError, Value };
128
+ export { AsyncIdQueue, NullProtoObj, SequentialIdGenerator, clone, createAsyncIteratorObject, defer, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, replicateAsyncIterator, resolveMaybeOptionalOptions, sequential, splitInHalf, stringifyJSON, toArray, value };
129
+ export type { AnyFunction, AsyncIdQueueCloseOptions, CreateAsyncIteratorObjectCleanupFn, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, PromiseWithError, Registry, Segment, SetOptional, ThrowableError, Value };
package/dist/index.d.ts CHANGED
@@ -10,11 +10,21 @@ declare function splitInHalf<T>(arr: readonly T[]): [T[], T[]];
10
10
 
11
11
  type AnyFunction = (...args: any[]) => any;
12
12
  declare function once<T extends () => any>(fn: T): () => ReturnType<T>;
13
+ declare function sequential<A extends any[], R>(fn: (...args: A) => Promise<R>): (...args: A) => Promise<R>;
14
+ /**
15
+ * Executes the callback function after the current call stack has been cleared.
16
+ */
17
+ declare function defer(callback: () => void): void;
13
18
 
14
19
  type OmitChainMethodDeep<T extends object, K extends keyof any> = {
15
20
  [P in keyof Omit<T, K>]: T[P] extends AnyFunction ? ((...args: Parameters<T[P]>) => OmitChainMethodDeep<ReturnType<T[P]>, K>) : T[P];
16
21
  };
17
22
 
23
+ declare class SequentialIdGenerator {
24
+ private nextId;
25
+ generate(): number;
26
+ }
27
+
18
28
  type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
19
29
  type IntersectPick<T, U> = Pick<T, keyof T & keyof U>;
20
30
  type PromiseWithError<T, TError> = Promise<T> & {
@@ -34,10 +44,10 @@ type ThrowableError = Registry extends {
34
44
  } ? T : Error;
35
45
 
36
46
  type InterceptableOptions = Record<string, any>;
37
- type InterceptorOptions<TOptions extends InterceptableOptions, TResult, TError> = Omit<TOptions, 'next'> & {
38
- next(options?: TOptions): PromiseWithError<TResult, TError>;
47
+ type InterceptorOptions<TOptions extends InterceptableOptions, TResult> = Omit<TOptions, 'next'> & {
48
+ next(options?: TOptions): TResult;
39
49
  };
40
- type Interceptor<TOptions extends InterceptableOptions, TResult, TError> = (options: InterceptorOptions<TOptions, TResult, TError>) => Promisable<TResult>;
50
+ type Interceptor<TOptions extends InterceptableOptions, TResult> = (options: InterceptorOptions<TOptions, TResult>) => TResult;
41
51
  /**
42
52
  * Can used for interceptors or middlewares
43
53
  */
@@ -63,9 +73,14 @@ type OnFinishState<TResult, TError> = [error: TError, data: undefined, isSuccess
63
73
  declare function onFinish<T, TOptions extends {
64
74
  next(): any;
65
75
  }, TRest extends any[]>(callback: NoInfer<(state: OnFinishState<Awaited<ReturnType<TOptions['next']>>, ReturnType<TOptions['next']> extends PromiseWithError<any, infer E> ? E : ThrowableError>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => T | Promise<Awaited<ReturnType<TOptions['next']>>>;
66
- declare function intercept<TOptions extends InterceptableOptions, TResult, TError>(interceptors: Interceptor<TOptions, TResult, TError>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => Promisable<TResult>>): Promise<TResult>;
76
+ declare function intercept<TOptions extends InterceptableOptions, TResult>(interceptors: Interceptor<TOptions, TResult>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => TResult>): TResult;
67
77
 
68
78
  declare function isAsyncIteratorObject(maybe: unknown): maybe is AsyncIteratorObject<any, any, any>;
79
+ interface CreateAsyncIteratorObjectCleanupFn {
80
+ (reason: 'return' | 'throw' | 'next' | 'dispose'): Promise<void>;
81
+ }
82
+ declare function createAsyncIteratorObject<T, TReturn, TNext>(next: () => Promise<IteratorResult<T, TReturn>>, cleanup: CreateAsyncIteratorObjectCleanupFn): AsyncIteratorObject<T, TReturn, TNext> & AsyncGenerator<T, TReturn, TNext>;
83
+ declare function replicateAsyncIterator<T, TReturn, TNext>(source: AsyncIterator<T, TReturn, TNext>, count: number): (AsyncIteratorObject<T, TReturn, TNext> & AsyncGenerator<T, TReturn, TNext>)[];
69
84
 
70
85
  declare function parseEmptyableJSON(text: string | null | undefined): unknown;
71
86
  declare function stringifyJSON<T>(value: T): undefined extends T ? undefined | string : string;
@@ -85,9 +100,30 @@ declare function isObject(value: unknown): value is Record<PropertyKey, unknown>
85
100
  declare function isTypescriptObject(value: unknown): value is object & Record<PropertyKey, unknown>;
86
101
  declare function clone<T>(value: T): T;
87
102
  declare function get(object: object, path: readonly string[]): unknown;
103
+ declare function isPropertyKey(value: unknown): value is PropertyKey;
104
+ declare const NullProtoObj: ({
105
+ new <T extends Record<PropertyKey, unknown>>(): T;
106
+ });
107
+
108
+ interface AsyncIdQueueCloseOptions {
109
+ id?: number;
110
+ reason?: unknown;
111
+ }
112
+ declare class AsyncIdQueue<T> {
113
+ private readonly openIds;
114
+ private readonly items;
115
+ private readonly pendingPulls;
116
+ get length(): number;
117
+ open(id: number): void;
118
+ isOpen(id: number): boolean;
119
+ push(id: number, item: T): void;
120
+ pull(id: number): Promise<T>;
121
+ close({ id, reason }?: AsyncIdQueueCloseOptions): void;
122
+ assertOpen(id: number): void;
123
+ }
88
124
 
89
- type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => Promisable<T>);
90
- declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): Promise<T extends Value<infer U, any> ? U : never>;
125
+ type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => T);
126
+ declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): T extends Value<infer U, any> ? U : never;
91
127
 
92
- export { clone, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, splitInHalf, stringifyJSON, toArray, value };
93
- export type { AnyFunction, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, PromiseWithError, Registry, Segment, SetOptional, ThrowableError, Value };
128
+ export { AsyncIdQueue, NullProtoObj, SequentialIdGenerator, clone, createAsyncIteratorObject, defer, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, replicateAsyncIterator, resolveMaybeOptionalOptions, sequential, splitInHalf, stringifyJSON, toArray, value };
129
+ export type { AnyFunction, AsyncIdQueueCloseOptions, CreateAsyncIteratorObjectCleanupFn, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, PromiseWithError, Registry, Segment, SetOptional, ThrowableError, Value };
package/dist/index.mjs CHANGED
@@ -23,6 +23,33 @@ function once(fn) {
23
23
  return result;
24
24
  };
25
25
  }
26
+ function sequential(fn) {
27
+ let lastOperationPromise = Promise.resolve();
28
+ return (...args) => {
29
+ return lastOperationPromise = lastOperationPromise.catch(() => {
30
+ }).then(() => {
31
+ return fn(...args);
32
+ });
33
+ };
34
+ }
35
+ function defer(callback) {
36
+ if ("setTimeout" in globalThis && typeof globalThis.setTimeout === "function") {
37
+ globalThis.setTimeout(callback, 0);
38
+ } else {
39
+ Promise.resolve().then(() => Promise.resolve().then(() => Promise.resolve().then(callback)));
40
+ }
41
+ }
42
+
43
+ class SequentialIdGenerator {
44
+ nextId = 0;
45
+ generate() {
46
+ if (this.nextId === Number.MAX_SAFE_INTEGER) {
47
+ this.nextId = 0;
48
+ return Number.MAX_SAFE_INTEGER;
49
+ }
50
+ return this.nextId++;
51
+ }
52
+ }
26
53
 
27
54
  function onStart(callback) {
28
55
  return async (options, ...rest) => {
@@ -62,13 +89,13 @@ function onFinish(callback) {
62
89
  }
63
90
  };
64
91
  }
65
- async function intercept(interceptors, options, main) {
66
- const next = async (options2, index) => {
92
+ function intercept(interceptors, options, main) {
93
+ const next = (options2, index) => {
67
94
  const interceptor = interceptors[index];
68
95
  if (!interceptor) {
69
- return await main(options2);
96
+ return main(options2);
70
97
  }
71
- return await interceptor({
98
+ return interceptor({
72
99
  ...options2,
73
100
  next: (newOptions = options2) => next(newOptions, index + 1)
74
101
  });
@@ -76,12 +103,191 @@ async function intercept(interceptors, options, main) {
76
103
  return next(options, 0);
77
104
  }
78
105
 
106
+ class AsyncIdQueue {
107
+ openIds = /* @__PURE__ */ new Set();
108
+ items = /* @__PURE__ */ new Map();
109
+ pendingPulls = /* @__PURE__ */ new Map();
110
+ get length() {
111
+ return this.openIds.size;
112
+ }
113
+ open(id) {
114
+ this.openIds.add(id);
115
+ }
116
+ isOpen(id) {
117
+ return this.openIds.has(id);
118
+ }
119
+ push(id, item) {
120
+ this.assertOpen(id);
121
+ const pending = this.pendingPulls.get(id);
122
+ if (pending?.length) {
123
+ pending.shift()[0](item);
124
+ if (pending.length === 0) {
125
+ this.pendingPulls.delete(id);
126
+ }
127
+ } else {
128
+ const items = this.items.get(id);
129
+ if (items) {
130
+ items.push(item);
131
+ } else {
132
+ this.items.set(id, [item]);
133
+ }
134
+ }
135
+ }
136
+ async pull(id) {
137
+ this.assertOpen(id);
138
+ const items = this.items.get(id);
139
+ if (items?.length) {
140
+ const item = items.shift();
141
+ if (items.length === 0) {
142
+ this.items.delete(id);
143
+ }
144
+ return item;
145
+ }
146
+ return new Promise((resolve, reject) => {
147
+ const waitingPulls = this.pendingPulls.get(id);
148
+ const pending = [resolve, reject];
149
+ if (waitingPulls) {
150
+ waitingPulls.push(pending);
151
+ } else {
152
+ this.pendingPulls.set(id, [pending]);
153
+ }
154
+ });
155
+ }
156
+ close({ id, reason } = {}) {
157
+ if (id === void 0) {
158
+ this.pendingPulls.forEach((pendingPulls, id2) => {
159
+ pendingPulls.forEach(([, reject]) => {
160
+ reject(reason ?? new Error(`[AsyncIdQueue] Queue[${id2}] was closed or aborted while waiting for pulling.`));
161
+ });
162
+ });
163
+ this.pendingPulls.clear();
164
+ this.openIds.clear();
165
+ this.items.clear();
166
+ return;
167
+ }
168
+ this.pendingPulls.get(id)?.forEach(([, reject]) => {
169
+ reject(reason ?? new Error(`[AsyncIdQueue] Queue[${id}] was closed or aborted while waiting for pulling.`));
170
+ });
171
+ this.pendingPulls.delete(id);
172
+ this.openIds.delete(id);
173
+ this.items.delete(id);
174
+ }
175
+ assertOpen(id) {
176
+ if (!this.isOpen(id)) {
177
+ throw new Error(`[AsyncIdQueue] Cannot access queue[${id}] because it is not open or aborted.`);
178
+ }
179
+ }
180
+ }
181
+
79
182
  function isAsyncIteratorObject(maybe) {
80
183
  if (!maybe || typeof maybe !== "object") {
81
184
  return false;
82
185
  }
83
186
  return Symbol.asyncIterator in maybe && typeof maybe[Symbol.asyncIterator] === "function";
84
187
  }
188
+ function createAsyncIteratorObject(next, cleanup) {
189
+ let isExecuteComplete = false;
190
+ let isDone = false;
191
+ const iterator = {
192
+ next: sequential(async () => {
193
+ if (isDone) {
194
+ return { done: true, value: void 0 };
195
+ }
196
+ try {
197
+ const result = await next();
198
+ if (result.done) {
199
+ isDone = true;
200
+ }
201
+ return result;
202
+ } catch (err) {
203
+ isDone = true;
204
+ throw err;
205
+ } finally {
206
+ if (isDone && !isExecuteComplete) {
207
+ isExecuteComplete = true;
208
+ await cleanup("next");
209
+ }
210
+ }
211
+ }),
212
+ async return(value) {
213
+ isDone = true;
214
+ if (!isExecuteComplete) {
215
+ isExecuteComplete = true;
216
+ await cleanup("return");
217
+ }
218
+ return { done: true, value };
219
+ },
220
+ async throw(err) {
221
+ isDone = true;
222
+ if (!isExecuteComplete) {
223
+ isExecuteComplete = true;
224
+ await cleanup("throw");
225
+ }
226
+ throw err;
227
+ },
228
+ /**
229
+ * asyncDispose symbol only available in esnext, we should fallback to Symbol.for('asyncDispose')
230
+ */
231
+ async [Symbol.asyncDispose ?? Symbol.for("asyncDispose")]() {
232
+ isDone = true;
233
+ if (!isExecuteComplete) {
234
+ isExecuteComplete = true;
235
+ await cleanup("dispose");
236
+ }
237
+ },
238
+ [Symbol.asyncIterator]() {
239
+ return iterator;
240
+ }
241
+ };
242
+ return iterator;
243
+ }
244
+ function replicateAsyncIterator(source, count) {
245
+ const queue = new AsyncIdQueue();
246
+ const replicated = [];
247
+ let error;
248
+ const start = once(async () => {
249
+ try {
250
+ while (true) {
251
+ const item = await source.next();
252
+ for (let id = 0; id < count; id++) {
253
+ if (queue.isOpen(id)) {
254
+ queue.push(id, item);
255
+ }
256
+ }
257
+ if (item.done) {
258
+ break;
259
+ }
260
+ }
261
+ } catch (e) {
262
+ error = { value: e };
263
+ }
264
+ });
265
+ for (let id = 0; id < count; id++) {
266
+ queue.open(id);
267
+ replicated.push(createAsyncIteratorObject(
268
+ () => {
269
+ start();
270
+ return new Promise((resolve, reject) => {
271
+ queue.pull(id).then(resolve).catch(reject);
272
+ defer(() => {
273
+ if (error) {
274
+ reject(error.value);
275
+ }
276
+ });
277
+ });
278
+ },
279
+ async (reason) => {
280
+ queue.close({ id });
281
+ if (reason !== "next") {
282
+ if (replicated.every((_, id2) => !queue.isOpen(id2))) {
283
+ await source?.return?.();
284
+ }
285
+ }
286
+ }
287
+ ));
288
+ }
289
+ return replicated;
290
+ }
85
291
 
86
292
  function parseEmptyableJSON(text) {
87
293
  if (!text) {
@@ -141,6 +347,17 @@ function get(object, path) {
141
347
  }
142
348
  return current;
143
349
  }
350
+ function isPropertyKey(value) {
351
+ const type = typeof value;
352
+ return type === "string" || type === "number" || type === "symbol";
353
+ }
354
+ const NullProtoObj = /* @__PURE__ */ (() => {
355
+ const e = function() {
356
+ };
357
+ e.prototype = /* @__PURE__ */ Object.create(null);
358
+ Object.freeze(e.prototype);
359
+ return e;
360
+ })();
144
361
 
145
362
  function value(value2, ...args) {
146
363
  if (typeof value2 === "function") {
@@ -149,4 +366,4 @@ function value(value2, ...args) {
149
366
  return value2;
150
367
  }
151
368
 
152
- export { clone, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, splitInHalf, stringifyJSON, toArray, value };
369
+ export { AsyncIdQueue, NullProtoObj, SequentialIdGenerator, clone, createAsyncIteratorObject, defer, findDeepMatches, get, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, replicateAsyncIterator, resolveMaybeOptionalOptions, sequential, splitInHalf, stringifyJSON, toArray, value };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/shared",
3
3
  "type": "module",
4
- "version": "0.0.0-next.d9aa1c2",
4
+ "version": "0.0.0-next.d9e58e7",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -27,6 +27,11 @@
27
27
  "radash": "^12.1.0",
28
28
  "type-fest": "^4.39.1"
29
29
  },
30
+ "devDependencies": {
31
+ "arktype": "2.1.20",
32
+ "valibot": "^1.1.0",
33
+ "zod": "^3.25.49"
34
+ },
30
35
  "scripts": {
31
36
  "build": "unbuild",
32
37
  "build:watch": "pnpm run build --watch",