@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.23.4",
3
+ "version": "0.23.5",
4
4
  "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "json-schema",
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
  [![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox.svg)](https://badge.fury.io/js/%40sinclair%2Ftypebox) [![GitHub CI](https://github.com/sinclairzx81/typebox/workflows/GitHub%20CI/badge.svg)](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 = new Map();
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 };