@sinclair/typebox 0.24.43 → 0.24.45

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.24.43",
3
+ "version": "0.24.45",
4
4
  "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/typebox.d.ts CHANGED
@@ -195,6 +195,7 @@ export interface TOmit<T extends TObject, Properties extends ObjectPropertyKeys<
195
195
  }
196
196
  export interface TPartial<T extends TObject> extends TObject {
197
197
  static: Partial<Static<T, this['params']>>;
198
+ properties: T['properties'];
198
199
  }
199
200
  export declare type TPick<T extends TObject, Properties extends ObjectPropertyKeys<T>[]> = TObject<{
200
201
  [K in Properties[number]]: T['properties'][K];
@@ -231,6 +232,7 @@ export interface TRef<T extends TSchema = TSchema> extends TSchema {
231
232
  }
232
233
  export interface TRequired<T extends TObject | TRef<TObject>> extends TObject {
233
234
  static: Required<Static<T, this['params']>>;
235
+ properties: T['properties'];
234
236
  }
235
237
  export declare 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';
236
238
  export interface StringOptions<Format extends string> extends SchemaOptions {
package/typebox.js CHANGED
@@ -271,7 +271,7 @@ class TypeBuilder {
271
271
  /** Creates a recursive object type */
272
272
  Recursive(callback, options = {}) {
273
273
  if (options.$id === undefined)
274
- options.$id = `type-${TypeOrdinal++}`;
274
+ options.$id = `T${TypeOrdinal++}`;
275
275
  const self = callback({ [exports.Kind]: 'Self', $ref: `${options.$id}` });
276
276
  self.$id = options.$id;
277
277
  return this.Create({ ...options, ...self });