typebox 1.0.72 → 1.0.73

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.
@@ -16,7 +16,7 @@ import { AsyncIterator, IsAsyncIterator, AsyncIteratorOptions } from '../types/a
16
16
  import { IsBase } from '../types/base.mjs';
17
17
  import { Constructor, IsConstructor, ConstructorOptions } from '../types/constructor.mjs';
18
18
  import { Deferred, IsDeferred } from '../types/deferred.mjs';
19
- import { Function as _Function, IsFunction, FunctionOptions } from '../types/function.mjs';
19
+ import { _Function_, IsFunction, FunctionOptions } from '../types/function.mjs';
20
20
  import { IsCall } from '../types/call.mjs';
21
21
  import { Intersect, IsIntersect, IntersectOptions } from '../types/intersect.mjs';
22
22
  import { Iterator, IsIterator, IteratorOptions } from '../types/iterator.mjs';
@@ -152,7 +152,7 @@ export function InstantiateType(context, state, input) {
152
152
  IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) :
153
153
  IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) :
154
154
  IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) :
155
- IsFunction(type) ? _Function(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) :
155
+ IsFunction(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) :
156
156
  IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) :
157
157
  IsIterator(type) ? Iterator(InstantiateType(context, state, type.iteratorItems), IteratorOptions(type)) :
158
158
  IsObject(type) ? Object(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) :
@@ -371,7 +371,7 @@ export function ParameterListMapping(input) {
371
371
  return Delimited(input);
372
372
  }
373
373
  export function _Function_Mapping(input) {
374
- return T.Function(input[1], input[4]);
374
+ return T._Function_(input[1], input[4]);
375
375
  }
376
376
  export function ConstructorMapping(input) {
377
377
  return T.Constructor(input[2], input[5]);
@@ -13,7 +13,8 @@ export interface TFunction<Parameters extends TSchema[] = TSchema[], ReturnType
13
13
  returnType: ReturnType;
14
14
  }
15
15
  /** Creates a Function type. */
16
- export declare function Function<Parameters extends TSchema[], ReturnType extends TSchema>(parameters: [...Parameters], returnType: ReturnType, options?: TSchemaOptions): TFunction<Parameters, ReturnType>;
16
+ export declare function _Function_<Parameters extends TSchema[], ReturnType extends TSchema>(parameters: [...Parameters], returnType: ReturnType, options?: TSchemaOptions): TFunction<Parameters, ReturnType>;
17
+ export { _Function_ as Function };
17
18
  /** Returns true if the given value is TFunction. */
18
19
  export declare function IsFunction(value: unknown): value is TFunction;
19
20
  /** Extracts options from a TFunction. */
@@ -5,9 +5,10 @@ import { IsKind } from './schema.mjs';
5
5
  // Factory
6
6
  // ------------------------------------------------------------------
7
7
  /** Creates a Function type. */
8
- export function Function(parameters, returnType, options = {}) {
8
+ export function _Function_(parameters, returnType, options = {}) {
9
9
  return Memory.Create({ ['~kind']: 'Function' }, { type: 'function', parameters, returnType }, options);
10
10
  }
11
+ export { _Function_ as Function };
11
12
  // ------------------------------------------------------------------
12
13
  // Guard
13
14
  // ------------------------------------------------------------------
@@ -10,7 +10,7 @@ export interface TObject<Properties extends TProperties = TProperties> extends T
10
10
  required: TRequiredArray<Properties>;
11
11
  }
12
12
  /** Creates an Object type. */
13
- declare function _Object_<Properties extends TProperties>(properties: Properties, options?: TObjectOptions): TObject<Properties>;
13
+ export declare function _Object_<Properties extends TProperties>(properties: Properties, options?: TObjectOptions): TObject<Properties>;
14
14
  export { _Object_ as Object };
15
15
  /** Returns true if the given value is TObject. */
16
16
  export declare function IsObject(value: unknown): value is TObject;
@@ -6,7 +6,7 @@ import { RequiredArray } from './properties.mjs';
6
6
  // Factory
7
7
  // ------------------------------------------------------------------
8
8
  /** Creates an Object type. */
9
- function _Object_(properties, options = {}) {
9
+ export function _Object_(properties, options = {}) {
10
10
  const requiredKeys = RequiredArray(properties);
11
11
  const required = requiredKeys.length > 0 ? { required: requiredKeys } : {};
12
12
  return Memory.Create({ '~kind': 'Object' }, { type: 'object', ...required, properties }, options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.0.72",
4
+ "version": "1.0.73",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"