@sinclair/typebox 0.31.22 → 0.31.23

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.31.22",
3
+ "version": "0.31.23",
4
4
  "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/readme.md CHANGED
@@ -1608,10 +1608,10 @@ The following is a list of community packages that offer general tooling, extend
1608
1608
  | [feathersjs](https://github.com/feathersjs/feathers) | The API and real-time application framework |
1609
1609
  | [fetch-typebox](https://github.com/erfanium/fetch-typebox) | Drop-in replacement for fetch that brings easy integration with TypeBox |
1610
1610
  | [h3-typebox](https://github.com/kevinmarrec/h3-typebox) | Schema validation utilities for h3 using TypeBox & Ajv |
1611
+ | [http-wizard](https://github.com/flodlc/http-wizard) | Type safe http client library for Fastify |
1611
1612
  | [openapi-box](https://github.com/geut/openapi-box) | Generate TypeBox types from OpenApi IDL + Http client library |
1612
1613
  | [schema2typebox](https://github.com/xddq/schema2typebox) | Creating TypeBox code from Json Schemas |
1613
1614
  | [ts2typebox](https://github.com/xddq/ts2typebox) | Creating TypeBox code from Typescript types |
1614
- | [typebox-client](https://github.com/flodlc/typebox-client) | Type safe http client library for Fastify |
1615
1615
  | [typebox-form-parser](https://github.com/jtlapp/typebox-form-parser) | Parses form and query data based on TypeBox schemas |
1616
1616
  | [typebox-validators](https://github.com/jtlapp/typebox-validators) | Advanced validators supporting discriminated and heterogeneous unions |
1617
1617
 
package/typebox.d.ts CHANGED
@@ -315,7 +315,7 @@ export type TPartialRest<T extends TSchema[]> = AssertRest<{
315
315
  [K in keyof T]: TPartial<AssertType<T[K]>>;
316
316
  }>;
317
317
  export type TPartialProperties<T extends TProperties> = Evaluate<AssertProperties<{
318
- [K in keyof T]: TOptional<T[K]>;
318
+ [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonlyOptional<S> : T[K] extends (TReadonly<infer S>) ? TReadonlyOptional<S> : T[K] extends (TOptional<infer S>) ? TOptional<S> : TOptional<T[K]>;
319
319
  }>>;
320
320
  export type TPartial<T extends TSchema> = T extends TRecursive<infer S> ? TRecursive<TPartial<S>> : T extends TIntersect<infer S> ? TIntersect<TPartialRest<S>> : T extends TUnion<infer S> ? TUnion<TPartialRest<S>> : T extends TObject<infer S> ? TObject<TPartialProperties<S>> : T;
321
321
  export type TPickProperties<T extends TProperties, K extends keyof any> = Pick<T, Assert<Extract<K, keyof T>, keyof T>> extends infer R ? ({
@@ -387,7 +387,7 @@ export type TRequiredRest<T extends TSchema[]> = AssertRest<{
387
387
  [K in keyof T]: TRequired<AssertType<T[K]>>;
388
388
  }>;
389
389
  export type TRequiredProperties<T extends TProperties> = Evaluate<AssertProperties<{
390
- [K in keyof T]: T[K] extends TOptional<infer S> ? S : T[K];
390
+ [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonly<S> : T[K] extends (TReadonly<infer S>) ? TReadonly<S> : T[K] extends (TOptional<infer S>) ? S : T[K];
391
391
  }>>;
392
392
  export type TRequired<T extends TSchema> = T extends TRecursive<infer S> ? TRecursive<TRequired<S>> : T extends TIntersect<infer S> ? TIntersect<TRequiredRest<S>> : T extends TUnion<infer S> ? TUnion<TRequiredRest<S>> : T extends TObject<infer S> ? TObject<TRequiredProperties<S>> : T;
393
393
  export type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);