@bemoje/object 1.0.0 → 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.
- package/README.md +172 -0
- package/index.d.ts +9 -367
- package/index.mjs +58 -243
- package/package.json +6 -3
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @bemoje/object
|
|
2
|
+
|
|
3
|
+
Comprehensive object manipulation utilities for property definition, traversal, filtering, mapping, prototype
|
|
4
|
+
chains, and descriptor management.
|
|
5
|
+
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://nodejs.org/api/esm.html)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @bemoje/object
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Object Assignment
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { objAssign } from '@bemoje/object'
|
|
21
|
+
|
|
22
|
+
// Like Object.assign but skips null/undefined values
|
|
23
|
+
objAssign({ a: 1, b: 2 }, { b: null, c: 3 })
|
|
24
|
+
// { a: 1, b: 2, c: 3 }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Property Definition
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { defineGetter, defineSetter, defineMethod, defineValue, defineLazyProperty } from '@bemoje/object'
|
|
31
|
+
|
|
32
|
+
const obj = {}
|
|
33
|
+
|
|
34
|
+
defineGetter(obj, 'now', () => Date.now())
|
|
35
|
+
defineMethod(obj, 'greet', function () {
|
|
36
|
+
return 'hello'
|
|
37
|
+
})
|
|
38
|
+
defineValue(obj, 'version', '1.0.0')
|
|
39
|
+
|
|
40
|
+
// Lazy property: computed once on first access, then cached
|
|
41
|
+
defineLazyProperty(obj, 'config', () => loadExpensiveConfig())
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Filter and Map Objects
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { filterObject, mapObject, mapObjectKeys, mapObjectEntries } from '@bemoje/object'
|
|
48
|
+
|
|
49
|
+
const data = { a: 1, b: 2, c: 3 }
|
|
50
|
+
|
|
51
|
+
filterObject(data, (value) => value > 1)
|
|
52
|
+
// { b: 2, c: 3 }
|
|
53
|
+
|
|
54
|
+
mapObject(data, (value) => value * 10)
|
|
55
|
+
// { a: 10, b: 20, c: 30 }
|
|
56
|
+
|
|
57
|
+
mapObjectKeys(data, (key) => key.toUpperCase())
|
|
58
|
+
// { A: 1, B: 2, C: 3 }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Prototype Chain Inspection
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { getPrototypeChain, getClassChain, getSuperClasses } from '@bemoje/object'
|
|
65
|
+
|
|
66
|
+
class Animal {}
|
|
67
|
+
class Dog extends Animal {}
|
|
68
|
+
|
|
69
|
+
getPrototypeChain(new Dog()) // [Dog.prototype, Animal.prototype, Object.prototype, null]
|
|
70
|
+
getClassChain(Dog) // [Animal, Object]
|
|
71
|
+
getSuperClasses(Dog) // [Animal, Object]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Inheritance Utilities
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { inheritPrototypeMembers, inheritStaticMembers } from '@bemoje/object'
|
|
78
|
+
|
|
79
|
+
// Copy prototype methods from source to target class
|
|
80
|
+
inheritPrototypeMembers(TargetClass, SourceClass, ['excludeMethod'])
|
|
81
|
+
inheritStaticMembers(TargetClass, SourceClass)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Deep Operations
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { objDeepFreeze, iterateObject } from '@bemoje/object'
|
|
88
|
+
|
|
89
|
+
// Deep freeze an object
|
|
90
|
+
const frozen = objDeepFreeze({ nested: { deep: { value: 42 } } })
|
|
91
|
+
|
|
92
|
+
// Traverse all properties depth-first
|
|
93
|
+
for (const node of iterateObject({ a: { b: [1, 2] } })) {
|
|
94
|
+
console.log(node.propertyPath, node.value, node.isLeaf)
|
|
95
|
+
}
|
|
96
|
+
// 'a' { b: [1, 2] } false
|
|
97
|
+
// 'a.b' [1, 2] false
|
|
98
|
+
// 'a.b[0]' 1 true
|
|
99
|
+
// 'a.b[1]' 2 true
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Sort, Delete, Reduce
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { objSortKeys, objDelete, objReduce, objIsEmpty } from '@bemoje/object'
|
|
106
|
+
|
|
107
|
+
objSortKeys({ c: 3, a: 1, b: 2 }) // { a: 1, b: 2, c: 3 }
|
|
108
|
+
objDelete({ name: 'John', age: 30 }, 'age') // { name: 'John' }
|
|
109
|
+
objReduce({ a: 1, b: 2 }, (acc, val) => acc + val, 0) // 3
|
|
110
|
+
objIsEmpty({}) // true
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Typed Helpers
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { keysOf, valuesOf, entriesOf } from '@bemoje/object'
|
|
117
|
+
|
|
118
|
+
const obj = { name: 'Alice', age: 30 }
|
|
119
|
+
keysOf(obj) // ['name', 'age'] (typed as ('name' | 'age')[])
|
|
120
|
+
valuesOf(obj) // ['Alice', 30]
|
|
121
|
+
entriesOf(obj) // [['name', 'Alice'], ['age', 30]]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## API Reference
|
|
125
|
+
|
|
126
|
+
| Export | Description |
|
|
127
|
+
| --------------------------- | --------------------------------------------------------- |
|
|
128
|
+
| `objAssign` | Object.assign that skips null/undefined values |
|
|
129
|
+
| `objDeepFreeze` | Deep freeze an object recursively |
|
|
130
|
+
| `objSortKeys` | Sort object keys alphabetically or with custom comparator |
|
|
131
|
+
| `objDelete` | Delete a key and return the object |
|
|
132
|
+
| `objReduce` | Reduce over object entries |
|
|
133
|
+
| `objForEach` | Iterate over object entries |
|
|
134
|
+
| `objIsEmpty` | Check if object has no enumerable keys |
|
|
135
|
+
| `objSize` | Count enumerable keys |
|
|
136
|
+
| `objGet` | Type-safe property getter |
|
|
137
|
+
| `objSet` | Set a property and return the value |
|
|
138
|
+
| `objHas` | Check if key exists |
|
|
139
|
+
| `objUpdate` | Update a value with a callback |
|
|
140
|
+
| `objGetOrDefault` | Get or create value with factory function |
|
|
141
|
+
| `objGetOrDefaultValue` | Get or set a default value |
|
|
142
|
+
| `objToMap` | Convert object to Map |
|
|
143
|
+
| `objOmitKeysMutable` | Delete multiple keys from an object |
|
|
144
|
+
| `filterObject` | Filter object properties by predicate |
|
|
145
|
+
| `filterObjectMutable` | Filter object in-place |
|
|
146
|
+
| `mapObject` | Map over object values |
|
|
147
|
+
| `mapObjectKeys` | Map over object keys |
|
|
148
|
+
| `mapObjectEntries` | Map over object entries (both key and value) |
|
|
149
|
+
| `defineGetter` | Define a getter property |
|
|
150
|
+
| `defineSetter` | Define a setter property |
|
|
151
|
+
| `defineAccessors` | Define getter and setter |
|
|
152
|
+
| `defineMethod` | Define a method property |
|
|
153
|
+
| `defineValue` | Define a value property |
|
|
154
|
+
| `defineProperty` | Define a property with descriptor |
|
|
155
|
+
| `defineLazyProperty` | Define a lazy-evaluated cached property |
|
|
156
|
+
| `keysOf` | Typed Object.keys |
|
|
157
|
+
| `valuesOf` | Typed Object.values |
|
|
158
|
+
| `entriesOf` | Typed Object.entries |
|
|
159
|
+
| `getPrototypeChain` | Get prototype chain as array |
|
|
160
|
+
| `getClassChain` | Get class constructor chain |
|
|
161
|
+
| `getSuperClass` | Get immediate superclass |
|
|
162
|
+
| `getSuperClasses` | Get all superclasses |
|
|
163
|
+
| `inheritPrototypeMembers` | Copy prototype members between classes |
|
|
164
|
+
| `inheritStaticMembers` | Copy static members between classes |
|
|
165
|
+
| `iterateObject` | Depth-first object traversal generator |
|
|
166
|
+
| `deleteNullishPropsMutable` | Remove null/undefined properties |
|
|
167
|
+
| `className` | Get class name from an instance |
|
|
168
|
+
| `constructorOf` | Get constructor of an object |
|
|
169
|
+
| `hasOwnProperty` | Safe hasOwnProperty check |
|
|
170
|
+
| `hasProperty` | Check own + prototype chain |
|
|
171
|
+
| `getKeys` | Get keys with filtering options |
|
|
172
|
+
| `OptionsConfigurator` | Builder pattern for typed options with defaults |
|
package/index.d.ts
CHANGED
|
@@ -1,324 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
*/
|
|
@@ -658,20 +324,15 @@ declare function iterateObject<T extends object = object, V = unknown>(root: T):
|
|
|
658
324
|
*/
|
|
659
325
|
declare function keysOf<T extends object>(obj: T): StringKeyOf<T>[];
|
|
660
326
|
|
|
661
|
-
/**
|
|
662
|
-
* Maps over an object's values, transforming each value using the provided function.
|
|
663
|
-
*/
|
|
664
|
-
declare function mapObject<T extends object, V>(obj: T, fn: (value: T[StringKeyOf<T>], key: StringKeyOf<T>) => V): Record<StringKeyOf<T>, V>;
|
|
665
|
-
|
|
666
327
|
/**
|
|
667
328
|
* Maps over an object's entries, transforming both keys and values using the provided function.
|
|
668
329
|
*/
|
|
669
|
-
declare function mapObjectEntries<T extends object, K extends
|
|
330
|
+
declare function mapObjectEntries<T extends object, K extends PropertyKey, V>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => [K, V]): Record<K, V>;
|
|
670
331
|
|
|
671
332
|
/**
|
|
672
333
|
* Maps over an object's keys, transforming each key using the provided function while preserving values.
|
|
673
334
|
*/
|
|
674
|
-
declare function mapObjectKeys<T extends object, K extends
|
|
335
|
+
declare function mapObjectKeys<T extends object, K extends PropertyKey>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => K): Record<K, T[StringKeyOf<T>]>;
|
|
675
336
|
|
|
676
337
|
/**
|
|
677
338
|
* Like Object.assign, but only copies source object property values != null.
|
|
@@ -711,11 +372,6 @@ declare function objDefineLazyProperty<T extends Record<string, unknown>>(object
|
|
|
711
372
|
*/
|
|
712
373
|
declare function objDelete<K extends PropertyKey, V>(obj: Record<K, V>, key: K): Omit<Record<K, V>, K>;
|
|
713
374
|
|
|
714
|
-
/**
|
|
715
|
-
* Applies a callback function to each key-value pair in an object.
|
|
716
|
-
*/
|
|
717
|
-
declare function objForEach<T extends object>(obj: T, fn: (value: T[StringKeyOf<T>], key: StringKeyOf<T>) => void): T;
|
|
718
|
-
|
|
719
375
|
/**
|
|
720
376
|
* Retrieves the value associated with the specified key from an object.
|
|
721
377
|
*/
|
|
@@ -748,11 +404,6 @@ declare function objGetOrDefaultValue<T, K extends keyof T>(obj: T, key: K, defa
|
|
|
748
404
|
*/
|
|
749
405
|
declare function objHas<V>(obj: Record<PropertyKey, V>, key: PropertyKey): boolean;
|
|
750
406
|
|
|
751
|
-
/**
|
|
752
|
-
* Checks if an object is empty.
|
|
753
|
-
*/
|
|
754
|
-
declare function objIsEmpty<T>(obj: Record<string, T>): boolean;
|
|
755
|
-
|
|
756
407
|
/**
|
|
757
408
|
* Deletes the specified keys from an object in a mutable way.
|
|
758
409
|
* @param obj The object from which to delete the keys.
|
|
@@ -789,15 +440,6 @@ declare function objOmitKeysMutable<O extends Record<PropertyKey, Any>>(obj: O,
|
|
|
789
440
|
*/
|
|
790
441
|
declare function objPropertyValueToGetter<V, T extends Record<PropertyKey, V>>(object: T, ...propertyNames: PropertyKey[]): T;
|
|
791
442
|
|
|
792
|
-
/**
|
|
793
|
-
* Reduces the values of an object into a single value.
|
|
794
|
-
* @param object The object to reduce.
|
|
795
|
-
* @param reducer The function that handles the reduction logic.
|
|
796
|
-
* @param accum The initial value of the accumulator.
|
|
797
|
-
* @param ownKeys A function that returns an iterable of own property (string) keys.
|
|
798
|
-
*/
|
|
799
|
-
declare function objReduce<A, T extends Record<string, any>>(object: T, reducer: (accum: A, value: T[keyof T], key: string) => A, accum: A): A;
|
|
800
|
-
|
|
801
443
|
/**
|
|
802
444
|
* Sets a value for a key in an object and returns the value.
|
|
803
445
|
*/
|
|
@@ -847,12 +489,12 @@ declare function propertyIsEnumerable(o: object, key: PropertyKey): boolean;
|
|
|
847
489
|
/**
|
|
848
490
|
* Sets the enumerable property of the specified properties of an object to true.
|
|
849
491
|
*/
|
|
850
|
-
declare function setEnumerable<T extends object>(object: T, ...keys:
|
|
492
|
+
declare function setEnumerable<T extends object>(object: T, ...keys: string[]): T;
|
|
851
493
|
|
|
852
494
|
/**
|
|
853
495
|
* Sets the specified properties of an object as non-configurable.
|
|
854
496
|
*/
|
|
855
|
-
declare function setNonConfigurable(object:
|
|
497
|
+
declare function setNonConfigurable<T extends object>(object: T, ...properties: string[]): T;
|
|
856
498
|
|
|
857
499
|
/**
|
|
858
500
|
* Sets the specified properties of an object as non-enumerable.
|
|
@@ -862,12 +504,12 @@ declare function setNonEnumerable<T extends object>(object: T, ...properties: st
|
|
|
862
504
|
/**
|
|
863
505
|
* Sets the specified properties of an object to be non-writable.
|
|
864
506
|
*/
|
|
865
|
-
declare function setNonWritable(object:
|
|
507
|
+
declare function setNonWritable<T extends object>(object: T, ...properties: string[]): T;
|
|
866
508
|
|
|
867
509
|
/**
|
|
868
|
-
* Sets the specified properties of an object to be writable.
|
|
510
|
+
* Sets the specified properties of an object to be non-writable.
|
|
869
511
|
*/
|
|
870
|
-
declare function setWritable(object:
|
|
512
|
+
declare function setWritable<T extends object>(object: T, ...properties: string[]): T;
|
|
871
513
|
|
|
872
514
|
/**
|
|
873
515
|
* Sort an object's keys.
|
|
@@ -898,4 +540,4 @@ type IgnoreKey = (typeof ignoreKeys)[number];
|
|
|
898
540
|
*/
|
|
899
541
|
declare function valuesOf<T extends object>(obj: T): T[StringKeyOf<T>][];
|
|
900
542
|
|
|
901
|
-
export { type AccessorDescriptor, type AccessorsDescriptorAttributes, type DescriptorAccessors, type DescriptorBothAccessors, type DescriptorGetter, type DescriptorSetter, type DescriptorValue, type GetKeysOptions, type IterateObjectYield, type KeysPrimitiveTypeFrom,
|
|
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;
|
|
@@ -370,7 +228,7 @@ __name(isEnumerable, "isEnumerable");
|
|
|
370
228
|
|
|
371
229
|
// src/getKeysPreset.ts
|
|
372
230
|
function getKeysPreset(options) {
|
|
373
|
-
const ignore = new Set(options?.ignore
|
|
231
|
+
const ignore = new Set(options?.ignore);
|
|
374
232
|
if (options?.ignoreSymbols) {
|
|
375
233
|
if (options?.ignoreEnumerable) {
|
|
376
234
|
return (o) => {
|
|
@@ -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
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
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
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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
|
}
|
|
@@ -624,7 +478,7 @@ function* iterateObject(root) {
|
|
|
624
478
|
propertyPathArray,
|
|
625
479
|
propertyPath: propertyPathArray.map((s) => {
|
|
626
480
|
return typeof s === "string" ? s : `[${s}]`;
|
|
627
|
-
}).join(".").
|
|
481
|
+
}).join(".").replaceAll(".[", "["),
|
|
628
482
|
isLeaf: false,
|
|
629
483
|
nodeType: Array.isArray(current) ? "array" : "object"
|
|
630
484
|
};
|
|
@@ -657,7 +511,7 @@ function* iterateObject(root) {
|
|
|
657
511
|
propertyPathArray,
|
|
658
512
|
propertyPath: propertyPathArray.map((s) => {
|
|
659
513
|
return typeof s === "string" ? s : `[${s}]`;
|
|
660
|
-
}).join(".").
|
|
514
|
+
}).join(".").replaceAll(".[", "["),
|
|
661
515
|
isLeaf: true,
|
|
662
516
|
nodeType: "object"
|
|
663
517
|
};
|
|
@@ -666,16 +520,6 @@ function* iterateObject(root) {
|
|
|
666
520
|
}
|
|
667
521
|
__name(iterateObject, "iterateObject");
|
|
668
522
|
|
|
669
|
-
// src/mapObject.ts
|
|
670
|
-
function mapObject(obj, fn) {
|
|
671
|
-
const accum = {};
|
|
672
|
-
for (const [key, value] of entriesOf(obj)) {
|
|
673
|
-
accum[key] = fn(value, key);
|
|
674
|
-
}
|
|
675
|
-
return accum;
|
|
676
|
-
}
|
|
677
|
-
__name(mapObject, "mapObject");
|
|
678
|
-
|
|
679
523
|
// src/mapObjectEntries.ts
|
|
680
524
|
function mapObjectEntries(obj, fn) {
|
|
681
525
|
const accum = {};
|
|
@@ -746,15 +590,6 @@ function objDelete(obj, key) {
|
|
|
746
590
|
}
|
|
747
591
|
__name(objDelete, "objDelete");
|
|
748
592
|
|
|
749
|
-
// src/objForEach.ts
|
|
750
|
-
function objForEach(obj, fn) {
|
|
751
|
-
for (const [key, value] of entriesOf(obj)) {
|
|
752
|
-
fn(value, key);
|
|
753
|
-
}
|
|
754
|
-
return obj;
|
|
755
|
-
}
|
|
756
|
-
__name(objForEach, "objForEach");
|
|
757
|
-
|
|
758
593
|
// src/objGet.ts
|
|
759
594
|
function objGet(obj, key) {
|
|
760
595
|
return obj[key];
|
|
@@ -783,15 +618,6 @@ function objHas(obj, key) {
|
|
|
783
618
|
}
|
|
784
619
|
__name(objHas, "objHas");
|
|
785
620
|
|
|
786
|
-
// src/objIsEmpty.ts
|
|
787
|
-
function objIsEmpty(obj) {
|
|
788
|
-
for (const _key in obj) {
|
|
789
|
-
return false;
|
|
790
|
-
}
|
|
791
|
-
return true;
|
|
792
|
-
}
|
|
793
|
-
__name(objIsEmpty, "objIsEmpty");
|
|
794
|
-
|
|
795
621
|
// src/objOmitKeysMutable.ts
|
|
796
622
|
function objOmitKeysMutable(obj, ...keys) {
|
|
797
623
|
for (const key of keys) {
|
|
@@ -824,21 +650,6 @@ function objPropertyValueToGetter(object, ...propertyNames) {
|
|
|
824
650
|
}
|
|
825
651
|
__name(objPropertyValueToGetter, "objPropertyValueToGetter");
|
|
826
652
|
|
|
827
|
-
// ../iter/src/reduceIterable.ts
|
|
828
|
-
function reduceIterable(mapLike, reducer, initialValue) {
|
|
829
|
-
for (const [key, value] of mapLike) {
|
|
830
|
-
initialValue = reducer(initialValue, value, key);
|
|
831
|
-
}
|
|
832
|
-
return initialValue;
|
|
833
|
-
}
|
|
834
|
-
__name(reduceIterable, "reduceIterable");
|
|
835
|
-
|
|
836
|
-
// src/objReduce.ts
|
|
837
|
-
function objReduce(object, reducer, accum) {
|
|
838
|
-
return reduceIterable(entriesOf(object), reducer, accum);
|
|
839
|
-
}
|
|
840
|
-
__name(objReduce, "objReduce");
|
|
841
|
-
|
|
842
653
|
// src/objSet.ts
|
|
843
654
|
function objSet(obj, key, value) {
|
|
844
655
|
return obj[key] = value;
|
|
@@ -898,22 +709,22 @@ __name(propertyIsEnumerable, "propertyIsEnumerable");
|
|
|
898
709
|
// src/setEnumerable.ts
|
|
899
710
|
function setEnumerable(object, ...keys) {
|
|
900
711
|
for (const key of keys) {
|
|
901
|
-
|
|
902
|
-
continue;
|
|
903
|
-
}
|
|
904
|
-
defineProperty(object, key, {
|
|
712
|
+
Object.defineProperty(object, key, {
|
|
905
713
|
enumerable: true
|
|
906
714
|
});
|
|
907
715
|
}
|
|
716
|
+
return object;
|
|
908
717
|
}
|
|
909
718
|
__name(setEnumerable, "setEnumerable");
|
|
910
719
|
|
|
911
720
|
// src/setNonConfigurable.ts
|
|
912
721
|
function setNonConfigurable(object, ...properties) {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
722
|
+
for (const prop of properties) {
|
|
723
|
+
Object.defineProperty(object, prop, {
|
|
724
|
+
configurable: false
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
return object;
|
|
917
728
|
}
|
|
918
729
|
__name(setNonConfigurable, "setNonConfigurable");
|
|
919
730
|
|
|
@@ -930,19 +741,23 @@ __name(setNonEnumerable, "setNonEnumerable");
|
|
|
930
741
|
|
|
931
742
|
// src/setNonWritable.ts
|
|
932
743
|
function setNonWritable(object, ...properties) {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
744
|
+
for (const prop of properties) {
|
|
745
|
+
Object.defineProperty(object, prop, {
|
|
746
|
+
writable: false
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
return object;
|
|
937
750
|
}
|
|
938
751
|
__name(setNonWritable, "setNonWritable");
|
|
939
752
|
|
|
940
753
|
// src/setWritable.ts
|
|
941
754
|
function setWritable(object, ...properties) {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
755
|
+
for (const prop of properties) {
|
|
756
|
+
Object.defineProperty(object, prop, {
|
|
757
|
+
writable: true
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
return object;
|
|
946
761
|
}
|
|
947
762
|
__name(setWritable, "setWritable");
|
|
948
763
|
|
|
@@ -986,4 +801,4 @@ function valuesOf(obj) {
|
|
|
986
801
|
}
|
|
987
802
|
__name(valuesOf, "valuesOf");
|
|
988
803
|
|
|
989
|
-
export {
|
|
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": "1.0
|
|
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": {
|