@bemoje/object 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +7 -355
  2. package/index.mjs +55 -221
  3. package/package.json +6 -3
package/index.d.ts CHANGED
@@ -1,324 +1,4 @@
1
- import * as _sinclair_typebox from '@sinclair/typebox';
2
- import { TSchema, TObject } from '@sinclair/typebox';
3
- import { Simplify, SetFieldType, Constructor } from 'type-fest';
4
-
5
- /**
6
- * A utility function to configure options based on a given schema or properties.
7
- * This function provides a builder pattern to define and validate options,
8
- * including handling default values, required keys, and optional keys.
9
- *
10
- * @template P - A record type representing the schema or properties.
11
- *
12
- * @param schemaOrProps - The schema or properties to configure options.
13
- * It can either be an object schema (`TObject<P>`) or a plain object (`P`).
14
- *
15
- * @returns A builder function that allows creating and validating options.
16
- * The builder function includes the following properties:
17
- * - `schemaProps`: The properties of the schema.
18
- * - `schema`: The full schema object.
19
- * - `defaults`: A map of default value functions for optional properties.
20
- * - `cast`: A utility function to cast a value to the options type.
21
- * - `create`: A function to create a new configurator instance.
22
- * - `build`: A recursive reference to the builder function itself.
23
- *
24
- * @example ````ts
25
- * const props = {
26
- * name: Type.String(),
27
- * age: Type.Integer(),
28
- * city: Type.String(),
29
- * state: Type.Optional(Type.String({ default: () => 'WA' })),
30
- * disabled: Type.Optional(Type.Boolean()),
31
- * }
32
- *
33
- * const configurator = OptionsConfigurator(props)
34
- *
35
- * const options = configurator((o) => {
36
- * return o
37
- * .name('Alice') //
38
- * .age(2)
39
- * .city('Seattle')
40
- * .done()
41
- * })
42
- *
43
- * console.log(options)
44
- * //=> { state: 'WA', name: 'Alice', age: 2, city: 'Seattle' }
45
- * ```
46
- */
47
- declare function OptionsConfigurator<P extends Record<string, TSchema>>(schemaOrProps: P | TObject<P>): {
48
- (callback: (builder: ReturnType<() => DataProp<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
49
- params: unknown[] & [];
50
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
51
- params: unknown[] & [];
52
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
53
- params: unknown[] & [];
54
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
55
- params: unknown[] & [];
56
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
57
- params: unknown[] & [];
58
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
59
- params: unknown[] & [];
60
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
61
- params: unknown[] & [];
62
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
63
- params: unknown[] & [];
64
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & AllAccessors<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
65
- params: unknown[] & [];
66
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
67
- params: unknown[] & [];
68
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
69
- params: unknown[] & [];
70
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
71
- params: unknown[] & [];
72
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
73
- params: unknown[] & [];
74
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
75
- params: unknown[] & [];
76
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
77
- params: unknown[] & [];
78
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
79
- params: unknown[] & [];
80
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & DoneMethod<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
81
- params: unknown[] & [];
82
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
83
- params: unknown[] & [];
84
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
85
- params: unknown[] & [];
86
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
87
- params: unknown[] & [];
88
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
89
- params: unknown[] & [];
90
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
91
- params: unknown[] & [];
92
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
93
- params: unknown[] & [];
94
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
95
- params: unknown[] & [];
96
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> extends infer T ? { [KeyType in keyof T]: (DataProp<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
97
- params: unknown[] & [];
98
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
99
- params: unknown[] & [];
100
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
101
- params: unknown[] & [];
102
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
103
- params: unknown[] & [];
104
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
105
- params: unknown[] & [];
106
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
107
- params: unknown[] & [];
108
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
109
- params: unknown[] & [];
110
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
111
- params: unknown[] & [];
112
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & AllAccessors<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
113
- params: unknown[] & [];
114
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
115
- params: unknown[] & [];
116
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
117
- params: unknown[] & [];
118
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
119
- params: unknown[] & [];
120
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
121
- params: unknown[] & [];
122
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
123
- params: unknown[] & [];
124
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
125
- params: unknown[] & [];
126
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
127
- params: unknown[] & [];
128
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & DoneMethod<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
129
- params: unknown[] & [];
130
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
131
- params: unknown[] & [];
132
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
133
- params: unknown[] & [];
134
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
135
- params: unknown[] & [];
136
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
137
- params: unknown[] & [];
138
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
139
- params: unknown[] & [];
140
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
141
- params: unknown[] & [];
142
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
143
- params: unknown[] & [];
144
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>>)[KeyType]; } : never>) => _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
145
- params: unknown[] & [];
146
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
147
- params: unknown[] & [];
148
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
149
- params: unknown[] & [];
150
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
151
- params: unknown[] & [];
152
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>): _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
153
- params: unknown[] & [];
154
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
155
- params: unknown[] & [];
156
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
157
- params: unknown[] & [];
158
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
159
- params: unknown[] & [];
160
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>;
161
- getSchemaProps(): P;
162
- getSchema(): TObject<P>;
163
- getDefaults(): Partial<Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
164
- params: unknown[] & [];
165
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
166
- params: unknown[] & [];
167
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
168
- params: unknown[] & [];
169
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
170
- params: unknown[] & [];
171
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, () => _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
172
- params: unknown[] & [];
173
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
174
- params: unknown[] & [];
175
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
176
- params: unknown[] & [];
177
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
178
- params: unknown[] & [];
179
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>[keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
180
- params: unknown[] & [];
181
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
182
- params: unknown[] & [];
183
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
184
- params: unknown[] & [];
185
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
186
- params: unknown[] & [];
187
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>]>>;
188
- cast(v?: unknown): _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
189
- params: unknown[] & [];
190
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
191
- params: unknown[] & [];
192
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
193
- params: unknown[] & [];
194
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
195
- params: unknown[] & [];
196
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>;
197
- getCreate(): () => DataProp<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
198
- params: unknown[] & [];
199
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
200
- params: unknown[] & [];
201
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
202
- params: unknown[] & [];
203
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
204
- params: unknown[] & [];
205
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
206
- params: unknown[] & [];
207
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
208
- params: unknown[] & [];
209
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
210
- params: unknown[] & [];
211
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
212
- params: unknown[] & [];
213
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & AllAccessors<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
214
- params: unknown[] & [];
215
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
216
- params: unknown[] & [];
217
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
218
- params: unknown[] & [];
219
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
220
- params: unknown[] & [];
221
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
222
- params: unknown[] & [];
223
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
224
- params: unknown[] & [];
225
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
226
- params: unknown[] & [];
227
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
228
- params: unknown[] & [];
229
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & DoneMethod<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
230
- params: unknown[] & [];
231
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
232
- params: unknown[] & [];
233
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
234
- params: unknown[] & [];
235
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
236
- params: unknown[] & [];
237
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
238
- params: unknown[] & [];
239
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
240
- params: unknown[] & [];
241
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
242
- params: unknown[] & [];
243
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
244
- params: unknown[] & [];
245
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> extends infer T ? { [KeyType in keyof T]: (DataProp<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
246
- params: unknown[] & [];
247
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
248
- params: unknown[] & [];
249
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
250
- params: unknown[] & [];
251
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
252
- params: unknown[] & [];
253
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
254
- params: unknown[] & [];
255
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
256
- params: unknown[] & [];
257
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
258
- params: unknown[] & [];
259
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
260
- params: unknown[] & [];
261
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & AllAccessors<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
262
- params: unknown[] & [];
263
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
264
- params: unknown[] & [];
265
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
266
- params: unknown[] & [];
267
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
268
- params: unknown[] & [];
269
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
270
- params: unknown[] & [];
271
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
272
- params: unknown[] & [];
273
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
274
- params: unknown[] & [];
275
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
276
- params: unknown[] & [];
277
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>> & DoneMethod<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
278
- params: unknown[] & [];
279
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
280
- params: unknown[] & [];
281
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
282
- params: unknown[] & [];
283
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
284
- params: unknown[] & [];
285
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, Record<keyof _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
286
- params: unknown[] & [];
287
- })["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
288
- params: unknown[] & [];
289
- })["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
290
- params: unknown[] & [];
291
- })["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
292
- params: unknown[] & [];
293
- })["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, undefined>>)[KeyType]; } : never;
294
- getBuild(): any;
295
- };
296
- /**
297
- * @example ```ts
298
- * type _T = TConfigurator<{ a: number; b?: number }>
299
- * const _t: _T = {} as _T
300
- * _t.a((1))
301
- * ```
302
- */
303
- type TConfigurator<T extends Record<string, any>, O extends Record<keyof T, any> = Record<keyof T, undefined>> = Simplify<DataProp<T, O> & AllAccessors<T, O> & DoneMethod<T, O>>;
304
- type AllAccessors<T extends Record<string, any>, //
305
- O extends Record<keyof T, any>> = {
306
- [K in keyof Required<T>]: (value: T[K]) => TConfigurator<Omit<T, K>, SetFieldType<O, K, T[K]>>;
307
- };
308
- type DoneMethod<T extends Record<string, any>, //
309
- O extends Record<keyof T, any>> = {
310
- /**
311
- * Applies defaults for missing values and then returns data.
312
- */
313
- done(): Simplify<Omit<T, keyof O> & O>;
314
- };
315
- type DataProp<T extends Record<string, any>, //
316
- O extends Record<keyof T, any>> = {
317
- /**
318
- * Returns data without applying defaults for missing values.
319
- */
320
- $data: Simplify<Omit<T, keyof O> & O>;
321
- };
1
+ import { Constructor } from 'type-fest';
322
2
 
