@orpc/shared 1.15.1 β 1.15.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/README.md +1 -80
- package/dist/index.d.mts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.mjs +50 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,86 +72,7 @@ Provides shared utilities for oRPC packages.
|
|
|
72
72
|
|
|
73
73
|
If you find oRPC valuable and would like to support its development, you can do so here: [GitHub Sponsors](https://github.com/sponsors/dinwwwh).
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<table>
|
|
78
|
-
<tr>
|
|
79
|
-
<td align="center"><a href="https://screenshotone.com/?ref=orpc" target="_blank" rel="sponsored noopener" title="ScreenshotOne.com"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="279" alt="ScreenshotOne.com"/><br />ScreenshotOne.com</a></td>
|
|
80
|
-
</tr>
|
|
81
|
-
</table>
|
|
82
|
-
|
|
83
|
-
### π₯ Silver Sponsor
|
|
84
|
-
|
|
85
|
-
<table>
|
|
86
|
-
<tr>
|
|
87
|
-
<td align="center"><a href="https://misskey.io/?ref=orpc" target="_blank" rel="sponsored noopener" title="ζδΈγγ"><img src="https://avatars.githubusercontent.com/u/37681609?u=0dd4c7e4ba937cbb52b068c55914b1d8164dc0c7&v=4" width="209" alt="ζδΈγγ"/><br />ζδΈγγ</a></td>
|
|
88
|
-
</tr>
|
|
89
|
-
</table>
|
|
90
|
-
|
|
91
|
-
### Generous Sponsors
|
|
92
|
-
|
|
93
|
-
<table>
|
|
94
|
-
<tr>
|
|
95
|
-
<td align="center"><a href="https://github.com/ln-markets?ref=orpc" target="_blank" rel="sponsored noopener" title="LN Markets"><img src="https://avatars.githubusercontent.com/u/70597625?v=4" width="167" alt="LN Markets"/><br />LN Markets</a></td>
|
|
96
|
-
</tr>
|
|
97
|
-
</table>
|
|
98
|
-
|
|
99
|
-
### Sponsors
|
|
100
|
-
|
|
101
|
-
<table>
|
|
102
|
-
<tr>
|
|
103
|
-
<td align="center"><a href="https://github.com/hrmcdonald?ref=orpc" target="_blank" rel="sponsored noopener" title="Reece McDonald"><img src="https://avatars.githubusercontent.com/u/39349270?v=4" width="139" alt="Reece McDonald"/><br />Reece McDonald</a></td>
|
|
104
|
-
<td align="center"><a href="https://github.com/u1-liquid?ref=orpc" target="_blank" rel="sponsored noopener" title="γγγγγ¨γΌγ«γ
"><img src="https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&v=4" width="139" alt="γγγγγ¨γΌγ«γ
"/><br />γγγγγ¨γΌγ«γ
</a></td>
|
|
105
|
-
<td align="center"><a href="https://github.com/nicognaW?ref=orpc" target="_blank" rel="sponsored noopener" title="nk"><img src="https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&v=4" width="139" alt="nk"/><br />nk</a></td>
|
|
106
|
-
<td align="center"><a href="https://github.com/supastarter?ref=orpc" target="_blank" rel="sponsored noopener" title="supastarter"><img src="https://avatars.githubusercontent.com/u/110960143?v=4" width="139" alt="supastarter"/><br />supastarter</a></td>
|
|
107
|
-
<td align="center"><a href="https://github.com/divmgl?ref=orpc" target="_blank" rel="sponsored noopener" title="Dexter Miguel"><img src="https://avatars.githubusercontent.com/u/5452298?u=645993204be8696c085ecf0d228c3062efe2ed65&v=4" width="139" alt="Dexter Miguel"/><br />Dexter Miguel</a></td>
|
|
108
|
-
<td align="center"><a href="https://github.com/herrfugbaum?ref=orpc" target="_blank" rel="sponsored noopener" title="herrfugbaum"><img src="https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&v=4" width="139" alt="herrfugbaum"/><br />herrfugbaum</a></td>
|
|
109
|
-
</tr>
|
|
110
|
-
<tr>
|
|
111
|
-
<td align="center"><a href="https://github.com/ryota-murakami?ref=orpc" target="_blank" rel="sponsored noopener" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
|
|
112
|
-
<td align="center"><a href="https://github.com/dcramer?ref=orpc" target="_blank" rel="sponsored noopener" title="David Cramer"><img src="https://avatars.githubusercontent.com/u/23610?v=4" width="139" alt="David Cramer"/><br />David Cramer</a></td>
|
|
113
|
-
<td align="center"><a href="https://github.com/valerii15298?ref=orpc" target="_blank" rel="sponsored noopener" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
|
|
114
|
-
<td align="center"><a href="https://github.com/letstri?ref=orpc" target="_blank" rel="sponsored noopener" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
|
|
115
|
-
<td align="center"><a href="https://github.com/K-Mistele?ref=orpc" target="_blank" rel="sponsored noopener" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
|
|
116
|
-
<td align="center"><a href="https://github.com/christ12938?ref=orpc" target="_blank" rel="sponsored noopener" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
|
|
117
|
-
</tr>
|
|
118
|
-
<tr>
|
|
119
|
-
<td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="sponsored noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
120
|
-
<td align="center"><a href="https://github.com/itigoore01?ref=orpc" target="_blank" rel="sponsored noopener" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&v=4" width="139" alt="shota"/><br />shota</a></td>
|
|
121
|
-
<td align="center"><a href="https://github.com/ellis-driscoll?ref=orpc" target="_blank" rel="sponsored noopener" title="Ellis Driscoll"><img src="https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&v=4" width="139" alt="Ellis Driscoll"/><br />Ellis Driscoll</a></td>
|
|
122
|
-
<td align="center"><a href="https://github.com/hoangbn?ref=orpc" target="_blank" rel="sponsored noopener" title="Hoang Nguyen"><img src="https://avatars.githubusercontent.com/u/38968280?u=c90084c6de65c56facabab7ba13a72a49ddbc3e4&v=4" width="139" alt="Hoang Nguyen"/><br />Hoang Nguyen</a></td>
|
|
123
|
-
</tr>
|
|
124
|
-
</table>
|
|
125
|
-
|
|
126
|
-
### Backers
|
|
127
|
-
|
|
128
|
-
<table>
|
|
129
|
-
<tr>
|
|
130
|
-
<td align="center"><a href="https://github.com/rhinodavid?ref=orpc" target="_blank" rel="sponsored noopener" title="David Walsh"><img src="https://avatars.githubusercontent.com/u/5778036?u=b5521f07d2f88c3db2a0dae62b5f2f8357214af0&v=4" width="119" alt="David Walsh"/><br />David Walsh</a></td>
|
|
131
|
-
<td align="center"><a href="https://github.com/Robbe95?ref=orpc" target="_blank" rel="sponsored noopener" title="Robbe Vaes"><img src="https://avatars.githubusercontent.com/u/44748019?u=e0232402c045ad4eac7cbd217f1f47e083103b89&v=4" width="119" alt="Robbe Vaes"/><br />Robbe Vaes</a></td>
|
|
132
|
-
<td align="center"><a href="https://github.com/aidansunbury?ref=orpc" target="_blank" rel="sponsored noopener" title="Aidan Sunbury"><img src="https://avatars.githubusercontent.com/u/64103161?v=4" width="119" alt="Aidan Sunbury"/><br />Aidan Sunbury</a></td>
|
|
133
|
-
<td align="center"><a href="https://github.com/soonoo?ref=orpc" target="_blank" rel="sponsored noopener" title="soonoo"><img src="https://avatars.githubusercontent.com/u/5436405?u=5d0b4aa955c87e30e6bda7f0cccae5402da99528&v=4" width="119" alt="soonoo"/><br />soonoo</a></td>
|
|
134
|
-
<td align="center"><a href="https://github.com/kporten?ref=orpc" target="_blank" rel="sponsored noopener" title="Kevin Porten"><img src="https://avatars.githubusercontent.com/u/1839345?u=dc2263d5cfe0d927ce1a0be04a1d55dd6b55405c&v=4" width="119" alt="Kevin Porten"/><br />Kevin Porten</a></td>
|
|
135
|
-
<td align="center"><a href="https://github.com/pumpkinlink?ref=orpc" target="_blank" rel="sponsored noopener" title="Denis"><img src="https://avatars.githubusercontent.com/u/11864620?u=5f47bbe6c65d0f6f5cf011021490238e4b0593d0&v=4" width="119" alt="Denis"/><br />Denis</a></td>
|
|
136
|
-
<td align="center"><a href="https://github.com/christopher-kapic?ref=orpc" target="_blank" rel="sponsored noopener" title="Christopher Kapic"><img src="https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&v=4" width="119" alt="Christopher Kapic"/><br />Christopher Kapic</a></td>
|
|
137
|
-
</tr>
|
|
138
|
-
<tr>
|
|
139
|
-
<td align="center"><a href="https://github.com/thomasballinger?ref=orpc" target="_blank" rel="sponsored noopener" title="Tom Ballinger"><img src="https://avatars.githubusercontent.com/u/458879?u=4b045ac75d721b6ac2b42a74d7d37f61f0414031&v=4" width="119" alt="Tom Ballinger"/><br />Tom Ballinger</a></td>
|
|
140
|
-
<td align="center"><a href="https://github.com/SSam0419?ref=orpc" target="_blank" rel="sponsored noopener" title="Sam"><img src="https://avatars.githubusercontent.com/u/102863520?u=3c89611f549d5070be232eb4532f690c8f2e7a65&v=4" width="119" alt="Sam"/><br />Sam</a></td>
|
|
141
|
-
<td align="center"><a href="https://github.com/Titoine?ref=orpc" target="_blank" rel="sponsored noopener" title="Titoine"><img src="https://avatars.githubusercontent.com/u/3514286?u=1bb1e86b0c99c8a1121372e56d51a177eea12191&v=4" width="119" alt="Titoine"/><br />Titoine</a></td>
|
|
142
|
-
<td align="center"><a href="https://github.com/Mnigos?ref=orpc" target="_blank" rel="sponsored noopener" title="Igor Makowski"><img src="https://avatars.githubusercontent.com/u/56691628?u=ee8c879478f7c151b9156aef6c74243fa3e247a8&v=4" width="119" alt="Igor Makowski"/><br />Igor Makowski</a></td>
|
|
143
|
-
<td align="center"><a href="https://github.com/hanayashiki?ref=orpc" target="_blank" rel="sponsored noopener" title="hanayashiki"><img src="https://avatars.githubusercontent.com/u/26056783?u=06c3b9205a16fd41a871e82da1cc2a09306d53f5&v=4" width="119" alt="hanayashiki"/><br />hanayashiki</a></td>
|
|
144
|
-
<td align="center"><a href="https://github.com/ldub?ref=orpc" target="_blank" rel="sponsored noopener" title="Lev Dubinets"><img src="https://avatars.githubusercontent.com/u/3114081?u=f547f5d5012cab54851f1b1ad72d10e537f78fc2&v=4" width="119" alt="Lev Dubinets"/><br />Lev Dubinets</a></td>
|
|
145
|
-
<td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="sponsored noopener" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
|
|
146
|
-
</tr>
|
|
147
|
-
<tr>
|
|
148
|
-
<td align="center"><a href="https://github.com/guyariely?ref=orpc" target="_blank" rel="sponsored noopener" title="Guy Ariely"><img src="https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&v=4" width="119" alt="Guy Ariely"/><br />Guy Ariely</a></td>
|
|
149
|
-
<td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="sponsored noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&v=4" width="119" alt="Alex"/><br />Alex</a></td>
|
|
150
|
-
<td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="sponsored noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
|
|
151
|
-
</tr>
|
|
152
|
-
</table>
|
|
153
|
-
|
|
154
|
-
With thanks to 37 past sponsors who helped get oRPC here.
|
|
75
|
+
[](https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg)
|
|
155
76
|
|
|
156
77
|
## License
|
|
157
78
|
|
package/dist/index.d.mts
CHANGED
|
@@ -30,7 +30,7 @@ type OmitChainMethodDeep<T extends object, K extends keyof any> = {
|
|
|
30
30
|
|
|
31
31
|
declare const ORPC_NAME = "orpc";
|
|
32
32
|
declare const ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
|
|
33
|
-
declare const ORPC_SHARED_PACKAGE_VERSION = "1.15.
|
|
33
|
+
declare const ORPC_SHARED_PACKAGE_VERSION = "1.15.2";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Error thrown when an operation is aborted.
|
|
@@ -336,6 +336,31 @@ declare class AsyncIdQueue<T> {
|
|
|
336
336
|
assertOpen(id: string): void;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Checks whether `flags` is a valid RegExp flags string without compiling a RegExp.
|
|
341
|
+
*/
|
|
342
|
+
declare function isValidRegExpFlags(flags: string): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Creates a RegExp that is only compiled on first use.
|
|
345
|
+
*
|
|
346
|
+
* Compiling a RegExp can be expensive (unicode property escapes cost milliseconds each),
|
|
347
|
+
* and the source comes from the wire. Deferring the compile means a request that is
|
|
348
|
+
* rejected before the value is touched, for example by an auth middleware, never pays for it.
|
|
349
|
+
*
|
|
350
|
+
* The returned value passes `instanceof RegExp` and forwards every property access and
|
|
351
|
+
* method call to the compiled RegExp. A syntax error in `pattern` is thrown on first use,
|
|
352
|
+
* not here.
|
|
353
|
+
*
|
|
354
|
+
* Reads that a fresh RegExp could answer without its pattern never compile: `lastIndex`
|
|
355
|
+
* (0 until written), and properties that do not exist on a RegExp such as `then`, `toJSON`
|
|
356
|
+
* or inspection symbols. So awaiting, `JSON.stringify` and logging the value are free.
|
|
357
|
+
*
|
|
358
|
+
* Known differences from a native RegExp: it has no own properties
|
|
359
|
+
* (`Object.hasOwn(value, 'lastIndex')` is false), `Object.freeze` is not supported,
|
|
360
|
+
* `structuredClone` rejects it, and Node's `util.types.isRegExp` returns false.
|
|
361
|
+
*/
|
|
362
|
+
declare function createLazyRegExp(pattern: string, flags: string): RegExp;
|
|
363
|
+
|
|
339
364
|
/**
|
|
340
365
|
* Converts a `ReadableStream` into an `AsyncIteratorClass`.
|
|
341
366
|
*/
|
|
@@ -352,5 +377,5 @@ declare function asyncIteratorToUnproxiedDataStream<T>(iterator: AsyncIterator<T
|
|
|
352
377
|
|
|
353
378
|
declare function tryDecodeURIComponent(value: string): string;
|
|
354
379
|
|
|
355
|
-
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|
|
380
|
+
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, createLazyRegExp, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, isValidRegExpFlags, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|
|
356
381
|
export type { AnyFunction, AsyncIdQueueCloseOptions, AsyncIteratorClassCleanupFn, AsyncIteratorClassNextFn, AsyncIteratorWithSpanOptions, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, InferAsyncIterableYield, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, OtelConfig, PromiseWithError, Registry, RunWithSpanOptions, Segment, SetOptional, SetSpanErrorOptions, ThrowableError, Value };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ type OmitChainMethodDeep<T extends object, K extends keyof any> = {
|
|
|
30
30
|
|
|
31
31
|
declare const ORPC_NAME = "orpc";
|
|
32
32
|
declare const ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
|
|
33
|
-
declare const ORPC_SHARED_PACKAGE_VERSION = "1.15.
|
|
33
|
+
declare const ORPC_SHARED_PACKAGE_VERSION = "1.15.2";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Error thrown when an operation is aborted.
|
|
@@ -336,6 +336,31 @@ declare class AsyncIdQueue<T> {
|
|
|
336
336
|
assertOpen(id: string): void;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Checks whether `flags` is a valid RegExp flags string without compiling a RegExp.
|
|
341
|
+
*/
|
|
342
|
+
declare function isValidRegExpFlags(flags: string): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Creates a RegExp that is only compiled on first use.
|
|
345
|
+
*
|
|
346
|
+
* Compiling a RegExp can be expensive (unicode property escapes cost milliseconds each),
|
|
347
|
+
* and the source comes from the wire. Deferring the compile means a request that is
|
|
348
|
+
* rejected before the value is touched, for example by an auth middleware, never pays for it.
|
|
349
|
+
*
|
|
350
|
+
* The returned value passes `instanceof RegExp` and forwards every property access and
|
|
351
|
+
* method call to the compiled RegExp. A syntax error in `pattern` is thrown on first use,
|
|
352
|
+
* not here.
|
|
353
|
+
*
|
|
354
|
+
* Reads that a fresh RegExp could answer without its pattern never compile: `lastIndex`
|
|
355
|
+
* (0 until written), and properties that do not exist on a RegExp such as `then`, `toJSON`
|
|
356
|
+
* or inspection symbols. So awaiting, `JSON.stringify` and logging the value are free.
|
|
357
|
+
*
|
|
358
|
+
* Known differences from a native RegExp: it has no own properties
|
|
359
|
+
* (`Object.hasOwn(value, 'lastIndex')` is false), `Object.freeze` is not supported,
|
|
360
|
+
* `structuredClone` rejects it, and Node's `util.types.isRegExp` returns false.
|
|
361
|
+
*/
|
|
362
|
+
declare function createLazyRegExp(pattern: string, flags: string): RegExp;
|
|
363
|
+
|
|
339
364
|
/**
|
|
340
365
|
* Converts a `ReadableStream` into an `AsyncIteratorClass`.
|
|
341
366
|
*/
|
|
@@ -352,5 +377,5 @@ declare function asyncIteratorToUnproxiedDataStream<T>(iterator: AsyncIterator<T
|
|
|
352
377
|
|
|
353
378
|
declare function tryDecodeURIComponent(value: string): string;
|
|
354
379
|
|
|
355
|
-
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|
|
380
|
+
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, createLazyRegExp, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, isValidRegExpFlags, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|
|
356
381
|
export type { AnyFunction, AsyncIdQueueCloseOptions, AsyncIteratorClassCleanupFn, AsyncIteratorClassNextFn, AsyncIteratorWithSpanOptions, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, InferAsyncIterableYield, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OmitChainMethodDeep, OnFinishState, OtelConfig, PromiseWithError, Registry, RunWithSpanOptions, Segment, SetOptional, SetSpanErrorOptions, ThrowableError, Value };
|
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function readAsBuffer(source) {
|
|
|
21
21
|
|
|
22
22
|
const ORPC_NAME = "orpc";
|
|
23
23
|
const ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
|
|
24
|
-
const ORPC_SHARED_PACKAGE_VERSION = "1.15.
|
|
24
|
+
const ORPC_SHARED_PACKAGE_VERSION = "1.15.2";
|
|
25
25
|
|
|
26
26
|
class AbortError extends Error {
|
|
27
27
|
constructor(...rest) {
|
|
@@ -663,6 +663,54 @@ function overlayProxy(target, partial) {
|
|
|
663
663
|
return proxy;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
+
const REGEXP_FLAGS = /^[dgimsuvy]*$/;
|
|
667
|
+
function isValidRegExpFlags(flags) {
|
|
668
|
+
return REGEXP_FLAGS.test(flags) && new Set(flags).size === flags.length && !(flags.includes("u") && flags.includes("v"));
|
|
669
|
+
}
|
|
670
|
+
function createLazyRegExp(pattern, flags) {
|
|
671
|
+
let compiled;
|
|
672
|
+
let lastIndex = 0;
|
|
673
|
+
const compile = () => {
|
|
674
|
+
if (compiled === void 0) {
|
|
675
|
+
compiled = new RegExp(pattern, flags);
|
|
676
|
+
compiled.lastIndex = lastIndex;
|
|
677
|
+
}
|
|
678
|
+
return compiled;
|
|
679
|
+
};
|
|
680
|
+
return new Proxy(Object.create(RegExp.prototype), {
|
|
681
|
+
get(_, prop) {
|
|
682
|
+
if (prop === Symbol.toStringTag) {
|
|
683
|
+
return "RegExp";
|
|
684
|
+
}
|
|
685
|
+
if (compiled === void 0) {
|
|
686
|
+
if (prop === "lastIndex") {
|
|
687
|
+
return lastIndex;
|
|
688
|
+
}
|
|
689
|
+
if (!(prop in RegExp.prototype)) {
|
|
690
|
+
return void 0;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
const target = compile();
|
|
694
|
+
const value = Reflect.get(target, prop, target);
|
|
695
|
+
return typeof value === "function" && prop !== "constructor" ? value.bind(target) : value;
|
|
696
|
+
},
|
|
697
|
+
set(_, prop, value) {
|
|
698
|
+
if (compiled === void 0 && prop === "lastIndex") {
|
|
699
|
+
lastIndex = value;
|
|
700
|
+
return true;
|
|
701
|
+
}
|
|
702
|
+
const target = compile();
|
|
703
|
+
return Reflect.set(target, prop, value, target);
|
|
704
|
+
},
|
|
705
|
+
has(_, prop) {
|
|
706
|
+
if (compiled === void 0) {
|
|
707
|
+
return prop === "lastIndex" || prop in RegExp.prototype;
|
|
708
|
+
}
|
|
709
|
+
return Reflect.has(compiled, prop);
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
666
714
|
function streamToAsyncIteratorClass(stream) {
|
|
667
715
|
const reader = stream.getReader();
|
|
668
716
|
return new AsyncIteratorClass(
|
|
@@ -714,4 +762,4 @@ function tryDecodeURIComponent(value) {
|
|
|
714
762
|
}
|
|
715
763
|
}
|
|
716
764
|
|
|
717
|
-
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|
|
765
|
+
export { AbortError, AsyncIdQueue, AsyncIteratorClass, EventPublisher, NullProtoObj, ORPC_NAME, ORPC_SHARED_PACKAGE_NAME, ORPC_SHARED_PACKAGE_VERSION, SequentialIdGenerator, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorWithSpan, clone, compareSequentialIds, createLazyRegExp, defer, fallback, findDeepMatches, get, getConstructor, getGlobalOtelConfig, intercept, isAsyncIteratorObject, isObject, isPropertyKey, isTypescriptObject, isValidRegExpFlags, logError, onError, onFinish, onStart, onSuccess, once, overlayProxy, parseEmptyableJSON, preventNativeAwait, readAsBuffer, replicateAsyncIterator, resolveMaybeOptionalOptions, runInSpanContext, runWithSpan, sequential, setGlobalOtelConfig, setSpanAttribute, setSpanError, splitInHalf, startSpan, streamToAsyncIteratorClass, stringifyJSON, toArray, toOtelException, toSpanAttributeValue, tryDecodeURIComponent, value };
|