@orpc/shared 0.0.0-next.e9dc36e → 0.0.0-next.ea0903c
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 +85 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.mjs +146 -0
- package/package.json +11 -26
- package/dist/error.js +0 -73
- package/dist/error.js.map +0 -1
- package/dist/index.js +0 -81
- package/dist/index.js.map +0 -1
- package/dist/src/error.d.ts +0 -58
- package/dist/src/error.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -7
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/json.d.ts +0 -2
- package/dist/src/json.d.ts.map +0 -1
- package/dist/src/object.d.ts +0 -8
- package/dist/src/object.d.ts.map +0 -1
- package/dist/src/value.d.ts +0 -4
- package/dist/src/value.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/error.test.ts +0 -22
- package/src/error.ts +0 -106
- package/src/index.ts +0 -8
- package/src/json.ts +0 -11
- package/src/object.ts +0 -79
- package/src/value.test-d.ts +0 -22
- package/src/value.test.ts +0 -17
- package/src/value.ts +0 -12
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
>
|
|
3
|
+
> `@orpc/shared` is an internal dependency of oRPC packages. It does not follow semver and may change at any time without notice.
|
|
4
|
+
> Please do not use it in your project.
|
|
5
|
+
|
|
6
|
+
<div align="center">
|
|
7
|
+
<image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<h1></h1>
|
|
11
|
+
|
|
12
|
+
<div align="center">
|
|
13
|
+
<a href="https://codecov.io/gh/unnoq/orpc">
|
|
14
|
+
<img alt="codecov" src="https://codecov.io/gh/unnoq/orpc/branch/main/graph/badge.svg">
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@orpc/shared">
|
|
17
|
+
<img alt="weekly downloads" src="https://img.shields.io/npm/dw/%40orpc%2Fshared?logo=npm" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/unnoq/orpc/blob/main/LICENSE">
|
|
20
|
+
<img alt="MIT License" src="https://img.shields.io/github/license/unnoq/orpc?logo=open-source-initiative" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://discord.gg/TXEbwRBvQn">
|
|
23
|
+
<img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<h3 align="center">Typesafe APIs Made Simple 🪄</h3>
|
|
28
|
+
|
|
29
|
+
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards, ensuring a smooth and enjoyable developer experience.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Highlights
|
|
34
|
+
|
|
35
|
+
- **End-to-End Type Safety 🔒**: Ensure complete type safety from inputs to outputs and errors, bridging server and client seamlessly.
|
|
36
|
+
- **First-Class OpenAPI 📄**: Adheres to the OpenAPI standard out of the box, ensuring seamless integration and comprehensive API documentation.
|
|
37
|
+
- **Contract-First Development 📜**: (Optional) Define your API contract upfront and implement it with confidence.
|
|
38
|
+
- **Exceptional Developer Experience ✨**: Enjoy a streamlined workflow with robust typing and clear, in-code documentation.
|
|
39
|
+
- **Multi-Runtime Support 🌍**: Run your code seamlessly on Cloudflare, Deno, Bun, Node.js, and more.
|
|
40
|
+
- **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
|
41
|
+
- **Server Actions ⚡️**: Fully compatible with React Server Actions on Next.js, TanStack Start, and more.
|
|
42
|
+
- **Standard Schema Support 🗂️**: Effortlessly work with Zod, Valibot, ArkType, and others right out of the box.
|
|
43
|
+
- **Fast & Lightweight 💨**: Built on native APIs across all runtimes – optimized for speed and efficiency.
|
|
44
|
+
- **Native Types 📦**: Enjoy built-in support for Date, File, Blob, BigInt, URL and more with no extra setup.
|
|
45
|
+
- **Lazy Router ⏱️**: Improve cold start times with our lazy routing feature.
|
|
46
|
+
- **SSE & Streaming 📡**: Provides SSE and streaming features – perfect for real-time notifications and AI-powered streaming responses.
|
|
47
|
+
- **Reusability 🔄**: Write once and reuse your code across multiple purposes effortlessly.
|
|
48
|
+
- **Extendability 🔌**: Easily enhance oRPC with plugins, middleware, and interceptors.
|
|
49
|
+
- **Reliability 🛡️**: Well-tested, fully TypeScript, production-ready, and MIT licensed for peace of mind.
|
|
50
|
+
- **Simplicity 💡**: Enjoy straightforward, clean code with no hidden magic.
|
|
51
|
+
|
|
52
|
+
## Documentation
|
|
53
|
+
|
|
54
|
+
You can find the full documentation [here](https://orpc.unnoq.com).
|
|
55
|
+
|
|
56
|
+
## Packages
|
|
57
|
+
|
|
58
|
+
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
|
59
|
+
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
|
60
|
+
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
|
61
|
+
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
|
62
|
+
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
|
63
|
+
- [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
|
|
64
|
+
- [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
|
|
65
|
+
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
66
|
+
- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
|
|
67
|
+
- [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
|
|
68
|
+
- [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
|
|
69
|
+
- [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/).
|
|
70
|
+
|
|
71
|
+
## `@orpc/shared`
|
|
72
|
+
|
|
73
|
+
Provides shared utilities for oRPC packages.
|
|
74
|
+
|
|
75
|
+
## Sponsors
|
|
76
|
+
|
|
77
|
+
<p align="center">
|
|
78
|
+
<a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg">
|
|
79
|
+
<img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/>
|
|
80
|
+
</a>
|
|
81
|
+
</p>
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Promisable } from 'type-fest';
|
|
2
|
+
export { IsEqual, IsNever, PartialDeep, Promisable } from 'type-fest';
|
|
3
|
+
export { group, guard, mapEntries, mapValues, omit } from 'radash';
|
|
4
|
+
|
|
5
|
+
type MaybeOptionalOptions<TOptions> = Record<never, never> extends TOptions ? [options?: TOptions] : [options: TOptions];
|
|
6
|
+
declare function resolveMaybeOptionalOptions<T>(rest: MaybeOptionalOptions<T>): T;
|
|
7
|
+
|
|
8
|
+
declare function toArray<T>(value: T | T[] | null | undefined): T[];
|
|
9
|
+
|
|
10
|
+
type AnyFunction = (...args: any[]) => any;
|
|
11
|
+
declare function once<T extends () => any>(fn: T): () => ReturnType<T>;
|
|
12
|
+
|
|
13
|
+
type OmitChainMethodDeep<T extends object, K extends keyof any> = {
|
|
14
|
+
[P in keyof Omit<T, K>]: T[P] extends AnyFunction ? ((...args: Parameters<T[P]>) => OmitChainMethodDeep<ReturnType<T[P]>, K>) : T[P];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare function toError(error: unknown): Error;
|
|
18
|
+
|
|
19
|
+
type InterceptableOptions = Record<string, any>;
|
|
20
|
+
type InterceptorOptions<TOptions extends InterceptableOptions, TResult> = Omit<TOptions, 'next'> & {
|
|
21
|
+
next(options?: TOptions): Promise<TResult>;
|
|
22
|
+
};
|
|
23
|
+
type Interceptor<TOptions extends InterceptableOptions, TResult, TError> = (options: InterceptorOptions<TOptions, TResult>) => Promise<TResult> & {
|
|
24
|
+
__error?: {
|
|
25
|
+
type: TError;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Can used for interceptors or middlewares
|
|
30
|
+
*/
|
|
31
|
+
declare function onStart<TOptions extends {
|
|
32
|
+
next(): any;
|
|
33
|
+
}, TRest extends any[]>(callback: NoInfer<(options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Can used for interceptors or middlewares
|
|
36
|
+
*/
|
|
37
|
+
declare function onSuccess<TOptions extends {
|
|
38
|
+
next(): any;
|
|
39
|
+
}, TRest extends any[]>(callback: NoInfer<(result: Awaited<ReturnType<TOptions['next']>>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Can used for interceptors or middlewares
|
|
42
|
+
*/
|
|
43
|
+
declare function onError<TError, TOptions extends {
|
|
44
|
+
next(): any;
|
|
45
|
+
}, TRest extends any[]>(callback: NoInfer<(error: TError, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>> & {
|
|
46
|
+
__error?: {
|
|
47
|
+
type: TError;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type OnFinishState<TResult, TError> = [TResult, null, 'success'] | [undefined, TError, 'error'];
|
|
51
|
+
/**
|
|
52
|
+
* Can used for interceptors or middlewares
|
|
53
|
+
*/
|
|
54
|
+
declare function onFinish<TError, TOptions extends {
|
|
55
|
+
next(): any;
|
|
56
|
+
}, TRest extends any[]>(callback: NoInfer<(state: OnFinishState<Awaited<ReturnType<TOptions['next']>>, TError>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>> & {
|
|
57
|
+
__error?: {
|
|
58
|
+
type: TError;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
declare function intercept<TOptions extends InterceptableOptions, TResult, TError>(interceptors: Interceptor<TOptions, TResult, TError>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => Promisable<TResult>>): Promise<TResult>;
|
|
62
|
+
|
|
63
|
+
declare function isAsyncIteratorObject(maybe: unknown): maybe is AsyncIteratorObject<any, any, any>;
|
|
64
|
+
|
|
65
|
+
declare function parseEmptyableJSON(text: string | null | undefined): unknown;
|
|
66
|
+
declare function stringifyJSON<T>(value: T): undefined extends T ? undefined | string : string;
|
|
67
|
+
|
|
68
|
+
type Segment = string | number;
|
|
69
|
+
declare function findDeepMatches(check: (value: unknown) => boolean, payload: unknown, segments?: Segment[], maps?: Segment[][], values?: unknown[]): {
|
|
70
|
+
maps: Segment[][];
|
|
71
|
+
values: unknown[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Check if the value is an object even it created by `Object.create(null)` or more tricky way.
|
|
75
|
+
*/
|
|
76
|
+
declare function isObject(value: unknown): value is Record<PropertyKey, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Check if the value satisfy a `object` type in typescript
|
|
79
|
+
*/
|
|
80
|
+
declare function isTypescriptObject(value: unknown): value is object & Record<PropertyKey, unknown>;
|
|
81
|
+
declare function clone<T>(value: T): T;
|
|
82
|
+
|
|
83
|
+
type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
84
|
+
type IntersectPick<T, U> = Pick<T, keyof T & keyof U>;
|
|
85
|
+
|
|
86
|
+
type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => Promisable<T>);
|
|
87
|
+
declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): Promise<T extends Value<infer U, any> ? U : never>;
|
|
88
|
+
|
|
89
|
+
export { type AnyFunction, type InterceptableOptions, type Interceptor, type InterceptorOptions, type IntersectPick, type MaybeOptionalOptions, type OmitChainMethodDeep, type OnFinishState, type Segment, type SetOptional, type Value, clone, findDeepMatches, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, stringifyJSON, toArray, toError, value };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Promisable } from 'type-fest';
|
|
2
|
+
export { IsEqual, IsNever, PartialDeep, Promisable } from 'type-fest';
|
|
3
|
+
export { group, guard, mapEntries, mapValues, omit } from 'radash';
|
|
4
|
+
|
|
5
|
+
type MaybeOptionalOptions<TOptions> = Record<never, never> extends TOptions ? [options?: TOptions] : [options: TOptions];
|
|
6
|
+
declare function resolveMaybeOptionalOptions<T>(rest: MaybeOptionalOptions<T>): T;
|
|
7
|
+
|
|
8
|
+
declare function toArray<T>(value: T | T[] | null | undefined): T[];
|
|
9
|
+
|
|
10
|
+
type AnyFunction = (...args: any[]) => any;
|
|
11
|
+
declare function once<T extends () => any>(fn: T): () => ReturnType<T>;
|
|
12
|
+
|
|
13
|
+
type OmitChainMethodDeep<T extends object, K extends keyof any> = {
|
|
14
|
+
[P in keyof Omit<T, K>]: T[P] extends AnyFunction ? ((...args: Parameters<T[P]>) => OmitChainMethodDeep<ReturnType<T[P]>, K>) : T[P];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare function toError(error: unknown): Error;
|
|
18
|
+
|
|
19
|
+
type InterceptableOptions = Record<string, any>;
|
|
20
|
+
type InterceptorOptions<TOptions extends InterceptableOptions, TResult> = Omit<TOptions, 'next'> & {
|
|
21
|
+
next(options?: TOptions): Promise<TResult>;
|
|
22
|
+
};
|
|
23
|
+
type Interceptor<TOptions extends InterceptableOptions, TResult, TError> = (options: InterceptorOptions<TOptions, TResult>) => Promise<TResult> & {
|
|
24
|
+
__error?: {
|
|
25
|
+
type: TError;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Can used for interceptors or middlewares
|
|
30
|
+
*/
|
|
31
|
+
declare function onStart<TOptions extends {
|
|
32
|
+
next(): any;
|
|
33
|
+
}, TRest extends any[]>(callback: NoInfer<(options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Can used for interceptors or middlewares
|
|
36
|
+
*/
|
|
37
|
+
declare function onSuccess<TOptions extends {
|
|
38
|
+
next(): any;
|
|
39
|
+
}, TRest extends any[]>(callback: NoInfer<(result: Awaited<ReturnType<TOptions['next']>>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Can used for interceptors or middlewares
|
|
42
|
+
*/
|
|
43
|
+
declare function onError<TError, TOptions extends {
|
|
44
|
+
next(): any;
|
|
45
|
+
}, TRest extends any[]>(callback: NoInfer<(error: TError, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>> & {
|
|
46
|
+
__error?: {
|
|
47
|
+
type: TError;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type OnFinishState<TResult, TError> = [TResult, null, 'success'] | [undefined, TError, 'error'];
|
|
51
|
+
/**
|
|
52
|
+
* Can used for interceptors or middlewares
|
|
53
|
+
*/
|
|
54
|
+
declare function onFinish<TError, TOptions extends {
|
|
55
|
+
next(): any;
|
|
56
|
+
}, TRest extends any[]>(callback: NoInfer<(state: OnFinishState<Awaited<ReturnType<TOptions['next']>>, TError>, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => Promise<Awaited<ReturnType<TOptions['next']>>> & {
|
|
57
|
+
__error?: {
|
|
58
|
+
type: TError;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
declare function intercept<TOptions extends InterceptableOptions, TResult, TError>(interceptors: Interceptor<TOptions, TResult, TError>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => Promisable<TResult>>): Promise<TResult>;
|
|
62
|
+
|
|
63
|
+
declare function isAsyncIteratorObject(maybe: unknown): maybe is AsyncIteratorObject<any, any, any>;
|
|
64
|
+
|
|
65
|
+
declare function parseEmptyableJSON(text: string | null | undefined): unknown;
|
|
66
|
+
declare function stringifyJSON<T>(value: T): undefined extends T ? undefined | string : string;
|
|
67
|
+
|
|
68
|
+
type Segment = string | number;
|
|
69
|
+
declare function findDeepMatches(check: (value: unknown) => boolean, payload: unknown, segments?: Segment[], maps?: Segment[][], values?: unknown[]): {
|
|
70
|
+
maps: Segment[][];
|
|
71
|
+
values: unknown[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Check if the value is an object even it created by `Object.create(null)` or more tricky way.
|
|
75
|
+
*/
|
|
76
|
+
declare function isObject(value: unknown): value is Record<PropertyKey, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Check if the value satisfy a `object` type in typescript
|
|
79
|
+
*/
|
|
80
|
+
declare function isTypescriptObject(value: unknown): value is object & Record<PropertyKey, unknown>;
|
|
81
|
+
declare function clone<T>(value: T): T;
|
|
82
|
+
|
|
83
|
+
type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
84
|
+
type IntersectPick<T, U> = Pick<T, keyof T & keyof U>;
|
|
85
|
+
|
|
86
|
+
type Value<T, TArgs extends any[] = []> = T | ((...args: TArgs) => Promisable<T>);
|
|
87
|
+
declare function value<T, TArgs extends any[]>(value: Value<T, TArgs>, ...args: NoInfer<TArgs>): Promise<T extends Value<infer U, any> ? U : never>;
|
|
88
|
+
|
|
89
|
+
export { type AnyFunction, type InterceptableOptions, type Interceptor, type InterceptorOptions, type IntersectPick, type MaybeOptionalOptions, type OmitChainMethodDeep, type OnFinishState, type Segment, type SetOptional, type Value, clone, findDeepMatches, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, stringifyJSON, toArray, toError, value };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export { group, guard, mapEntries, mapValues, omit } from 'radash';
|
|
2
|
+
|
|
3
|
+
function resolveMaybeOptionalOptions(rest) {
|
|
4
|
+
return rest[0] ?? {};
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function toArray(value) {
|
|
8
|
+
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function toError(error) {
|
|
12
|
+
if (error instanceof Error) {
|
|
13
|
+
return error;
|
|
14
|
+
}
|
|
15
|
+
return new Error("Unknown error", { cause: error });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function once(fn) {
|
|
19
|
+
let cached;
|
|
20
|
+
return () => {
|
|
21
|
+
if (cached) {
|
|
22
|
+
return cached.result;
|
|
23
|
+
}
|
|
24
|
+
const result = fn();
|
|
25
|
+
cached = { result };
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function onStart(callback) {
|
|
31
|
+
return async (options, ...rest) => {
|
|
32
|
+
await callback(options, ...rest);
|
|
33
|
+
return await options.next();
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function onSuccess(callback) {
|
|
37
|
+
return async (options, ...rest) => {
|
|
38
|
+
const result = await options.next();
|
|
39
|
+
await callback(result, options, ...rest);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function onError(callback) {
|
|
44
|
+
return async (options, ...rest) => {
|
|
45
|
+
try {
|
|
46
|
+
return await options.next();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
await callback(error, options, ...rest);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function onFinish(callback) {
|
|
54
|
+
let state;
|
|
55
|
+
return async (options, ...rest) => {
|
|
56
|
+
try {
|
|
57
|
+
const result = await options.next();
|
|
58
|
+
state = [result, null, "success"];
|
|
59
|
+
return result;
|
|
60
|
+
} catch (error) {
|
|
61
|
+
state = [void 0, error, "error"];
|
|
62
|
+
throw error;
|
|
63
|
+
} finally {
|
|
64
|
+
await callback(state, options, ...rest);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async function intercept(interceptors, options, main) {
|
|
69
|
+
let index = 0;
|
|
70
|
+
const next = async (options2) => {
|
|
71
|
+
const interceptor = interceptors[index++];
|
|
72
|
+
if (!interceptor) {
|
|
73
|
+
return await main(options2);
|
|
74
|
+
}
|
|
75
|
+
return await interceptor({
|
|
76
|
+
...options2,
|
|
77
|
+
next: (newOptions = options2) => next(newOptions)
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return await next(options);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function isAsyncIteratorObject(maybe) {
|
|
84
|
+
if (!maybe || typeof maybe !== "object") {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return Symbol.asyncIterator in maybe && typeof maybe[Symbol.asyncIterator] === "function";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function parseEmptyableJSON(text) {
|
|
91
|
+
if (!text) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
return JSON.parse(text);
|
|
95
|
+
}
|
|
96
|
+
function stringifyJSON(value) {
|
|
97
|
+
return JSON.stringify(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function findDeepMatches(check, payload, segments = [], maps = [], values = []) {
|
|
101
|
+
if (check(payload)) {
|
|
102
|
+
maps.push(segments);
|
|
103
|
+
values.push(payload);
|
|
104
|
+
} else if (Array.isArray(payload)) {
|
|
105
|
+
payload.forEach((v, i) => {
|
|
106
|
+
findDeepMatches(check, v, [...segments, i], maps, values);
|
|
107
|
+
});
|
|
108
|
+
} else if (isObject(payload)) {
|
|
109
|
+
for (const key in payload) {
|
|
110
|
+
findDeepMatches(check, payload[key], [...segments, key], maps, values);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return { maps, values };
|
|
114
|
+
}
|
|
115
|
+
function isObject(value) {
|
|
116
|
+
if (!value || typeof value !== "object") {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
const proto = Object.getPrototypeOf(value);
|
|
120
|
+
return proto === Object.prototype || !proto || !proto.constructor;
|
|
121
|
+
}
|
|
122
|
+
function isTypescriptObject(value) {
|
|
123
|
+
return !!value && (typeof value === "object" || typeof value === "function");
|
|
124
|
+
}
|
|
125
|
+
function clone(value) {
|
|
126
|
+
if (Array.isArray(value)) {
|
|
127
|
+
return value.map(clone);
|
|
128
|
+
}
|
|
129
|
+
if (isObject(value)) {
|
|
130
|
+
const result = {};
|
|
131
|
+
for (const key in value) {
|
|
132
|
+
result[key] = clone(value[key]);
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function value(value2, ...args) {
|
|
140
|
+
if (typeof value2 === "function") {
|
|
141
|
+
return value2(...args);
|
|
142
|
+
}
|
|
143
|
+
return value2;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { clone, findDeepMatches, intercept, isAsyncIteratorObject, isObject, isTypescriptObject, onError, onFinish, onStart, onSuccess, once, parseEmptyableJSON, resolveMaybeOptionalOptions, stringifyJSON, toArray, toError, value };
|
package/package.json
CHANGED
|
@@ -1,49 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "unnoq",
|
|
7
|
-
"email": "contact@unnoq.com",
|
|
8
|
-
"url": "https://unnoq.com"
|
|
9
|
-
},
|
|
4
|
+
"version": "0.0.0-next.ea0903c",
|
|
10
5
|
"license": "MIT",
|
|
11
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://orpc.unnoq.com",
|
|
12
7
|
"repository": {
|
|
13
8
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/unnoq/orpc.git",
|
|
9
|
+
"url": "git+https://github.com/unnoq/orpc.git",
|
|
15
10
|
"directory": "packages/shared"
|
|
16
11
|
},
|
|
17
12
|
"keywords": [
|
|
18
|
-
"unnoq"
|
|
13
|
+
"unnoq",
|
|
14
|
+
"orpc"
|
|
19
15
|
],
|
|
20
16
|
"exports": {
|
|
21
17
|
".": {
|
|
22
|
-
"types": "./dist/
|
|
23
|
-
"import": "./dist/index.
|
|
24
|
-
"default": "./dist/index.
|
|
25
|
-
},
|
|
26
|
-
"./error": {
|
|
27
|
-
"types": "./dist/src/error.d.ts",
|
|
28
|
-
"import": "./dist/error.js",
|
|
29
|
-
"default": "./dist/error.js"
|
|
30
|
-
},
|
|
31
|
-
"./🔒/*": {
|
|
32
|
-
"types": "./dist/src/*.d.ts"
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"default": "./dist/index.mjs"
|
|
33
21
|
}
|
|
34
22
|
},
|
|
35
23
|
"files": [
|
|
36
|
-
"dist"
|
|
37
|
-
"src"
|
|
24
|
+
"dist"
|
|
38
25
|
],
|
|
39
26
|
"dependencies": {
|
|
40
|
-
"is-what": "^5.0.2",
|
|
41
27
|
"radash": "^12.1.0",
|
|
42
|
-
"type-fest": "^4.26.1"
|
|
43
|
-
"zod": "^3.23.8"
|
|
28
|
+
"type-fest": "^4.26.1"
|
|
44
29
|
},
|
|
45
30
|
"scripts": {
|
|
46
|
-
"build": "
|
|
31
|
+
"build": "unbuild",
|
|
47
32
|
"build:watch": "pnpm run build --watch",
|
|
48
33
|
"type:check": "tsc -b"
|
|
49
34
|
}
|
package/dist/error.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/error.ts
|
|
2
|
-
import { ZodError } from "zod";
|
|
3
|
-
var ORPC_ERROR_CODE_STATUSES = {
|
|
4
|
-
BAD_REQUEST: 400,
|
|
5
|
-
UNAUTHORIZED: 401,
|
|
6
|
-
FORBIDDEN: 403,
|
|
7
|
-
NOT_FOUND: 404,
|
|
8
|
-
METHOD_NOT_SUPPORTED: 405,
|
|
9
|
-
NOT_ACCEPTABLE: 406,
|
|
10
|
-
TIMEOUT: 408,
|
|
11
|
-
CONFLICT: 409,
|
|
12
|
-
PRECONDITION_FAILED: 412,
|
|
13
|
-
PAYLOAD_TOO_LARGE: 413,
|
|
14
|
-
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
15
|
-
UNPROCESSABLE_CONTENT: 422,
|
|
16
|
-
TOO_MANY_REQUESTS: 429,
|
|
17
|
-
CLIENT_CLOSED_REQUEST: 499,
|
|
18
|
-
INTERNAL_SERVER_ERROR: 500,
|
|
19
|
-
NOT_IMPLEMENTED: 501,
|
|
20
|
-
BAD_GATEWAY: 502,
|
|
21
|
-
SERVICE_UNAVAILABLE: 503,
|
|
22
|
-
GATEWAY_TIMEOUT: 504
|
|
23
|
-
};
|
|
24
|
-
var ORPCError = class _ORPCError extends Error {
|
|
25
|
-
constructor(zz$oe) {
|
|
26
|
-
if (zz$oe.status && (zz$oe.status < 400 || zz$oe.status >= 600)) {
|
|
27
|
-
throw new Error("The ORPCError status code must be in the 400-599 range.");
|
|
28
|
-
}
|
|
29
|
-
super(zz$oe.message, { cause: zz$oe.cause });
|
|
30
|
-
this.zz$oe = zz$oe;
|
|
31
|
-
}
|
|
32
|
-
get code() {
|
|
33
|
-
return this.zz$oe.code;
|
|
34
|
-
}
|
|
35
|
-
get status() {
|
|
36
|
-
return this.zz$oe.status ?? ORPC_ERROR_CODE_STATUSES[this.code];
|
|
37
|
-
}
|
|
38
|
-
get data() {
|
|
39
|
-
return this.zz$oe.data;
|
|
40
|
-
}
|
|
41
|
-
get issues() {
|
|
42
|
-
if (this.code === "BAD_REQUEST" && this.zz$oe.cause instanceof ZodError) {
|
|
43
|
-
return this.zz$oe.cause.issues;
|
|
44
|
-
}
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
toJSON() {
|
|
48
|
-
return {
|
|
49
|
-
code: this.code,
|
|
50
|
-
status: this.status,
|
|
51
|
-
message: this.message,
|
|
52
|
-
data: this.data,
|
|
53
|
-
issues: this.issues
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static fromJSON(json) {
|
|
57
|
-
if (typeof json !== "object" || json === null || !("code" in json) || !Object.keys(ORPC_ERROR_CODE_STATUSES).find((key) => json.code === key) || !("status" in json) || typeof json.status !== "number" || "message" in json && json.message !== void 0 && typeof json.message !== "string" || "issues" in json && json.issues !== void 0 && !Array.isArray(json.issues)) {
|
|
58
|
-
return void 0;
|
|
59
|
-
}
|
|
60
|
-
return new _ORPCError({
|
|
61
|
-
code: json.code,
|
|
62
|
-
status: json.status,
|
|
63
|
-
message: Reflect.get(json, "message"),
|
|
64
|
-
data: Reflect.get(json, "data"),
|
|
65
|
-
cause: "issues" in json ? new ZodError(json.issues) : void 0
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
ORPCError,
|
|
71
|
-
ORPC_ERROR_CODE_STATUSES
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=error.js.map
|
package/dist/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/error.ts"],"sourcesContent":["import { ZodError, type ZodIssue } from 'zod'\n\nexport const ORPC_ERROR_CODE_STATUSES = {\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n METHOD_NOT_SUPPORTED: 405,\n NOT_ACCEPTABLE: 406,\n TIMEOUT: 408,\n CONFLICT: 409,\n PRECONDITION_FAILED: 412,\n PAYLOAD_TOO_LARGE: 413,\n UNSUPPORTED_MEDIA_TYPE: 415,\n UNPROCESSABLE_CONTENT: 422,\n TOO_MANY_REQUESTS: 429,\n CLIENT_CLOSED_REQUEST: 499,\n\n INTERNAL_SERVER_ERROR: 500,\n NOT_IMPLEMENTED: 501,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const\n\nexport type ORPCErrorCode = keyof typeof ORPC_ERROR_CODE_STATUSES\n\nexport class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {\n constructor(\n public zz$oe: {\n code: TCode\n status?: number\n message?: string\n cause?: unknown\n } & (undefined extends TData ? { data?: TData } : { data: TData }),\n ) {\n if (zz$oe.status && (zz$oe.status < 400 || zz$oe.status >= 600)) {\n throw new Error('The ORPCError status code must be in the 400-599 range.')\n }\n\n super(zz$oe.message, { cause: zz$oe.cause })\n }\n\n get code(): TCode {\n return this.zz$oe.code\n }\n\n get status(): number {\n return this.zz$oe.status ?? ORPC_ERROR_CODE_STATUSES[this.code]\n }\n\n get data(): TData {\n return this.zz$oe.data as TData\n }\n\n get issues(): ZodIssue[] | undefined {\n if (this.code === 'BAD_REQUEST' && this.zz$oe.cause instanceof ZodError) {\n return this.zz$oe.cause.issues\n }\n\n return undefined\n }\n\n toJSON(): {\n code: TCode\n status: number\n message: string\n data: TData\n issues?: ZodIssue[]\n } {\n return {\n code: this.code,\n status: this.status,\n message: this.message,\n data: this.data,\n issues: this.issues,\n }\n }\n\n static fromJSON(json: unknown): ORPCError<ORPCErrorCode, any> | undefined {\n if (\n typeof json !== 'object'\n || json === null\n || !('code' in json)\n || !Object.keys(ORPC_ERROR_CODE_STATUSES).find(key => json.code === key)\n || !('status' in json)\n || typeof json.status !== 'number'\n || ('message' in json\n && json.message !== undefined\n && typeof json.message !== 'string')\n || ('issues' in json\n && json.issues !== undefined\n && !Array.isArray(json.issues))\n ) {\n return undefined\n }\n\n return new ORPCError({\n code: json.code as ORPCErrorCode,\n status: json.status as number,\n message: Reflect.get(json, 'message') as string,\n data: Reflect.get(json, 'data') as any,\n cause: 'issues' in json ? new ZodError(json.issues as any) : undefined,\n })\n }\n}\n"],"mappings":";AAAA,SAAS,gBAA+B;AAEjC,IAAM,2BAA2B;AAAA,EACtC,aAAa;AAAA,EACb,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EAEvB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AACnB;AAIO,IAAM,YAAN,MAAM,mBAAsD,MAAM;AAAA,EACvE,YACS,OAMP;AACA,QAAI,MAAM,WAAW,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM;AAC/D,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC3E;AAEA,UAAM,MAAM,SAAS,EAAE,OAAO,MAAM,MAAM,CAAC;AAXpC;AAAA,EAYT;AAAA,EAEA,IAAI,OAAc;AAChB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAEA,IAAI,SAAiB;AACnB,WAAO,KAAK,MAAM,UAAU,yBAAyB,KAAK,IAAI;AAAA,EAChE;AAAA,EAEA,IAAI,OAAc;AAChB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAEA,IAAI,SAAiC;AACnC,QAAI,KAAK,SAAS,iBAAiB,KAAK,MAAM,iBAAiB,UAAU;AACvE,aAAO,KAAK,MAAM,MAAM;AAAA,IAC1B;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,SAME;AACA,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAAA,EAEA,OAAO,SAAS,MAA0D;AACxE,QACE,OAAO,SAAS,YACb,SAAS,QACT,EAAE,UAAU,SACZ,CAAC,OAAO,KAAK,wBAAwB,EAAE,KAAK,SAAO,KAAK,SAAS,GAAG,KACpE,EAAE,YAAY,SACd,OAAO,KAAK,WAAW,YACtB,aAAa,QACZ,KAAK,YAAY,UACjB,OAAO,KAAK,YAAY,YACzB,YAAY,QACX,KAAK,WAAW,UAChB,CAAC,MAAM,QAAQ,KAAK,MAAM,GAC/B;AACA,aAAO;AAAA,IACT;AAEA,WAAO,IAAI,WAAU;AAAA,MACnB,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,SAAS,QAAQ,IAAI,MAAM,SAAS;AAAA,MACpC,MAAM,QAAQ,IAAI,MAAM,MAAM;AAAA,MAC9B,OAAO,YAAY,OAAO,IAAI,SAAS,KAAK,MAAa,IAAI;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// src/json.ts
|
|
2
|
-
function parseJSONSafely(text) {
|
|
3
|
-
if (text === "")
|
|
4
|
-
return void 0;
|
|
5
|
-
try {
|
|
6
|
-
return JSON.parse(text);
|
|
7
|
-
} catch {
|
|
8
|
-
return text;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/object.ts
|
|
13
|
-
import { isPlainObject } from "is-what";
|
|
14
|
-
function set(root, segments, value2) {
|
|
15
|
-
const ref = { root };
|
|
16
|
-
let currentRef = ref;
|
|
17
|
-
let preSegment = "root";
|
|
18
|
-
for (const segment of segments) {
|
|
19
|
-
currentRef = currentRef[preSegment];
|
|
20
|
-
preSegment = segment;
|
|
21
|
-
}
|
|
22
|
-
currentRef[preSegment] = value2;
|
|
23
|
-
return ref.root;
|
|
24
|
-
}
|
|
25
|
-
function get(root, segments) {
|
|
26
|
-
const ref = { root };
|
|
27
|
-
let currentRef = ref;
|
|
28
|
-
let preSegment = "root";
|
|
29
|
-
for (const segment of segments) {
|
|
30
|
-
if (typeof currentRef !== "object" && typeof currentRef !== "function" || currentRef === null) {
|
|
31
|
-
return void 0;
|
|
32
|
-
}
|
|
33
|
-
currentRef = currentRef[preSegment];
|
|
34
|
-
preSegment = segment;
|
|
35
|
-
}
|
|
36
|
-
if (typeof currentRef !== "object" && typeof currentRef !== "function" || currentRef === null) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
return currentRef[preSegment];
|
|
40
|
-
}
|
|
41
|
-
function findDeepMatches(check, payload, segments = [], maps = [], values = []) {
|
|
42
|
-
if (check(payload)) {
|
|
43
|
-
maps.push(segments);
|
|
44
|
-
values.push(payload);
|
|
45
|
-
} else if (Array.isArray(payload)) {
|
|
46
|
-
payload.forEach((v, i) => {
|
|
47
|
-
findDeepMatches(check, v, [...segments, i], maps, values);
|
|
48
|
-
});
|
|
49
|
-
} else if (isPlainObject(payload)) {
|
|
50
|
-
for (const key in payload) {
|
|
51
|
-
findDeepMatches(check, payload[key], [...segments, key], maps, values);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return { maps, values };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/value.ts
|
|
58
|
-
function value(value2) {
|
|
59
|
-
if (typeof value2 === "function") {
|
|
60
|
-
return value2();
|
|
61
|
-
}
|
|
62
|
-
return value2;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/index.ts
|
|
66
|
-
import { isPlainObject as isPlainObject2 } from "is-what";
|
|
67
|
-
import { guard, mapEntries, mapValues, omit, trim } from "radash";
|
|
68
|
-
export {
|
|
69
|
-
findDeepMatches,
|
|
70
|
-
get,
|
|
71
|
-
guard,
|
|
72
|
-
isPlainObject2 as isPlainObject,
|
|
73
|
-
mapEntries,
|
|
74
|
-
mapValues,
|
|
75
|
-
omit,
|
|
76
|
-
parseJSONSafely,
|
|
77
|
-
set,
|
|
78
|
-
trim,
|
|
79
|
-
value
|
|
80
|
-
};
|
|
81
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/json.ts","../src/object.ts","../src/value.ts","../src/index.ts"],"sourcesContent":["export function parseJSONSafely(text: string): unknown {\n if (text === '')\n return undefined\n\n try {\n return JSON.parse(text)\n }\n catch {\n return text\n }\n}\n","import { isPlainObject } from 'is-what'\n\nexport type Segment = string | number\n\nexport function set(\n root: Readonly<Record<string, unknown> | unknown[]>,\n segments: Readonly<Segment[]>,\n value: unknown,\n): unknown {\n const ref = { root }\n\n let currentRef: any = ref\n let preSegment: string | number = 'root'\n\n for (const segment of segments) {\n currentRef = currentRef[preSegment]\n preSegment = segment\n }\n\n currentRef[preSegment] = value\n\n return ref.root\n}\n\nexport function get(\n root: Readonly<Record<string, unknown> | unknown[]>,\n segments: Readonly<Segment[]>,\n): unknown {\n const ref = { root }\n\n let currentRef: any = ref\n let preSegment: string | number = 'root'\n\n for (const segment of segments) {\n if (\n (typeof currentRef !== 'object' && typeof currentRef !== 'function')\n || currentRef === null\n ) {\n return undefined\n }\n\n currentRef = currentRef[preSegment]\n preSegment = segment\n }\n\n if (\n (typeof currentRef !== 'object' && typeof currentRef !== 'function')\n || currentRef === null\n ) {\n return undefined\n }\n\n return currentRef[preSegment]\n}\n\nexport function findDeepMatches(\n check: (value: unknown) => boolean,\n payload: unknown,\n segments: Segment[] = [],\n maps: Segment[][] = [],\n values: unknown[] = [],\n): { maps: Segment[][], values: unknown[] } {\n if (check(payload)) {\n maps.push(segments)\n values.push(payload)\n }\n else if (Array.isArray(payload)) {\n payload.forEach((v, i) => {\n findDeepMatches(check, v, [...segments, i], maps, values)\n })\n }\n else if (isPlainObject(payload)) {\n for (const key in payload) {\n findDeepMatches(check, payload[key], [...segments, key], maps, values)\n }\n }\n\n return { maps, values }\n}\n","import type { Promisable } from 'type-fest'\n\nexport type Value<T> = T | (() => Promisable<T>)\n\nexport function value<T extends Value<any>>(value: T):\nPromise<T extends Value<infer U> ? U : never> {\n if (typeof value === 'function') {\n return value()\n }\n\n return value as any\n}\n","export * from './json'\n\nexport * from './object'\nexport * from './value'\nexport { isPlainObject } from 'is-what'\n\nexport { guard, mapEntries, mapValues, omit, trim } from 'radash'\nexport type * from 'type-fest'\n"],"mappings":";AAAO,SAAS,gBAAgB,MAAuB;AACrD,MAAI,SAAS;AACX,WAAO;AAET,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QACM;AACJ,WAAO;AAAA,EACT;AACF;;;ACVA,SAAS,qBAAqB;AAIvB,SAAS,IACd,MACA,UACAA,QACS;AACT,QAAM,MAAM,EAAE,KAAK;AAEnB,MAAI,aAAkB;AACtB,MAAI,aAA8B;AAElC,aAAW,WAAW,UAAU;AAC9B,iBAAa,WAAW,UAAU;AAClC,iBAAa;AAAA,EACf;AAEA,aAAW,UAAU,IAAIA;AAEzB,SAAO,IAAI;AACb;AAEO,SAAS,IACd,MACA,UACS;AACT,QAAM,MAAM,EAAE,KAAK;AAEnB,MAAI,aAAkB;AACtB,MAAI,aAA8B;AAElC,aAAW,WAAW,UAAU;AAC9B,QACG,OAAO,eAAe,YAAY,OAAO,eAAe,cACtD,eAAe,MAClB;AACA,aAAO;AAAA,IACT;AAEA,iBAAa,WAAW,UAAU;AAClC,iBAAa;AAAA,EACf;AAEA,MACG,OAAO,eAAe,YAAY,OAAO,eAAe,cACtD,eAAe,MAClB;AACA,WAAO;AAAA,EACT;AAEA,SAAO,WAAW,UAAU;AAC9B;AAEO,SAAS,gBACd,OACA,SACA,WAAsB,CAAC,GACvB,OAAoB,CAAC,GACrB,SAAoB,CAAC,GACqB;AAC1C,MAAI,MAAM,OAAO,GAAG;AAClB,SAAK,KAAK,QAAQ;AAClB,WAAO,KAAK,OAAO;AAAA,EACrB,WACS,MAAM,QAAQ,OAAO,GAAG;AAC/B,YAAQ,QAAQ,CAAC,GAAG,MAAM;AACxB,sBAAgB,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,MAAM,MAAM;AAAA,IAC1D,CAAC;AAAA,EACH,WACS,cAAc,OAAO,GAAG;AAC/B,eAAW,OAAO,SAAS;AACzB,sBAAgB,OAAO,QAAQ,GAAG,GAAG,CAAC,GAAG,UAAU,GAAG,GAAG,MAAM,MAAM;AAAA,IACvE;AAAA,EACF;AAEA,SAAO,EAAE,MAAM,OAAO;AACxB;;;AC1EO,SAAS,MAA4BC,QACE;AAC5C,MAAI,OAAOA,WAAU,YAAY;AAC/B,WAAOA,OAAM;AAAA,EACf;AAEA,SAAOA;AACT;;;ACPA,SAAS,iBAAAC,sBAAqB;AAE9B,SAAS,OAAO,YAAY,WAAW,MAAM,YAAY;","names":["value","value","isPlainObject"]}
|
package/dist/src/error.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { type ZodIssue } from 'zod';
|
|
2
|
-
export declare const ORPC_ERROR_CODE_STATUSES: {
|
|
3
|
-
readonly BAD_REQUEST: 400;
|
|
4
|
-
readonly UNAUTHORIZED: 401;
|
|
5
|
-
readonly FORBIDDEN: 403;
|
|
6
|
-
readonly NOT_FOUND: 404;
|
|
7
|
-
readonly METHOD_NOT_SUPPORTED: 405;
|
|
8
|
-
readonly NOT_ACCEPTABLE: 406;
|
|
9
|
-
readonly TIMEOUT: 408;
|
|
10
|
-
readonly CONFLICT: 409;
|
|
11
|
-
readonly PRECONDITION_FAILED: 412;
|
|
12
|
-
readonly PAYLOAD_TOO_LARGE: 413;
|
|
13
|
-
readonly UNSUPPORTED_MEDIA_TYPE: 415;
|
|
14
|
-
readonly UNPROCESSABLE_CONTENT: 422;
|
|
15
|
-
readonly TOO_MANY_REQUESTS: 429;
|
|
16
|
-
readonly CLIENT_CLOSED_REQUEST: 499;
|
|
17
|
-
readonly INTERNAL_SERVER_ERROR: 500;
|
|
18
|
-
readonly NOT_IMPLEMENTED: 501;
|
|
19
|
-
readonly BAD_GATEWAY: 502;
|
|
20
|
-
readonly SERVICE_UNAVAILABLE: 503;
|
|
21
|
-
readonly GATEWAY_TIMEOUT: 504;
|
|
22
|
-
};
|
|
23
|
-
export type ORPCErrorCode = keyof typeof ORPC_ERROR_CODE_STATUSES;
|
|
24
|
-
export declare class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
|
|
25
|
-
zz$oe: {
|
|
26
|
-
code: TCode;
|
|
27
|
-
status?: number;
|
|
28
|
-
message?: string;
|
|
29
|
-
cause?: unknown;
|
|
30
|
-
} & (undefined extends TData ? {
|
|
31
|
-
data?: TData;
|
|
32
|
-
} : {
|
|
33
|
-
data: TData;
|
|
34
|
-
});
|
|
35
|
-
constructor(zz$oe: {
|
|
36
|
-
code: TCode;
|
|
37
|
-
status?: number;
|
|
38
|
-
message?: string;
|
|
39
|
-
cause?: unknown;
|
|
40
|
-
} & (undefined extends TData ? {
|
|
41
|
-
data?: TData;
|
|
42
|
-
} : {
|
|
43
|
-
data: TData;
|
|
44
|
-
}));
|
|
45
|
-
get code(): TCode;
|
|
46
|
-
get status(): number;
|
|
47
|
-
get data(): TData;
|
|
48
|
-
get issues(): ZodIssue[] | undefined;
|
|
49
|
-
toJSON(): {
|
|
50
|
-
code: TCode;
|
|
51
|
-
status: number;
|
|
52
|
-
message: string;
|
|
53
|
-
data: TData;
|
|
54
|
-
issues?: ZodIssue[];
|
|
55
|
-
};
|
|
56
|
-
static fromJSON(json: unknown): ORPCError<ORPCErrorCode, any> | undefined;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=error.d.ts.map
|
package/dist/src/error.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAE7C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;CAqB3B,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,wBAAwB,CAAA;AAEjE,qBAAa,SAAS,CAAC,KAAK,SAAS,aAAa,EAAE,KAAK,CAAE,SAAQ,KAAK;IAE7D,KAAK,EAAE;QACZ,IAAI,EAAE,KAAK,CAAA;QACX,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,GAAG,CAAC,SAAS,SAAS,KAAK,GAAG;QAAE,IAAI,CAAC,EAAE,KAAK,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;gBAL3D,KAAK,EAAE;QACZ,IAAI,EAAE,KAAK,CAAA;QACX,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,GAAG,CAAC,SAAS,SAAS,KAAK,GAAG;QAAE,IAAI,CAAC,EAAE,KAAK,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;IASpE,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED,IAAI,MAAM,IAAI,QAAQ,EAAE,GAAG,SAAS,CAMnC;IAED,MAAM,IAAI;QACR,IAAI,EAAE,KAAK,CAAA;QACX,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,KAAK,CAAA;QACX,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAA;KACpB;IAUD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG,SAAS;CA0B1E"}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AAEtB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACjE,mBAAmB,WAAW,CAAA"}
|
package/dist/src/json.d.ts
DELETED
package/dist/src/json.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/json.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUrD"}
|
package/dist/src/object.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type Segment = string | number;
|
|
2
|
-
export declare function set(root: Readonly<Record<string, unknown> | unknown[]>, segments: Readonly<Segment[]>, value: unknown): unknown;
|
|
3
|
-
export declare function get(root: Readonly<Record<string, unknown> | unknown[]>, segments: Readonly<Segment[]>): unknown;
|
|
4
|
-
export declare function findDeepMatches(check: (value: unknown) => boolean, payload: unknown, segments?: Segment[], maps?: Segment[][], values?: unknown[]): {
|
|
5
|
-
maps: Segment[][];
|
|
6
|
-
values: unknown[];
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=object.d.ts.map
|
package/dist/src/object.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/object.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErC,wBAAgB,GAAG,CACjB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC,EACnD,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,EAC7B,KAAK,EAAE,OAAO,GACb,OAAO,CAcT;AAED,wBAAgB,GAAG,CACjB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC,EACnD,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,GAC5B,OAAO,CA0BT;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,EAClC,OAAO,EAAE,OAAO,EAChB,QAAQ,GAAE,OAAO,EAAO,EACxB,IAAI,GAAE,OAAO,EAAE,EAAO,EACtB,MAAM,GAAE,OAAO,EAAO,GACrB;IAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,CAiB1C"}
|
package/dist/src/value.d.ts
DELETED
package/dist/src/value.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../src/value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhD,wBAAgB,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,GACpD,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAM5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/global.d.ts","../../../node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@types+prop-types@15.7.13/node_modules/@types/prop-types/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/jsx-runtime.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/typeAliases.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/util.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/ZodError.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/locales/en.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/errors.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/parseUtil.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/enumUtil.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/errorUtil.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/helpers/partialUtil.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/types.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/external.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.d.ts","../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/index.d.ts","../src/error.ts","../src/json.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/getType.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPlainObject.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isAnyObject.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isArray.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isBlob.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isBoolean.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isDate.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isEmptyArray.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isEmptyObject.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isEmptyString.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isError.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isFile.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isFullArray.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isFullObject.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isFullString.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isFunction.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isType.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isInstanceOf.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isMap.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isNaNValue.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isNegativeNumber.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isNull.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isNullOrUndefined.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isNumber.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isObject.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isObjectLike.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isOneOf.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPositiveNumber.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPrimitive.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPromise.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isRegExp.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isSet.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isString.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isSymbol.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isUndefined.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isWeakMap.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isWeakSet.d.ts","../../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/index.d.ts","../src/object.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/primitive.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/typed-array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/basic.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/observable-like.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/keys-of-union.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/distributed-omit.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/distributed-pick.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/empty-object.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/if-empty-object.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/required-keys-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/has-required-keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-equal.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/except.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/require-at-least-one.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/non-empty-object.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/unknown-record.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/unknown-array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/tagged-union.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/simplify.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/writable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/characters.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-any.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-float.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-integer.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/numeric.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-never.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-literal.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/trim.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/and.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/or.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/greater-than.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/greater-than-or-equal.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/less-than.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/tuple.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/string.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/numeric.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/object.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/internal/index.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/writable-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/omit-index-signature.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/pick-index-signature.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/merge.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/conditional-simplify.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/non-empty-tuple.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/array-tail.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/enforce-optional.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/simplify-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/merge-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/merge-exclusive.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/require-exactly-one.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/require-all-or-none.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/require-one-or-none.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/single-key-object.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/partial-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/required-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/sum.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/subtract.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/paths.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/union-to-intersection.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/pick-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/array-splice.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/literal-union.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/shared-union-fields-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/omit-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-null.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/is-unknown.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/if-unknown.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/partial-on-undefined-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/undefined-on-partial-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/readonly-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/promisable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/arrayable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/tagged.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/invariant-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-optional.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-readonly.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-required.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-non-nullable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/value-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/async-return-type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/if-never.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/conditional-keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/conditional-except.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/conditional-pick.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/conditional-pick-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/stringified.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/join.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/less-than-or-equal.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/array-slice.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/string-slice.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/fixed-length-array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/multidimensional-array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/multidimensional-readonly-array.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/iterable-element.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/entry.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/entries.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-return-type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-parameter-type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/asyncify.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/jsonify.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/jsonifiable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/find-global-type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/structured-cloneable.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/schema.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/literal-to-primitive.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/literal-to-primitive-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/string-key-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/exact.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/readonly-tuple.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/optional-keys-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/override-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/has-optional-keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/readonly-keys-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/has-readonly-keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/writable-keys-of.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/has-writable-keys.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/spread.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/tuple-to-union.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/union-to-tuple.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/int-range.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/if-any.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/array-indices.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/array-values.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/set-field-type.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/if-null.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/split-words.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/camel-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/camel-cased-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/camel-cased-properties-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/delimiter-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/kebab-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/delimiter-cased-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/kebab-cased-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/delimiter-cased-properties-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/kebab-cased-properties-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/pascal-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/pascal-cased-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/pascal-cased-properties-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/snake-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/snake-cased-properties.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/snake-cased-properties-deep.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/includes.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/screaming-snake-case.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/split.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/replace.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/string-repeat.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/get.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/last-array-element.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/global-this.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/package-json.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/source/tsconfig-json.d.ts","../../../node_modules/.pnpm/type-fest@4.26.1/node_modules/type-fest/index.d.ts","../src/value.ts","../../../node_modules/.pnpm/radash@12.1.0/node_modules/radash/dist/index.d.ts","../src/index.ts"],"fileIdsList":[[58,59,60],[61],[78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],[79],[94],[93],[117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,139,140,141,142,143,144,145,146,147,148,149,150,158,159,160,161,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270],[128],[128,142,146,148,149,157,175,180,207],[133,149,157,176],[157],[216],[245],[133,157,246],[246],[129,201],[200],[124,128,132,157,162,202],[201],[133,157,249],[249],[121],[135],[214],[117,121,128,157,185],[157,177,181,226,263],[148],[128,142,146,147,157],[229],[232],[126],[234],[139],[124],[143],[184],[185],[157,176],[133],[137,138,151,152,153,154,155,156],[139,144,152],[133,143,152],[133,135,152,153,155],[138,142,145,151],[133,142,148,150],[117,143],[142],[140,142,157],[117,142,143,157],[119],[118,119,124,133,139,142,143,157,185],[253],[251],[149],[159,224],[117],[132,133,157,159,160,161,162,163,164,165,166],[135,159,160],[128,176],[127,130],[140,141],[128,133,143,157,166,177,180,181,182],[161],[119,181],[157,161,186],[246,255],[124,133,139,148,157,176],[133,135,143,157,177,178],[129],[157,169],[249,258,261],[129,135],[133,157,185],[133,143,157],[157,162],[125,157],[126,135],[142,176],[157,206,208],[118,221],[128,142,146,147,150,157,175],[128,142,146,147,157,176],[143,178],[74],[63,64,74],[65,66],[63,64,65,67,68,72],[64,65],[73],[65],[63,64,65,68,69,70,71],[62,75],[62,77,115,116,271,272,273],[62],[62,115],[62,271]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"36a2e4c9a67439aca5f91bb304611d5ae6e20d420503e96c230cf8fcdc948d94","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"ed6b820c54de95b2510bb673490d61c7f2187f532a339d8d04981645a918961f","impliedFormat":1},{"version":"aa17748c522bd586f8712b1a308ea23af59c309b2fd278f6d4f406647c72e659","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","impliedFormat":1},{"version":"c2869c4f2f79fd2d03278a68ce7c061a5a8f4aed59efb655e25fe502e3e471d5","impliedFormat":1},{"version":"b8fe42dbf4b0efba2eb4dbfb2b95a3712676717ff8469767dc439e75d0c1a3b6","impliedFormat":1},{"version":"8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","impliedFormat":1},{"version":"ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","impliedFormat":1},{"version":"83306c97a4643d78420f082547ea0d488a0d134c922c8e65fc0b4f08ef66d92b","impliedFormat":1},{"version":"f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","impliedFormat":1},{"version":"98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","impliedFormat":1},{"version":"c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","impliedFormat":1},{"version":"dccd26a5c85325a011aff40f401e0892bd0688d44132ba79e803c67e68fffea5","impliedFormat":1},{"version":"f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","impliedFormat":1},{"version":"b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","impliedFormat":1},{"version":"5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802","impliedFormat":1},{"version":"d36be3fd2de44df8fac9e9df23bc53cd2936d861f5f70f160dba9fe89fee7738","signature":"439c4c4937799c722de3202d121c21f3f3c9f1b20607e42cfced7febb37ec747"},{"version":"64e228db91ffec355c0306dc2479d3e4c2ccc50e6d7374261b6c8ba1ace12120","signature":"e213269ee33762ad5c4f92d54a432d2dfbbdec244467780f94db347ebdb4a586"},{"version":"326759f43d598534059e33143843fd283ea0a51fc6cb9f38a576ce49553da354","impliedFormat":99},{"version":"7746188a1c4f43056697c5d595e973194a8be1f00f4d995380030016fee36506","impliedFormat":99},{"version":"a5861f39257a80b10f51f4d8ead817fbd5833a34c512f67281ceac909c10b3e2","impliedFormat":99},{"version":"dd02334867777bd630729fa27e5809ce54a21b82a5861b8ea3a260d40074fa2b","impliedFormat":99},{"version":"02d7939ef02782a45b9aeee121730423e7f44febe444d3e300633f8e9311e205","impliedFormat":99},{"version":"4bb27a5391b68e96c06e8ef5d195aa5fb40a3bf2e3f9e91f754fe0a51027d911","impliedFormat":99},{"version":"d8eb3f146c46e44a581fffba04f6f11068fab9f2f46e610a873e8dc23989ad54","impliedFormat":99},{"version":"0ebf5c9504413f74e59f2df1113d6d4f825718da6f99a52bb84b17f8f1c61f6a","impliedFormat":99},{"version":"b88deb871154baba626b38f2748e9af6991d8dd593a812b9cc3667bbfb64257f","impliedFormat":99},{"version":"7246c9724cf82b0e10ae60fbfd22a21c4730f23da27bdd81b69d75f36edff61a","impliedFormat":99},{"version":"702285aae357b822697a9535bf53aa3b0861acf208c6724e05526965fb371a62","impliedFormat":99},{"version":"4d4aa283941fe2228d4a8a1abe1afd4b59266a90b43e64e6fbb7ce0a4aed66dc","impliedFormat":99},{"version":"1426d7d581b5325ca4c19dbf89b1d65a4cd1810bc45cc53e2bcd3deadca40fc1","impliedFormat":99},{"version":"7b887d8539d6c33c14089110b6756a4ea608e5ea5291b939bbda277be9b729cf","impliedFormat":99},{"version":"edf1438892c4812108868d916a16957ad4ea091f8a4001f7b44c7f4c764dc34e","impliedFormat":99},{"version":"db4922e7f9574af4c2875504da886905a46bbc3e95469209213c254a922ce3fa","impliedFormat":99},{"version":"8358544ecefdda8e12c2f5e822cb920bdd6b6914f9cf073cdb5f6e8d20a217fd","impliedFormat":99},{"version":"64c930312b8dc6e89f81f8508a39ed098438f3fc89d5fd6d388bb635c3af7c4a","impliedFormat":99},{"version":"04b2bf3e07d44b2ad08c641bffdcee23b4865a1b84011e7febdcd4669ddc2910","impliedFormat":99},{"version":"c5fd8ff68f0d6056a4b349724c3bd4e734495e23f981ecf657fc29e37e0733c2","impliedFormat":99},{"version":"3f6caddc36d360a7b51ab22209242449f56f18651aa25109f77cd038c355fad6","impliedFormat":99},{"version":"f40319db1be77b53942cfa1444c11705b5a99379137f564cb7cfe7ad4f20d454","impliedFormat":99},{"version":"9a619a01ad912542884775be55d5c215e52feafc1e3dcb677e5e6fe5ee383287","impliedFormat":99},{"version":"2fa734ac430fc8a87f4a7c1d2cfbf1e665de87c0280293fe1dfa1f0c2e2a2283","impliedFormat":99},{"version":"90681949fee71c852704b230feeb2348a4e98b9e77766ccb3cf0ef5085bdb14e","impliedFormat":99},{"version":"60a8d51fba41d2ed942c3ad9a009b5b88cb9825af332ac9f9ea0d65425b59648","impliedFormat":99},{"version":"8a514bd9f56b476c686bddddcf0ef7b96289cdd11ae7f2f110565fac31eacd35","impliedFormat":99},{"version":"1315261a5f18b5dac3e7f4c4f80be42145e6c7095e54fdeed7deecda33a0191b","impliedFormat":99},{"version":"09eefc2ac900a52f702288843df64a417f22e40157d85e4b4644774a104d5c9f","impliedFormat":99},{"version":"65c2f848f352ca86cb5e2d9304414dd6c12b530465321d85b9ef3b1f26b6ddad","impliedFormat":99},{"version":"35cf770ee6533a062b4abe3b5e17c1ebecc27e76dbe55362f96bdc817d837106","impliedFormat":99},{"version":"f2a1e48e4b248f505735903a5539d978313b0a2fefeb4076e679954f872a817c","impliedFormat":99},{"version":"7a0c98331e493fe568607e2d2c46fb771098041df4f3bf7e79b2c7eaed7f57e5","impliedFormat":99},{"version":"b120f11164b9755802b3be0e6b6dc1eef8f1d3826bb111bfcefa7e16f32c8a1a","impliedFormat":99},{"version":"5079e87f97deefb9e88a9d48cf354bd3549719247357b53ada2edd77e283d5d5","impliedFormat":99},{"version":"92070a19cc7884c0c177f35f6ee4732172e4f98682ce234f192c2bdf11b0cbb0","impliedFormat":99},{"version":"1725a89e1384a677449e70f0ad7a1f71e17a1dfa2dc13a21cc1eeb75dad9f649","impliedFormat":99},{"version":"44ff65a3d557226c5ebc0bd4d0d76419017e02f91c2e1099b8f179783bd7daaa","impliedFormat":99},{"version":"4c3c7d693fc1d26ba21c6d27fda4d1e30c1eb52559b9d1231acc2e8855f48df6","signature":"d37e62c0ec38796922a2158756e127fe8fddd618d07af4f9cc8397fa25ccb773"},{"version":"cd51ceafea7762ad639afb3ca5b68e1e4ffeaacaa402d7ef2cae17016e29e098","impliedFormat":1},{"version":"1b8357b3fef5be61b5de6d6a4805a534d68fe3e040c11f1944e27d4aec85936a","impliedFormat":1},{"version":"130ec22c8432ade59047e0225e552c62a47683d870d44785bee95594c8d65408","impliedFormat":1},{"version":"4f24c2781b21b6cd65eede543669327d68a8cf0c6d9cf106a1146b164a7c8ef9","affectsGlobalScope":true,"impliedFormat":1},{"version":"8c44636cd32c9f5279e967d56e67d7623341d90382871adf63eb9ba427a3f820","impliedFormat":1},{"version":"d9720d542df1d7feba0aa80ed11b4584854951f9064232e8d7a76e65dc676136","impliedFormat":1},{"version":"d0fb3d0c64beba3b9ab25916cc018150d78ccb4952fac755c53721d9d624ba0d","impliedFormat":1},{"version":"86b484bcf6344a27a9ee19dd5cef1a5afbbd96aeb07708cc6d8b43d7dfa8466c","impliedFormat":1},{"version":"ba93f0192c9c30d895bee1141dd0c307b75df16245deef7134ac0152294788cc","impliedFormat":1},{"version":"75a7db3b7ddf0ca49651629bb665e0294fda8d19ba04fddc8a14d32bb35eb248","impliedFormat":1},{"version":"eb31477c87de3309cbe4e9984fa74a052f31581edb89103f8590f01874b4e271","impliedFormat":1},{"version":"15ab3db8aa099e50e8e6edd5719b05dd8abf2c75f56dc3895432d92ec3f6cd6b","impliedFormat":1},{"version":"6ff14b0a89cb61cef9424434ee740f91b239c09272c02031db85d388b84b7442","impliedFormat":1},{"version":"865f3db83300a1303349cc49ed80943775a858e0596e7e5a052cc65ac03b10bb","impliedFormat":1},{"version":"28fa41063a242eafcf51e1a62013fccdd9fd5d6760ded6e3ff5ce10a13c2ab31","impliedFormat":1},{"version":"ada60ff3698e7fd0c7ed0e4d93286ee28aed87f648f6748e668a57308fde5a67","impliedFormat":1},{"version":"1a67ba5891772a62706335b59a50720d89905196c90719dad7cec9c81c2990e6","impliedFormat":1},{"version":"5d6f919e1966d45ea297c2478c1985d213e41e2f9a6789964cdb53669e3f7a6f","impliedFormat":1},{"version":"a8289d1d525cf4a3a2d5a8db6b8e14e19f43d122cc47f8fb6b894b0aa2e2bde6","impliedFormat":1},{"version":"d7735a9ccd17767352ab6e799d76735016209aadd5c038a2fc07a29e7b235f02","impliedFormat":1},{"version":"aa1e3e6955faa399dc86747f8a904185a80cefdc1df5c9b952be4a657b3c98e9","impliedFormat":1},{"version":"742be2239f1a967692c4562a16973a08a1177663f972cbb4e1ef2b21bc97c9cf","impliedFormat":1},{"version":"1cf99fe49768500d01d873870085c68caa2b311fd40c1b05e831de0306f5f257","impliedFormat":1},{"version":"bcf177e80d5a2c3499f587886b4a190391fc9ad4388f74ae6aa935a1c22cd623","impliedFormat":1},{"version":"521f9f4dd927972ed9867e3eb2f0dd6990151f9edbb608ce59911864a9a2712d","impliedFormat":1},{"version":"b2a793bde18962a2e1e0f9fa5dce43dd3e801331d36d3e96a7451727185fb16f","impliedFormat":1},{"version":"4e251317bb109337e4918e5d7bcda7ef2d88f106cac531dcea03f7eee1dd2240","impliedFormat":1},{"version":"c71b7d61c20bce394784daa24afcff1a0be74bac91195a61ee47b851851d18fe","impliedFormat":1},{"version":"8504003e88870caa5474ab8bd270f318d0985ba7ede4ee30fe37646768b5362a","impliedFormat":1},{"version":"65465a64d5ee2f989ad4cf8db05f875204a9178f36b07a1e4d3a09a39f762e2e","impliedFormat":1},{"version":"2878f694f7d3a13a88a5e511da7ac084491ca0ddde9539e5dad76737ead9a5a9","impliedFormat":1},{"version":"1c0c6bd0d9b697040f43723d5b1dd6bb9feb743459ff9f95fda9adb6c97c9b37","impliedFormat":1},{"version":"0915ce92bb54e905387b7907e98982620cb7143f7b44291974fb2e592602fe00","impliedFormat":1},{"version":"3cd6df04a43858a6d18402c87a22a68534425e1c8c2fc5bb53fead29af027fcc","impliedFormat":1},{"version":"3aeae89ee20d53e08727a4eb5b5055211a6389a54a9a0a10f800a97616b5cd1b","impliedFormat":1},{"version":"4733c832fb758f546a4246bc62f2e9d68880eb8abf0f08c6bec484decb774dc9","impliedFormat":1},{"version":"58d91c410f31f4dd6fa8d50ad10b4ae9a8d1789306e73a5fbe8abea6a593099b","impliedFormat":1},{"version":"7ca6bb19f016eadcff4eb8993a37ba89be7b42bdf0dbc630d0b0db34e5fc7df0","impliedFormat":1},{"version":"d8d5061cb4521772457a2a3f0fcec028669990daceea78068bc968620641cd25","impliedFormat":1},{"version":"1f0fa44d2aa1edf989a50670c4c92206ac32f1a5acf26a030466cff77583d1cf","impliedFormat":1},{"version":"1f129869a0ee2dcb7ea9a92d6bc8ddf2c2cdaf2d244eec18c3a78efeb5e05c83","impliedFormat":1},{"version":"843e98d09268e2b5b9e6ff60487cf68f4643a72c2e55f7c29b35d1091a4ee4e9","impliedFormat":1},{"version":"4502caaa3fff6c9766bfc145b1b586ef26d53e5f104271db046122b8eef57fd1","impliedFormat":1},{"version":"382f061a24f63ef8bfb1f7a748e1a2568ea62fb91ed1328901a6cf5ad129d61c","impliedFormat":1},{"version":"6927ceeb41bb451f47593de0180c8ff1be7403965d10dc9147ee8d5c91372fff","impliedFormat":1},{"version":"ef4c9ef3ec432ccbf6508f8aa12fbb8b7f4d535c8b484258a3888476de2c6c36","impliedFormat":1},{"version":"77ff2aeb024d9e1679c00705067159c1b98ccac8310987a0bdaf0e38a6ca7333","impliedFormat":1},{"version":"2f28371c56e5d70b77de202e27995373bc46dc07336abbed23c7d74d89910677","impliedFormat":1},{"version":"952c4a8d2338e19ef26c1c0758815b1de6c082a485f88368f5bece1e555f39d4","impliedFormat":1},{"version":"1d953cb875c69aeb1ec8c58298a5226241c6139123b1ff885cedf48ac57b435c","impliedFormat":1},{"version":"1a80e164acd9ee4f3e2a919f9a92bfcdb3412d1fe680b15d60e85eadbaa460f8","impliedFormat":1},{"version":"f981ffdbd651f67db134479a5352dac96648ca195f981284e79dc0a1dbc53fd5","impliedFormat":1},{"version":"a1c85a61ff2b66291676ab84ae03c1b1ff7139ffde1942173f6aee8dc4ee357b","impliedFormat":1},{"version":"ee1969bda02bd6c3172c259d33e9ea5456f1662a74e0acf9fa422bb38263f535","impliedFormat":1},{"version":"f1a5a12e04ad1471647484e7ff11e36eef7960f54740f2e60e17799d99d6f5ab","impliedFormat":1},{"version":"672c1ebc4fa15a1c9b4911f1c68de2bc889f4d166a68c5be8f1e61f94014e9d8","impliedFormat":1},{"version":"ed1b2a459aa469d032f0bd482f4550d0bcd38e9e013532907eb30157054a52d7","impliedFormat":1},{"version":"5a0d920468aa4e792285943cadad77bcb312ba2acf1c665e364ada1b1ee56264","impliedFormat":1},{"version":"de54198142e582c1e26baa21c72321bcdde2a7c38b34cf18e246c7ff95bafd18","impliedFormat":1},{"version":"eccffdb59d6d42e3e773756e8bbe1fa8c23f261ef0cef052f3a8c0194dc6a0e0","impliedFormat":1},{"version":"2d98be5066df3ec9f217b93ef40abab987ec3b55b8f8756a43a081362a356e61","impliedFormat":1},{"version":"928f96b9948742cbaec33e1c34c406c127c2dad5906edb7df08e92b963500a41","impliedFormat":1},{"version":"a2e4333bf0c330ae26b90c68e395ad0a8af06121f1c977979c75c4a5f9f6bc29","impliedFormat":1},{"version":"f29768cdfdf7120ace7341b42cdcf1a215933b65da9b64784e9d5b8c7b0e1d3d","impliedFormat":1},{"version":"2cbf557a03f80df74106cb7cfb38386db82725b720b859e511bdead881171c32","impliedFormat":1},{"version":"e68a372f031a576af235bb036e9fa655c731039145e21f2e53cf9ec05987720a","impliedFormat":1},{"version":"5718274a266c16d3fbe9cd44c0e591ca981c374904137807e0ee7d601524deda","impliedFormat":1},{"version":"dd9694eecd70a405490ad23940ccd8979a628f1d26928090a4b05a943ac61714","impliedFormat":1},{"version":"42ca885a3c8ffdffcd9df252582aef9433438cf545a148e3a5e7568ca8575a56","impliedFormat":1},{"version":"309586820e31406ed70bb03ea8bca88b7ec15215e82d0aa85392da25d0b68630","impliedFormat":1},{"version":"98245fec2e886e8eb5398ce8f734bd0d0b05558c6633aefc09b48c4169596e4e","impliedFormat":1},{"version":"1410d60fe495685e97ed7ca6ff8ac6552b8c609ebe63bd97e51b7afe3c75b563","impliedFormat":1},{"version":"c6843fd4514c67ab4caf76efab7772ceb990fbb1a09085fbcf72b4437a307cf7","impliedFormat":1},{"version":"03ed68319c97cd4ce8f1c4ded110d9b40b8a283c3242b9fe934ccfa834e45572","impliedFormat":1},{"version":"3238e3ed704fe1ba3d523a8a5c8ffd8ca3250a8898cf75ac5e6b13d132a8d226","impliedFormat":1},{"version":"7d8f40a7c4cc81db66ac8eaf88f192996c8a5542c192fdebb7a7f2498c18427d","impliedFormat":1},{"version":"c69ecf92a8a9fb3e4019e6c520260e4074dc6cb0044a71909807b8e7cc05bb65","impliedFormat":1},{"version":"b0cefbc19466a38f5883079f0845babcb856637f7d4f3f594b746d39b74390f7","impliedFormat":1},{"version":"16219e7997bfc39ed9e0bb5f068646c0cdc15de5658d1263e2b44adf0a94ebef","impliedFormat":1},{"version":"4ccedab1527b8bf338730810280cce9f7caf450f1e9e2a6cbabaa880d80d4cf9","impliedFormat":1},{"version":"1f0ee5ddb64540632c6f9a5b63e242b06e49dd6472f3f5bd7dfeb96d12543e15","impliedFormat":1},{"version":"18b86125c67d99150f54225df07349ddd07acde086b55f3eeac1c34c81e424d8","impliedFormat":1},{"version":"2d3f23c577a913d0f396184f31998507e18c8712bc74303a433cf47f94fd7e07","impliedFormat":1},{"version":"0f2c77683296ca2d0e0bee84f8aa944a05df23bc4c5b5fef31dda757e75f660f","impliedFormat":1},{"version":"b848b40bfeb73dfe2e782c5b7588ef521010a3d595297e69386670cbde6b4d82","impliedFormat":1},{"version":"aa79b64f5b3690c66892f292e63dfe3e84eb678a886df86521f67c109d57a0c5","impliedFormat":1},{"version":"a692e092c3b9860c9554698d84baf308ba51fc8f32ddd6646e01a287810b16c6","impliedFormat":1},{"version":"64df9b13259fe3e3fea8ed9cdce950b7a0d40859d706c010eeea8c8d353d53fd","impliedFormat":1},{"version":"1848ebe5252ccb5ca1ca4ff52114516bdbbc7512589d6d0839beeea768bfb400","impliedFormat":1},{"version":"d2e3a1de4fde9291f9fb3b43672a8975a83e79896466f1af0f50066f78dbf39e","impliedFormat":1},{"version":"e37650b39727a6cf036c45a2b6df055e9c69a0afdd6dbab833ab957eb7f1a389","impliedFormat":1},{"version":"84f47c1a2ccfe41176fb5eb37e29fe7f44dbf7b9234d84811b637853b8da705f","impliedFormat":1},{"version":"dd8ded51112dedf953e09e211e423bcc9c8a3943b4b42d0c66c89466e55635a6","impliedFormat":1},{"version":"31073e7d0e51f33b1456ff2ab7f06546c95e24e11c29d5b39a634bc51f86d914","impliedFormat":1},{"version":"9ce0473b0fbaf7287afb01b6a91bd38f73a31093e59ee86de1fd3f352f3fc817","impliedFormat":1},{"version":"6f0d708924c3c4ee64b0fef8f10ad2b4cb87aa70b015eb758848c1ea02db0ed7","impliedFormat":1},{"version":"6addbb18f70100a2de900bace1c800b8d760421cdd33c1d69ee290b71e28003d","impliedFormat":1},{"version":"37569cc8f21262ca62ec9d3aa8eb5740f96e1f325fad3d6aa00a19403bd27b96","impliedFormat":1},{"version":"fa18c6fe108031717db1ada404c14dc75b8b38c54daa3bb3af4c4999861ca653","impliedFormat":1},{"version":"14be139e0f6d380a3d24aaf9b67972add107bea35cf7f2b1b1febac6553c3ede","impliedFormat":1},{"version":"23195b09849686462875673042a12b7f4cd34b4e27d38e40ca9c408dae8e6656","impliedFormat":1},{"version":"ff1731974600a4dad7ec87770e95fc86ca3d329b1ce200032766340f83585e47","impliedFormat":1},{"version":"91bc53a57079cf32e1a10ccf1a1e4a068e9820aa2fc6abc9af6bd6a52f590ffb","impliedFormat":1},{"version":"8dd284442b56814717e70f11ca22f4ea5b35feeca680f475bfcf8f65ba4ba296","impliedFormat":1},{"version":"a304e0af52f81bd7e6491e890fd480f3dc2cb0541dec3c7bd440dba9fea5c34e","impliedFormat":1},{"version":"c60fd0d7a1ba07631dfae8b757be0bffd5ef329e563f9a213e4a5402351c679f","impliedFormat":1},{"version":"a5ca6512e1e0f4aafbbdbc829a3bb5654529aaf299ab760c351e6e6b406548fb","impliedFormat":1},{"version":"e79e530a8216ee171b4aca8fc7b99bd37f5e84555cba57dc3de4cd57580ff21a","impliedFormat":1},{"version":"ceb2c0bc630cca2d0fdd48b0f48915d1e768785efaabf50e31c8399926fee5b1","impliedFormat":1},{"version":"f351eaa598ba2046e3078e5480a7533be7051e4db9212bb40f4eeb84279aa24d","impliedFormat":1},{"version":"12aeda564ee3f1d96ac759553d6749534fafeb2e5142ea2867f22ed39f9d3260","impliedFormat":1},{"version":"4ce53edb8fb1d2f8b2f6814084b773cdf5846f49bf5a426fbe4029327bda95bf","impliedFormat":1},{"version":"1edc9192dfc277c60b92525cdfa1980e1bfd161ae77286c96777d10db36be73c","impliedFormat":1},{"version":"85d63aaff358e8390b666a6bc68d3f56985f18764ab05f750cb67910f7bccb1a","impliedFormat":1},{"version":"0a0bf0cb43af5e0ac1703b48325ebc18ad86f6bf796bdbe96a429c0e95ca4486","impliedFormat":1},{"version":"22fcfd509683e3edfaf0150c255f6afdf437fec04f033f56b43d66fe392e2ad3","impliedFormat":1},{"version":"f08d2151bd91cdaa152532d51af04e29201cfc5d1ea40f8f7cfca0eb4f0b7cf3","impliedFormat":1},{"version":"3d5d9aa6266ea07199ce0a1e1f9268a56579526fad4b511949ddb9f974644202","impliedFormat":1},{"version":"b9c889d8a4595d02ebb3d3a72a335900b2fe9e5b5c54965da404379002b4ac44","impliedFormat":1},{"version":"a3cd30ebae3d0217b6b3204245719fc2c2f29d03b626905cac7127e1fb70e79c","impliedFormat":1},{"version":"1502a23e43fd7e9976a83195dc4eaf54acaff044687e0988a3bd4f19fc26b02b","impliedFormat":1},{"version":"c6e23745504b016ed3ffbe637d69bcc2145d598ecd8bafa4892cafbac09d5fcf","impliedFormat":1},{"version":"2132bf9bdbf54ebcae1ec755ec780a6db1825c306bd6f3e0339d5c1da490f070","impliedFormat":1},{"version":"d9c6f10eebf03d123396d4fee1efbe88bc967a47655ec040ffe7e94271a34fc7","impliedFormat":1},{"version":"380b4fe5dac74984ac6a58a116f7726bede1bdca7cec5362034c0b12971ac9c1","impliedFormat":1},{"version":"00de72aa7abede86b016f0b3bfbf767a08b5cff060991b0722d78b594a4c2105","impliedFormat":1},{"version":"710e09a2711b011cc9681d237da0c1c450d12551b0d21c764826822e548b5464","impliedFormat":1},{"version":"4f5bbef956920cfd90f2cbffccb3c34f8dfc64faaba368d9d41a46925511b6b0","impliedFormat":1},{"version":"11e4e2be18385fa1b4ffa0244c6c626f767058f445bbc66f1c7155cc8e1ec5b4","impliedFormat":1},{"version":"f47280c45ddbc8aa4909396e1d8b526f64dfad4a845aec2356a6c1dc7b6fe722","impliedFormat":1},{"version":"7b7f39411329342a28ea19a4ca3aa4c7f7d888c9f01a411b05e4126280026ea6","impliedFormat":1},{"version":"ba3ef8ea20ac0186dc0d58c1e96ffaf84327d09c377fd82f0ae99236e3430c3a","impliedFormat":1},{"version":"d66e97aa992c0fe797878bcad6257562829582f5f3a2842df71e613e60f7b778","impliedFormat":1},{"version":"a86492d82baf906c071536e8de073e601eaa5deed138c2d9c42d471d72395d7e","impliedFormat":1},{"version":"789110b95e963c99ace4e9ad8b60901201ddc4cab59f32bde5458c1359a4d887","impliedFormat":1},{"version":"92eb8a98444729aa61be5e6e489602363d763da27d1bcfdf89356c1d360484da","impliedFormat":1},{"version":"72bbfa838556113625a605be08f9fed6a4aed73ba03ab787badb317ab6f3bcd7","impliedFormat":1},{"version":"d729b8b400507b9b51ff40d11e012379dbf0acd6e2f66bf596a3bc59444d9bf1","impliedFormat":1},{"version":"32ac4394bb4b0348d46211f2575f22ab762babb399aca1e34cf77998cdef73b2","impliedFormat":1},{"version":"665c7850d78c30326b541d50c4dfad08cea616a7f58df6bb9c4872dd36778ad0","impliedFormat":1},{"version":"1567c6dcf728b0c1044606f830aafd404c00590af56d375399edef82e9ddce92","impliedFormat":1},{"version":"c00b402135ef36fb09d59519e34d03445fd6541c09e68b189abb64151f211b12","impliedFormat":1},{"version":"e08e58ac493a27b29ceee80da90bb31ec64341b520907d480df6244cdbec01f8","impliedFormat":1},{"version":"c0fe2b1135ca803efa203408c953e1e12645b8065e1a4c1336ad8bb11ea1101b","impliedFormat":1},{"version":"d82c245bfb76da44dd573948eca299ff75759b9714f8410468d2d055145a4b64","impliedFormat":1},{"version":"25b1108faedaf2043a97a76218240b1b537459bbca5ae9e2207c236c40dcfdef","impliedFormat":1},{"version":"5a4d0b09de173c391d5d50064fc20166becc194248b1ce738e8a56af5196d28c","impliedFormat":1},{"version":"0e0b8353d6d7f7cc3344adbabf3866e64f2f2813b23477254ba51f69e8fdf0eb","impliedFormat":1},{"version":"fc9ed6f3665b53b9b258ae7eda6394d8387e17fab6d85f48f4603d19633b006b","impliedFormat":1},{"version":"40fbe20b66b8bb3589bf9851283daa52d7aecc3bcae762b2859c1a7093895d61","impliedFormat":1},{"version":"db08c1807e3ae065930d88a3449d926273816d019e6c2a534e82da14e796686d","impliedFormat":1},{"version":"9e5c7463fc0259a38938c9afbdeda92e802cff87560277fd3e385ad24663f214","impliedFormat":1},{"version":"ef83477cca76be1c2d0539408c32b0a2118abcd25c9004f197421155a4649c37","impliedFormat":1},{"version":"b6bf369deed4ac7d681a20efee316018fbfdd044e9d3cd4ec79fdf5821688035","impliedFormat":1},{"version":"d38d37382c93f620216ed2e44e6757d395c141251f244d22aa0983542ec699af","impliedFormat":1},{"version":"feabd23117c8d36380f643781b92ca1732a3f27abccd2d1fd680c74e35b6a825","signature":"4a25cc74ceeb7e4859fcd9932feebde34e754c39feabcd50fc1d01eb0dc8aeb0"},{"version":"f8a5c1977aeae947b54ddbba133a4f330bdac31b893fb64543117db9e8a92f39","impliedFormat":1},{"version":"7990829c26a6d9c2603101953c4f5c7824bf5a752a1730f8b93f7039914378c1","signature":"2a0394e7174ae2bb21fdaacc4b5c9d2ec482cecc32754277db4f59012afcc05d"}],"root":[76,77,116,272,274],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":4,"module":7,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"noUncheckedSideEffectImports":true,"outDir":"./","skipLibCheck":true,"strict":true,"target":9,"useDefineForClassFields":true},"referencedMap":[[61,1],[62,2],[115,3],[80,4],[91,4],[95,5],[102,4],[103,4],[94,6],[271,7],[146,8],[208,9],[180,10],[164,11],[218,12],[246,13],[248,14],[247,15],[202,16],[201,17],[204,18],[203,19],[249,11],[253,20],[251,21],[122,22],[123,22],[165,23],[215,24],[227,25],[129,8],[266,26],[149,27],[148,28],[231,29],[233,30],[127,31],[235,32],[240,33],[125,34],[200,35],[244,36],[186,37],[261,8],[239,38],[137,39],[157,40],[153,41],[154,42],[156,43],[152,44],[151,45],[155,46],[140,47],[141,48],[144,49],[185,36],[220,50],[219,51],[250,21],[254,52],[252,53],[207,27],[150,54],[225,55],[181,56],[167,57],[161,58],[211,59],[212,59],[131,60],[142,61],[183,62],[147,8],[230,63],[269,64],[173,11],[187,65],[255,15],[257,66],[256,66],[177,67],[179,68],[189,11],[232,8],[170,11],[130,69],[171,70],[174,11],[262,71],[243,72],[194,72],[217,73],[195,72],[196,72],[216,37],[182,74],[166,75],[172,76],[258,21],[260,52],[259,53],[245,11],[236,77],[265,78],[209,79],[222,80],[176,81],[175,82],[145,11],[188,11],[238,83],[158,11],[234,8],[136,72],[75,84],[65,85],[67,86],[73,87],[68,88],[71,84],[74,89],[66,90],[72,91],[76,92],[274,93],[77,94],[116,95],[272,96]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274],"latestChangedDtsFile":"./src/index.d.ts","checkPending":true,"version":"5.7.2"}
|
package/src/error.test.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import { ORPCError } from './error'
|
|
3
|
-
|
|
4
|
-
it('issues', () => {
|
|
5
|
-
const zodError = z.object({ a: z.string() }).safeParse({ a: 1 }).error
|
|
6
|
-
|
|
7
|
-
expect(
|
|
8
|
-
new ORPCError({
|
|
9
|
-
code: 'BAD_REQUEST',
|
|
10
|
-
message: 'test',
|
|
11
|
-
cause: zodError,
|
|
12
|
-
}).issues,
|
|
13
|
-
).toBe(zodError?.issues)
|
|
14
|
-
|
|
15
|
-
expect(
|
|
16
|
-
new ORPCError({
|
|
17
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
18
|
-
message: 'test',
|
|
19
|
-
cause: zodError,
|
|
20
|
-
}).issues,
|
|
21
|
-
).toBe(undefined)
|
|
22
|
-
})
|
package/src/error.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { ZodError, type ZodIssue } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const ORPC_ERROR_CODE_STATUSES = {
|
|
4
|
-
BAD_REQUEST: 400,
|
|
5
|
-
UNAUTHORIZED: 401,
|
|
6
|
-
FORBIDDEN: 403,
|
|
7
|
-
NOT_FOUND: 404,
|
|
8
|
-
METHOD_NOT_SUPPORTED: 405,
|
|
9
|
-
NOT_ACCEPTABLE: 406,
|
|
10
|
-
TIMEOUT: 408,
|
|
11
|
-
CONFLICT: 409,
|
|
12
|
-
PRECONDITION_FAILED: 412,
|
|
13
|
-
PAYLOAD_TOO_LARGE: 413,
|
|
14
|
-
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
15
|
-
UNPROCESSABLE_CONTENT: 422,
|
|
16
|
-
TOO_MANY_REQUESTS: 429,
|
|
17
|
-
CLIENT_CLOSED_REQUEST: 499,
|
|
18
|
-
|
|
19
|
-
INTERNAL_SERVER_ERROR: 500,
|
|
20
|
-
NOT_IMPLEMENTED: 501,
|
|
21
|
-
BAD_GATEWAY: 502,
|
|
22
|
-
SERVICE_UNAVAILABLE: 503,
|
|
23
|
-
GATEWAY_TIMEOUT: 504,
|
|
24
|
-
} as const
|
|
25
|
-
|
|
26
|
-
export type ORPCErrorCode = keyof typeof ORPC_ERROR_CODE_STATUSES
|
|
27
|
-
|
|
28
|
-
export class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
|
|
29
|
-
constructor(
|
|
30
|
-
public zz$oe: {
|
|
31
|
-
code: TCode
|
|
32
|
-
status?: number
|
|
33
|
-
message?: string
|
|
34
|
-
cause?: unknown
|
|
35
|
-
} & (undefined extends TData ? { data?: TData } : { data: TData }),
|
|
36
|
-
) {
|
|
37
|
-
if (zz$oe.status && (zz$oe.status < 400 || zz$oe.status >= 600)) {
|
|
38
|
-
throw new Error('The ORPCError status code must be in the 400-599 range.')
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
super(zz$oe.message, { cause: zz$oe.cause })
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get code(): TCode {
|
|
45
|
-
return this.zz$oe.code
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get status(): number {
|
|
49
|
-
return this.zz$oe.status ?? ORPC_ERROR_CODE_STATUSES[this.code]
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get data(): TData {
|
|
53
|
-
return this.zz$oe.data as TData
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get issues(): ZodIssue[] | undefined {
|
|
57
|
-
if (this.code === 'BAD_REQUEST' && this.zz$oe.cause instanceof ZodError) {
|
|
58
|
-
return this.zz$oe.cause.issues
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return undefined
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
toJSON(): {
|
|
65
|
-
code: TCode
|
|
66
|
-
status: number
|
|
67
|
-
message: string
|
|
68
|
-
data: TData
|
|
69
|
-
issues?: ZodIssue[]
|
|
70
|
-
} {
|
|
71
|
-
return {
|
|
72
|
-
code: this.code,
|
|
73
|
-
status: this.status,
|
|
74
|
-
message: this.message,
|
|
75
|
-
data: this.data,
|
|
76
|
-
issues: this.issues,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static fromJSON(json: unknown): ORPCError<ORPCErrorCode, any> | undefined {
|
|
81
|
-
if (
|
|
82
|
-
typeof json !== 'object'
|
|
83
|
-
|| json === null
|
|
84
|
-
|| !('code' in json)
|
|
85
|
-
|| !Object.keys(ORPC_ERROR_CODE_STATUSES).find(key => json.code === key)
|
|
86
|
-
|| !('status' in json)
|
|
87
|
-
|| typeof json.status !== 'number'
|
|
88
|
-
|| ('message' in json
|
|
89
|
-
&& json.message !== undefined
|
|
90
|
-
&& typeof json.message !== 'string')
|
|
91
|
-
|| ('issues' in json
|
|
92
|
-
&& json.issues !== undefined
|
|
93
|
-
&& !Array.isArray(json.issues))
|
|
94
|
-
) {
|
|
95
|
-
return undefined
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return new ORPCError({
|
|
99
|
-
code: json.code as ORPCErrorCode,
|
|
100
|
-
status: json.status as number,
|
|
101
|
-
message: Reflect.get(json, 'message') as string,
|
|
102
|
-
data: Reflect.get(json, 'data') as any,
|
|
103
|
-
cause: 'issues' in json ? new ZodError(json.issues as any) : undefined,
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
}
|
package/src/index.ts
DELETED
package/src/json.ts
DELETED
package/src/object.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { isPlainObject } from 'is-what'
|
|
2
|
-
|
|
3
|
-
export type Segment = string | number
|
|
4
|
-
|
|
5
|
-
export function set(
|
|
6
|
-
root: Readonly<Record<string, unknown> | unknown[]>,
|
|
7
|
-
segments: Readonly<Segment[]>,
|
|
8
|
-
value: unknown,
|
|
9
|
-
): unknown {
|
|
10
|
-
const ref = { root }
|
|
11
|
-
|
|
12
|
-
let currentRef: any = ref
|
|
13
|
-
let preSegment: string | number = 'root'
|
|
14
|
-
|
|
15
|
-
for (const segment of segments) {
|
|
16
|
-
currentRef = currentRef[preSegment]
|
|
17
|
-
preSegment = segment
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
currentRef[preSegment] = value
|
|
21
|
-
|
|
22
|
-
return ref.root
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function get(
|
|
26
|
-
root: Readonly<Record<string, unknown> | unknown[]>,
|
|
27
|
-
segments: Readonly<Segment[]>,
|
|
28
|
-
): unknown {
|
|
29
|
-
const ref = { root }
|
|
30
|
-
|
|
31
|
-
let currentRef: any = ref
|
|
32
|
-
let preSegment: string | number = 'root'
|
|
33
|
-
|
|
34
|
-
for (const segment of segments) {
|
|
35
|
-
if (
|
|
36
|
-
(typeof currentRef !== 'object' && typeof currentRef !== 'function')
|
|
37
|
-
|| currentRef === null
|
|
38
|
-
) {
|
|
39
|
-
return undefined
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
currentRef = currentRef[preSegment]
|
|
43
|
-
preSegment = segment
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
(typeof currentRef !== 'object' && typeof currentRef !== 'function')
|
|
48
|
-
|| currentRef === null
|
|
49
|
-
) {
|
|
50
|
-
return undefined
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return currentRef[preSegment]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function findDeepMatches(
|
|
57
|
-
check: (value: unknown) => boolean,
|
|
58
|
-
payload: unknown,
|
|
59
|
-
segments: Segment[] = [],
|
|
60
|
-
maps: Segment[][] = [],
|
|
61
|
-
values: unknown[] = [],
|
|
62
|
-
): { maps: Segment[][], values: unknown[] } {
|
|
63
|
-
if (check(payload)) {
|
|
64
|
-
maps.push(segments)
|
|
65
|
-
values.push(payload)
|
|
66
|
-
}
|
|
67
|
-
else if (Array.isArray(payload)) {
|
|
68
|
-
payload.forEach((v, i) => {
|
|
69
|
-
findDeepMatches(check, v, [...segments, i], maps, values)
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
else if (isPlainObject(payload)) {
|
|
73
|
-
for (const key in payload) {
|
|
74
|
-
findDeepMatches(check, payload[key], [...segments, key], maps, values)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return { maps, values }
|
|
79
|
-
}
|
package/src/value.test-d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { value, type Value } from './value'
|
|
2
|
-
|
|
3
|
-
describe('value', () => {
|
|
4
|
-
it('types', () => {
|
|
5
|
-
let v: Value<number> = 42
|
|
6
|
-
|
|
7
|
-
v = async () => 42
|
|
8
|
-
v = () => 42
|
|
9
|
-
|
|
10
|
-
// @ts-expect-error - not a number
|
|
11
|
-
v = null
|
|
12
|
-
|
|
13
|
-
// @ts-expect-error - not a number
|
|
14
|
-
v = 'string'
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('function', () => {
|
|
18
|
-
expectTypeOf(value(Number(42))).toEqualTypeOf<Promise<number>>()
|
|
19
|
-
expectTypeOf(value(() => Number(42))).toEqualTypeOf<Promise<number>>()
|
|
20
|
-
expectTypeOf(value(async () => Number(42))).toEqualTypeOf<Promise<number>>()
|
|
21
|
-
})
|
|
22
|
-
})
|
package/src/value.test.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { value } from './value'
|
|
2
|
-
|
|
3
|
-
it('value', async () => {
|
|
4
|
-
expect(await value(42)).toBe(42)
|
|
5
|
-
expect(await value(() => 42)).toBe(42)
|
|
6
|
-
expect(await value(async () => 42)).toBe(42)
|
|
7
|
-
|
|
8
|
-
expect(await value(() => ({
|
|
9
|
-
then: (resolve: (value: number) => void) => resolve(42),
|
|
10
|
-
}))).toBe(42)
|
|
11
|
-
|
|
12
|
-
expect(await value(async () => ({
|
|
13
|
-
then: (resolve: (value: number) => void) => resolve(42),
|
|
14
|
-
}))).toBe(42)
|
|
15
|
-
|
|
16
|
-
expect(await value(() => ({ value: '42' }))).toEqual({ value: '42' })
|
|
17
|
-
})
|
package/src/value.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from 'type-fest'
|
|
2
|
-
|
|
3
|
-
export type Value<T> = T | (() => Promisable<T>)
|
|
4
|
-
|
|
5
|
-
export function value<T extends Value<any>>(value: T):
|
|
6
|
-
Promise<T extends Value<infer U> ? U : never> {
|
|
7
|
-
if (typeof value === 'function') {
|
|
8
|
-
return value()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return value as any
|
|
12
|
-
}
|