@sinclair/typebox 0.23.4 → 0.23.5
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/package.json +1 -1
- package/readme.md +5 -4
- package/typebox.d.ts +1 -0
- package/typebox.js +4 -1
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<h1>TypeBox</h1>
|
|
4
4
|
|
|
5
|
-
<img src="https://github.com/sinclairzx81/typebox/blob/master/typebox.png?raw=true" />
|
|
6
|
-
|
|
7
5
|
<p>JSON Schema Type Builder with Static Type Resolution for TypeScript</p>
|
|
6
|
+
|
|
7
|
+
<img src="https://github.com/sinclairzx81/typebox/blob/master/typebox.png?raw=true" />
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<br />
|
|
10
|
+
<br />
|
|
10
11
|
|
|
11
12
|
[](https://badge.fury.io/js/%40sinclair%2Ftypebox) [](https://github.com/sinclairzx81/typebox/actions)
|
|
12
13
|
|
|
@@ -266,7 +267,7 @@ The following table outlines the TypeBox mappings between TypeScript and JSON sc
|
|
|
266
267
|
│ Type.Object({ │ } │ x: { │
|
|
267
268
|
│ y: Type.Number() │ │ type: 'number' │
|
|
268
269
|
│ }) │ │ } │
|
|
269
|
-
│
|
|
270
|
+
│ ]) │ │ }, │
|
|
270
271
|
│ │ │ required: ['x'] │
|
|
271
272
|
│ │ │ }, { │
|
|
272
273
|
│ │ │ type: 'object', │
|
package/typebox.d.ts
CHANGED
|
@@ -274,6 +274,7 @@ export declare type StaticPromise<T extends TSchema> = Promise<Static<T>>;
|
|
|
274
274
|
export declare type Static<T extends TSchema> = T['$static'];
|
|
275
275
|
export declare class TypeBuilder {
|
|
276
276
|
protected readonly schemas: Map<string, TSchema>;
|
|
277
|
+
constructor();
|
|
277
278
|
/** `Standard` Modifies an object property to be both readonly and optional */
|
|
278
279
|
ReadonlyOptional<T extends TSchema>(item: T): TReadonlyOptional<T>;
|
|
279
280
|
/** `Standard` Modifies an object property to be readonly */
|
package/typebox.js
CHANGED
|
@@ -83,7 +83,10 @@ function clone(object) {
|
|
|
83
83
|
// TypeBuilder
|
|
84
84
|
// --------------------------------------------------------------------------
|
|
85
85
|
class TypeBuilder {
|
|
86
|
-
schemas
|
|
86
|
+
schemas;
|
|
87
|
+
constructor() {
|
|
88
|
+
this.schemas = new Map();
|
|
89
|
+
}
|
|
87
90
|
/** `Standard` Modifies an object property to be both readonly and optional */
|
|
88
91
|
ReadonlyOptional(item) {
|
|
89
92
|
return { ...item, modifier: exports.ReadonlyOptionalModifier };
|