@sinclair/typebox 0.27.1 → 0.27.3
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/errors/errors.js +3 -3
- package/package.json +1 -1
- package/typebox.d.ts +5 -5
package/errors/errors.js
CHANGED
|
@@ -505,12 +505,12 @@ var ValueErrors;
|
|
|
505
505
|
return;
|
|
506
506
|
errors.push(...variantErrors);
|
|
507
507
|
}
|
|
508
|
-
for (const error of errors) {
|
|
509
|
-
yield error;
|
|
510
|
-
}
|
|
511
508
|
if (errors.length > 0) {
|
|
512
509
|
yield { type: ValueErrorType.Union, schema, path, value, message: 'Expected value of union' };
|
|
513
510
|
}
|
|
511
|
+
for (const error of errors) {
|
|
512
|
+
yield error;
|
|
513
|
+
}
|
|
514
514
|
}
|
|
515
515
|
function* Uint8Array(schema, references, path, value) {
|
|
516
516
|
if (!(value instanceof globalThis.Uint8Array)) {
|
package/package.json
CHANGED
package/typebox.d.ts
CHANGED
|
@@ -648,15 +648,15 @@ export declare class StandardTypeBuilder extends TypeBuilder {
|
|
|
648
648
|
/** `[Standard]` Creates a mapped type whose keys are picked from the given type */
|
|
649
649
|
Pick<T extends TSchema, K extends TNever>(schema: T, key: K, options?: SchemaOptions): TPick<T, never>;
|
|
650
650
|
/** `[Standard]` Creates a Record type */
|
|
651
|
-
Record<K extends TUnion<TLiteral<string | number>[]>, T extends TSchema>(key: K, schema: T): RecordUnionLiteralType<K, T>;
|
|
651
|
+
Record<K extends TUnion<TLiteral<string | number>[]>, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordUnionLiteralType<K, T>;
|
|
652
652
|
/** `[Standard]` Creates a Record type */
|
|
653
|
-
Record<K extends TLiteral<string | number>, T extends TSchema>(key: K, schema: T): RecordLiteralType<K, T>;
|
|
653
|
+
Record<K extends TLiteral<string | number>, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordLiteralType<K, T>;
|
|
654
654
|
/** `[Standard]` Creates a Record type */
|
|
655
|
-
Record<K extends TTemplateLiteral, T extends TSchema>(key: K, schema: T): RecordTemplateLiteralType<K, T>;
|
|
655
|
+
Record<K extends TTemplateLiteral, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordTemplateLiteralType<K, T>;
|
|
656
656
|
/** `[Standard]` Creates a Record type */
|
|
657
|
-
Record<K extends TInteger | TNumber, T extends TSchema>(key: K, schema: T): RecordNumberType<K, T>;
|
|
657
|
+
Record<K extends TInteger | TNumber, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordNumberType<K, T>;
|
|
658
658
|
/** `[Standard]` Creates a Record type */
|
|
659
|
-
Record<K extends TString, T extends TSchema>(key: K, schema: T): RecordStringType<K, T>;
|
|
659
|
+
Record<K extends TString, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordStringType<K, T>;
|
|
660
660
|
/** `[Standard]` Creates a Recursive type */
|
|
661
661
|
Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
|
|
662
662
|
/** `[Standard]` Creates a Ref type. The referenced type must contain a $id */
|