323
3
  /**
324
4
  * Array assignment function that merges arrays excluding null and undefined values.
@@ -330,20 +10,6 @@ declare const arrAssign: <E extends unknown>(target: E[], ...sources: E[][]) =>
330
10
  */
331
11
  declare function className(target: object): string;
332
12
 
333
- /**
334
- * Get the class prototype object relating to an object or class.
335
- *
336
- * @remarks
337
- * It will never return a super class's prototype.
338
- *
339
- * Behaviours on different types of values:
340
- * - class constructor | function: the class's own prototype object is returned.
341
- * - class prototype object, the input is returned.
342
- * - class instance or primitives: The object's constructor's prototype is returned.
343
- * - null | undefined: TypeError
344
- */
345
- declare function classPrototype<T>(value: NonNullable<T>): typeof Object.prototype;
346
-
347
13
  /**
348
14
  * Returns the constructor of the given object.
349
15
  */
@@ -706,11 +372,6 @@ declare function objDefineLazyProperty<T extends Record<string, unknown>>(object
706
372
  */
707
373
  declare function objDelete<K extends PropertyKey, V>(obj: Record<K, V>, key: K): Omit<Record<K, V>, K>;
708
374
 
709
- /**
710
- * Applies a callback function to each key-value pair in an object.
711
- */
712
- declare function objForEach<T extends object>(obj: T, fn: (value: T[StringKeyOf<T>], key: StringKeyOf<T>) => void): T;
713
-
714
375
  /**
715
376
  * Retrieves the value associated with the specified key from an object.
716
377
  */
@@ -779,15 +440,6 @@ declare function objOmitKeysMutable<O extends Record<PropertyKey, Any>>(obj: O,
779
440
  */
780
441
  declare function objPropertyValueToGetter<V, T extends Record<PropertyKey, V>>(object: T, ...propertyNames: PropertyKey[]): T;
781
442
 
782
- /**
783
- * Reduces the values of an object into a single value.
784
- * @param object The object to reduce.
785
- * @param reducer The function that handles the reduction logic.
786
- * @param accum The initial value of the accumulator.
787
- * @param ownKeys A function that returns an iterable of own property (string) keys.
788
- */
789
- declare function objReduce<A, T extends Record<string, any>>(object: T, reducer: (accum: A, value: T[keyof T], key: string) => A, accum: A): A;
790
-
791
443
  /**
792
444
  * Sets a value for a key in an object and returns the value.
793
445
  */
@@ -837,12 +489,12 @@ declare function propertyIsEnumerable(o: object, key: PropertyKey): boolean;
837
489
  /**
838
490
  * Sets the enumerable property of the specified properties of an object to true.
839
491
  */
840
- declare function setEnumerable<T extends object>(object: T, ...keys: PropertyKey[]): void;
492
+ declare function setEnumerable<T extends object>(object: T, ...keys: string[]): T;
841
493
 
842
494
  /**
843
495
  * Sets the specified properties of an object as non-configurable.
844
496
  */
845
- declare function setNonConfigurable(object: Record<PropertyKey, any>, ...properties: string[]): void;
497
+ declare function setNonConfigurable<T extends object>(object: T, ...properties: string[]): T;
846
498
 
847
499
  /**
848
500
  * Sets the specified properties of an object as non-enumerable.
@@ -852,12 +504,12 @@ declare function setNonEnumerable<T extends object>(object: T, ...properties: st
852
504
  /**
853
505
  * Sets the specified properties of an object to be non-writable.
854
506
  */
855
- declare function setNonWritable(object: Record<PropertyKey, any>, ...properties: string[]): void;
507
+ declare function setNonWritable<T extends object>(object: T, ...properties: string[]): T;
856
508
 
857
509
  /**
858
- * Sets the specified properties of an object to be writable.
510
+ * Sets the specified properties of an object to be non-writable.
859
511
  */
860
- declare function setWritable(object: Record<PropertyKey, any>, ...properties: string[]): void;
512
+ declare function setWritable<T extends object>(object: T, ...properties: string[]): T;
861
513
 
862
514
  /**
863
515
  * Sort an object's keys.
@@ -888,4 +540,4 @@ type IgnoreKey = (typeof ignoreKeys)[number];
888
540
  */
889
541
  declare function valuesOf<T extends object>(obj: T): T[StringKeyOf<T>][];
890
542
 
891
- export { type AccessorDescriptor, type AccessorsDescriptorAttributes, type DescriptorAccessors, type DescriptorBothAccessors, type DescriptorGetter, type DescriptorSetter, type DescriptorValue, type GetKeysOptions, type IterateObjectYield, type KeysPrimitiveTypeFrom, OptionsConfigurator, type OptsKeyTypeVariants, type OptsKeysVariants, type StaticClassKeyof, type TypedValuePropertyDescriptor, type ValueDescriptor, type ValueDescriptorAttributes, arrAssign, className, classPrototype, constructorOf, createArrayMerger, createObjectMerger, defineAccessors, defineGetter, defineLazyProperty, defineMethod, defineProperty, defineSetter, defineValue, deleteNullishPropsMutable, entriesOf, filterObject, filterObjectMutable, getClassChain, getConfigurableMethodOrGetterKeys, getKeys, getKeysPreset, getOwnProperty, getPrototypeChain, getSuperClass, getSuperClasses, hasOwnProperty, hasProperty, hasPrototypeChainProperty, inheritPrototypeMembers, inheritStaticMembers, isAccessorDescriptor, isEnumerable, isMethodValueDescriptor, isValueDescriptor, iterableFirstElement, iterateObject, keysOf, mapObjectEntries, mapObjectKeys, objAssign, objDeepFreeze, objDefineLazyProperty, objDelete, objForEach, objGet, objGetOrDefault, objGetOrDefaultValue, objHas, objOmitKeysMutable, objPropertyValueToGetter, objReduce, objSet, objSize, objSortKeys, objToMap, objUpdate, objUpdatePropertyDescriptors, propertyIsEnumerable, setEnumerable, setNonConfigurable, setNonEnumerable, setNonWritable, setWritable, sortKeys, sortKeysLike, staticClassKeysOf, valuesOf };
543
+ export { type AccessorDescriptor, type AccessorsDescriptorAttributes, type DescriptorAccessors, type DescriptorBothAccessors, type DescriptorGetter, type DescriptorSetter, type DescriptorValue, type GetKeysOptions, type IterateObjectYield, type KeysPrimitiveTypeFrom, type OptsKeyTypeVariants, type OptsKeysVariants, type StaticClassKeyof, type TypedValuePropertyDescriptor, type ValueDescriptor, type ValueDescriptorAttributes, arrAssign, className, constructorOf, createArrayMerger, createObjectMerger, defineAccessors, defineGetter, defineLazyProperty, defineMethod, defineProperty, defineSetter, defineValue, deleteNullishPropsMutable, entriesOf, filterObject, filterObjectMutable, getClassChain, getConfigurableMethodOrGetterKeys, getKeys, getKeysPreset, getOwnProperty, getPrototypeChain, getSuperClass, getSuperClasses, hasOwnProperty, hasProperty, hasPrototypeChainProperty, inheritPrototypeMembers, inheritStaticMembers, isAccessorDescriptor, isEnumerable, isMethodValueDescriptor, isValueDescriptor, iterableFirstElement, iterateObject, keysOf, mapObjectEntries, mapObjectKeys, objAssign, objDeepFreeze, objDefineLazyProperty, objDelete, objGet, objGetOrDefault, objGetOrDefaultValue, objHas, objOmitKeysMutable, objPropertyValueToGetter, objSet, objSize, objSortKeys, objToMap, objUpdate, objUpdatePropertyDescriptors, propertyIsEnumerable, setEnumerable, setNonConfigurable, setNonEnumerable, setNonWritable, setWritable, sortKeys, sortKeysLike, staticClassKeysOf, valuesOf };
package/index.mjs CHANGED
@@ -1,127 +1,6 @@
1
- import { KindGuard, Type } from '@sinclair/typebox';
2
- import { isFunction } from 'es-toolkit/predicate';
3
-
4
1
  var __defProp = Object.defineProperty;
5
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
3
 
7
- // src/entriesOf.ts
8
- function entriesOf(obj) {
9
- return Object.entries(obj);
10
- }
11
- __name(entriesOf, "entriesOf");
12
-
13
- // src/keysOf.ts
14
- function keysOf(obj) {
15
- return Object.keys(obj);
16
- }
17
- __name(keysOf, "keysOf");
18
-
19
- // src/OptionsConfigurator.ts
20
- function OptionsConfigurator(schemaOrProps) {
21
- const props = KindGuard.IsObject(schemaOrProps) ? schemaOrProps.properties : schemaOrProps;
22
- const schema = KindGuard.IsObject(schemaOrProps) ? schemaOrProps : Type.Object(props);
23
- const defaults = entriesOf(props).reduce((acc, [key, prop]) => {
24
- if ("default" in prop) {
25
- Reflect.set(acc, key, typeof prop.default === "function" ? prop.default : () => {
26
- return prop.default;
27
- });
28
- }
29
- return acc;
30
- }, {});
31
- const requiredKeys = schema.required;
32
- const optionalKeys = Object.keys(props).filter((k) => {
33
- return !requiredKeys.includes(k);
34
- });
35
- const create = createConfigurator({
36
- defaults,
37
- requiredKeys,
38
- optionalKeys
39
- });
40
- const build = /* @__PURE__ */ __name((callback) => {
41
- const builder = create();
42
- const options = callback(builder);
43
- return options;
44
- }, "build");
45
- build.getSchemaProps = () => {
46
- return props;
47
- };
48
- build.getSchema = () => {
49
- return schema;
50
- };
51
- build.getDefaults = () => {
52
- return defaults;
53
- };
54
- build.cast = (v) => {
55
- return v;
56
- };
57
- build.getCreate = () => {
58
- return create;
59
- };
60
- build.getBuild = () => {
61
- return build;
62
- };
63
- return build;
64
- }
65
- __name(OptionsConfigurator, "OptionsConfigurator");
66
- function createConfigurator(options) {
67
- let CFG = class CFG {
68
- static {
69
- __name(this, "CFG");
70
- }
71
- $data;
72
- constructor($data) {
73
- this.$data = $data;
74
- }
75
- /**
76
- * Applies defaults for missing values and then returns data.
77
- */
78
- done() {
79
- this.applyDefaults();
80
- return this.$data;
81
- }
82
- /**
83
- * Set default values for missing keys.
84
- */
85
- applyDefaults() {
86
- entriesOf(options.defaults).forEach(([key, dfValue]) => {
87
- if (this.$data[key] === void 0) {
88
- const df = dfValue?.();
89
- if (df !== void 0) {
90
- this.$data[key] = df;
91
- }
92
- }
93
- });
94
- return this;
95
- }
96
- };
97
- const keys = /* @__PURE__ */ new Set([
98
- ...options.requiredKeys,
99
- ...keysOf(options.defaults),
100
- ...options.optionalKeys
101
- ]);
102
- for (const key of keys) {
103
- Object.defineProperty(CFG.prototype, key, {
104
- value: /* @__PURE__ */ __name(function(value) {
105
- if (value === void 0) {
106
- if (key in options.defaults) {
107
- this.$data[key] = options.defaults[key]();
108
- } else {
109
- delete this.$data[key];
110
- }
111
- } else {
112
- this.$data[key] = value;
113
- }
114
- return new CFG(this.$data);
115
- }, "value")
116
- });
117
- }
118
- return /* @__PURE__ */ __name(function configurator() {
119
- const ins = new CFG({});
120
- return ins;
121
- }, "configurator");
122
- }
123
- __name(createConfigurator, "createConfigurator");
124
-
125
4
  // src/createArrayMerger.ts
126
5
  function createArrayMerger(predicate) {
127
6
  return /* @__PURE__ */ __name(function arrMerge(target, ...sources) {
@@ -148,51 +27,6 @@ function className(target) {
148
27
  }
149
28
  __name(className, "className");
150
29
 
151
- // ../is/src/isConstructor.ts
152
- function isConstructor(value) {
153
- if (typeof value !== "function") {
154
- return false;
155
- }
156
- if (!value.prototype || value.prototype.constructor !== value) {
157
- return false;
158
- }
159
- return true;
160
- }
161
- __name(isConstructor, "isConstructor");
162
-
163
- // ../is/src/isPrototype.ts
164
- function isPrototype(value) {
165
- if (value === Function.prototype) {
166
- return true;
167
- }
168
- if (value == null) {
169
- return false;
170
- }
171
- if (typeof value !== "object") {
172
- return false;
173
- }
174
- if (!("constructor" in value)) {
175
- return false;
176
- }
177
- if (value.constructor?.prototype !== value) {
178
- return false;
179
- }
180
- return true;
181
- }
182
- __name(isPrototype, "isPrototype");
183
-
184
- // src/classPrototype.ts
185
- function classPrototype(value) {
186
- if (isFunction(value)) {
187
- return value.prototype;
188
- }
189
- if (isPrototype(value)) {
190
- return value;
191
- }
192
- return value.constructor.prototype;
193
- }
194
- __name(classPrototype, "classPrototype");
195
-
196
30
  // src/constructorOf.ts
197
31
  function constructorOf(o) {
198
32
  return Object.getPrototypeOf(o).constructor;
@@ -301,6 +135,18 @@ function deleteNullishPropsMutable(obj) {
301
135
  }
302
136
  __name(deleteNullishPropsMutable, "deleteNullishPropsMutable");
303
137
 
138
+ // src/entriesOf.ts
139
+ function entriesOf(obj) {
140
+ return Object.entries(obj);
141
+ }
142
+ __name(entriesOf, "entriesOf");
143
+
144
+ // src/keysOf.ts
145
+ function keysOf(obj) {
146
+ return Object.keys(obj);
147
+ }
148
+ __name(keysOf, "keysOf");
149
+
304
150
  // src/filterObject.ts
305
151
  function filterObject(obj, predicate) {
306
152
  const accum = {};
@@ -325,6 +171,18 @@ function filterObjectMutable(obj, predicate) {
325
171
  }
326
172
  __name(filterObjectMutable, "filterObjectMutable");
327
173
 
174
+ // ../is/src/isConstructor.ts
175
+ function isConstructor(value) {
176
+ if (typeof value !== "function") {
177
+ return false;
178
+ }
179
+ if (!value.prototype || value.prototype.constructor !== value) {
180
+ return false;
181
+ }
182
+ return true;
183
+ }
184
+ __name(isConstructor, "isConstructor");
185
+
328
186
  // src/getClassChain.ts
329
187
  function getClassChain(target, options) {
330
188
  const ctor = isConstructor(target) ? target : target.constructor;
@@ -522,14 +380,12 @@ function inheritPrototypeMembers(target, source, ignoreKeys2 = []) {
522
380
  "constructor"
523
381
  ]);
524
382
  for (const key of Reflect.ownKeys(source.prototype)) {
525
- if (ignore.has(key)) {
526
- continue;
527
- }
528
- if (Reflect.has(target.prototype, key)) {
529
- continue;
383
+ if (!ignore.has(key) && !Object.hasOwn(target.prototype, key)) {
384
+ const des = Object.getOwnPropertyDescriptor(source.prototype, key);
385
+ if (des) {
386
+ Object.defineProperty(target.prototype, key, des);
387
+ }
530
388
  }
531
- const des = Object.getOwnPropertyDescriptor(source.prototype, key);
532
- Object.defineProperty(target.prototype, key, des);
533
389
  }
534
390
  return target;
535
391
  }
@@ -543,14 +399,12 @@ function inheritStaticMembers(target, source, ignoreKeys2 = []) {
543
399
  "name"
544
400
  ]);
545
401
  for (const key of Reflect.ownKeys(source)) {
546
- if (ignore.has(key)) {
547
- continue;
548
- }
549
- if (Reflect.has(target, key)) {
550
- continue;
402
+ if (!ignore.has(key) && !Object.hasOwn(target, key)) {
403
+ const des = Object.getOwnPropertyDescriptor(source, key);
404
+ if (des) {
405
+ Object.defineProperty(target, key, des);
406
+ }
551
407
  }
552
- const des = Object.getOwnPropertyDescriptor(source, key);
553
- Object.defineProperty(target, key, des);
554
408
  }
555
409
  return target;
556
410
  }
@@ -736,15 +590,6 @@ function objDelete(obj, key) {
736
590
  }
737
591
  __name(objDelete, "objDelete");
738
592
 
739
- // src/objForEach.ts
740
- function objForEach(obj, fn) {
741
- for (const [key, value] of entriesOf(obj)) {
742
- fn(value, key);
743
- }
744
- return obj;
745
- }
746
- __name(objForEach, "objForEach");
747
-
748
593
  // src/objGet.ts
749
594
  function objGet(obj, key) {
750
595
  return obj[key];
@@ -805,21 +650,6 @@ function objPropertyValueToGetter(object, ...propertyNames) {
805
650
  }
806
651
  __name(objPropertyValueToGetter, "objPropertyValueToGetter");
807
652
 
808
- // ../iter/src/reduceIterableEntries.ts
809
- function reduceIterableEntries(mapLike, reducer, initialValue) {
810
- for (const [key, value] of mapLike) {
811
- initialValue = reducer(initialValue, value, key);
812
- }
813
- return initialValue;
814
- }
815
- __name(reduceIterableEntries, "reduceIterableEntries");
816
-
817
- // src/objReduce.ts
818
- function objReduce(object, reducer, accum) {
819
- return reduceIterableEntries(entriesOf(object), reducer, accum);
820
- }
821
- __name(objReduce, "objReduce");
822
-
823
653
  // src/objSet.ts
824
654
  function objSet(obj, key, value) {
825
655
  return obj[key] = value;
@@ -879,22 +709,22 @@ __name(propertyIsEnumerable, "propertyIsEnumerable");
879
709
  // src/setEnumerable.ts
880
710
  function setEnumerable(object, ...keys) {
881
711
  for (const key of keys) {
882
- if (!hasOwnProperty(object, key)) {
883
- continue;
884
- }
885
- defineProperty(object, key, {
712
+ Object.defineProperty(object, key, {
886
713
  enumerable: true
887
714
  });
888
715
  }
716
+ return object;
889
717
  }
890
718
  __name(setEnumerable, "setEnumerable");
891
719
 
892
720
  // src/setNonConfigurable.ts
893
721
  function setNonConfigurable(object, ...properties) {
894
- objUpdatePropertyDescriptors(object, properties, (descriptor) => {
895
- descriptor.configurable = false;
896
- return descriptor;
897
- });
722
+ for (const prop of properties) {
723
+ Object.defineProperty(object, prop, {
724
+ configurable: false
725
+ });
726
+ }
727
+ return object;
898
728
  }
899
729
  __name(setNonConfigurable, "setNonConfigurable");
900
730
 
@@ -911,19 +741,23 @@ __name(setNonEnumerable, "setNonEnumerable");
911
741
 
912
742
  // src/setNonWritable.ts
913
743
  function setNonWritable(object, ...properties) {
914
- objUpdatePropertyDescriptors(object, properties, (descriptor) => {
915
- descriptor.writable = false;
916
- return descriptor;
917
- });
744
+ for (const prop of properties) {
745
+ Object.defineProperty(object, prop, {
746
+ writable: false
747
+ });
748
+ }
749
+ return object;
918
750
  }
919
751
  __name(setNonWritable, "setNonWritable");
920
752
 
921
753
  // src/setWritable.ts
922
754
  function setWritable(object, ...properties) {
923
- objUpdatePropertyDescriptors(object, properties, (descriptor) => {
924
- descriptor.writable = true;
925
- return descriptor;
926
- });
755
+ for (const prop of properties) {
756
+ Object.defineProperty(object, prop, {
757
+ writable: true
758
+ });
759
+ }
760
+ return object;
927
761
  }
928
762
  __name(setWritable, "setWritable");
929
763
 
@@ -967,4 +801,4 @@ function valuesOf(obj) {
967
801
  }
968
802
  __name(valuesOf, "valuesOf");
969
803
 
970
- export { OptionsConfigurator, arrAssign, className, classPrototype, constructorOf, createArrayMerger, createObjectMerger, defineAccessors, defineGetter, defineLazyProperty, defineMethod, defineProperty, defineSetter, defineValue, deleteNullishPropsMutable, entriesOf, filterObject, filterObjectMutable, getClassChain, getConfigurableMethodOrGetterKeys, getKeys, getKeysPreset, getOwnProperty, getPrototypeChain, getSuperClass, getSuperClasses, hasOwnProperty, hasProperty, hasPrototypeChainProperty, inheritPrototypeMembers, inheritStaticMembers, isAccessorDescriptor, isEnumerable, isMethodValueDescriptor, isValueDescriptor, iterableFirstElement, iterateObject, keysOf, mapObjectEntries, mapObjectKeys, objAssign, objDeepFreeze, objDefineLazyProperty, objDelete, objForEach, objGet, objGetOrDefault, objGetOrDefaultValue, objHas, objOmitKeysMutable, objPropertyValueToGetter, objReduce, objSet, objSize, objSortKeys, objToMap, objUpdate, objUpdatePropertyDescriptors, propertyIsEnumerable, setEnumerable, setNonConfigurable, setNonEnumerable, setNonWritable, setWritable, sortKeys, sortKeysLike, staticClassKeysOf, valuesOf };
804
+ export { arrAssign, className, constructorOf, createArrayMerger, createObjectMerger, defineAccessors, defineGetter, defineLazyProperty, defineMethod, defineProperty, defineSetter, defineValue, deleteNullishPropsMutable, entriesOf, filterObject, filterObjectMutable, getClassChain, getConfigurableMethodOrGetterKeys, getKeys, getKeysPreset, getOwnProperty, getPrototypeChain, getSuperClass, getSuperClasses, hasOwnProperty, hasProperty, hasPrototypeChainProperty, inheritPrototypeMembers, inheritStaticMembers, isAccessorDescriptor, isEnumerable, isMethodValueDescriptor, isValueDescriptor, iterableFirstElement, iterateObject, keysOf, mapObjectEntries, mapObjectKeys, objAssign, objDeepFreeze, objDefineLazyProperty, objDelete, objGet, objGetOrDefault, objGetOrDefaultValue, objHas, objOmitKeysMutable, objPropertyValueToGetter, objSet, objSize, objSortKeys, objToMap, objUpdate, objUpdatePropertyDescriptors, propertyIsEnumerable, setEnumerable, setNonConfigurable, setNonEnumerable, setNonWritable, setWritable, sortKeys, sortKeysLike, staticClassKeysOf, valuesOf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bemoje/object",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "object",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -12,11 +12,14 @@
12
12
  "types": "./index.d.ts",
13
13
  "import": "./index.mjs",
14
14
  "default": "./index.mjs"
15
+ },
16
+ "./*": {
17
+ "types": "./index.d.ts",
18
+ "import": "./index.mjs",
19
+ "default": "./index.mjs"
15
20
  }
16
21
  },
17
22
  "dependencies": {
18
- "@sinclair/typebox": "^0.34.37",
19
- "es-toolkit": "^1.44.0",
20
23
  "type-fest": "^5.4.4"
21
24
  },
22
25
  "publishConfig": {