Socket
Socket
Sign inDemoInstall

@sinclair/typebox

Package Overview
Dependencies
Maintainers
1
Versions
323
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinclair/typebox - npm Package Compare versions

Comparing version 0.32.35 to 0.33.0

build/cjs/type/create/immutable.d.ts

1

build/cjs/index.d.ts
export * from './type/clone/index';
export * from './type/create/index';
export * from './type/error/index';

@@ -3,0 +4,0 @@ export * from './type/guard/index';

@@ -22,2 +22,3 @@ "use strict";

__exportStar(require("./type/clone/index"), exports);
__exportStar(require("./type/create/index"), exports);
__exportStar(require("./type/error/index"), exports);

@@ -24,0 +25,0 @@ __exportStar(require("./type/guard/index"), exports);

export declare namespace TypeSystemPolicy {
/** Shared assertion routines used by the value and errors modules */
/**
* Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript
* references for embedded types, which may cause side effects if type properties are explicitly updated
* outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,
* preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making
* it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the
* fastest way to instantiate types. The default setting is `default`.
*/
let InstanceMode: 'default' | 'clone' | 'freeze';
/** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */

@@ -4,0 +12,0 @@ let ExactOptionalPropertyTypes: boolean;

@@ -9,5 +9,16 @@ "use strict";

// ------------------------------------------------------------------
// TypeSystemPolicy
// TypeSystemPolicy: Instancing
// ------------------------------------------------------------------
/** Shared assertion routines used by the value and errors modules */
/**
* Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript
* references for embedded types, which may cause side effects if type properties are explicitly updated
* outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,
* preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making
* it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the
* fastest way to instantiate types. The default setting is `default`.
*/
TypeSystemPolicy.InstanceMode = 'default';
// ------------------------------------------------------------------
// TypeSystemPolicy: Checking
// ------------------------------------------------------------------
/** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */

@@ -14,0 +25,0 @@ TypeSystemPolicy.ExactOptionalPropertyTypes = false;

7

build/cjs/type/any/any.js

@@ -5,6 +5,7 @@ "use strict";

exports.Any = Any;
const index_1 = require("../symbols/index");
const index_1 = require("../create/index");
const index_2 = require("../symbols/index");
/** `[Json]` Creates an Any type */
function Any(options = {}) {
return { ...options, [index_1.Kind]: 'Any' };
function Any(options) {
return (0, index_1.CreateType)({ [index_2.Kind]: 'Any' }, options);
}

@@ -27,3 +27,3 @@ import { Ensure } from '../helpers/index';

/** `[Json]` Creates an Array type */
export declare function Array<T extends TSchema>(schema: T, options?: ArrayOptions): TArray<T>;
export declare function Array<T extends TSchema>(items: T, options?: ArrayOptions): TArray<T>;
export {};

@@ -5,12 +5,7 @@ "use strict";

exports.Array = Array;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates an Array type */
function Array(schema, options = {}) {
return {
...options,
[index_1.Kind]: 'Array',
type: 'array',
items: (0, type_1.CloneType)(schema),
};
function Array(items, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Array', type: 'array', items }, options);
}

@@ -6,11 +6,6 @@ "use strict";

const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
/** `[JavaScript]` Creates a AsyncIterator type */
function AsyncIterator(items, options = {}) {
return {
...options,
[index_1.Kind]: 'AsyncIterator',
type: 'AsyncIterator',
items: (0, type_1.CloneType)(items),
};
function AsyncIterator(items, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'AsyncIterator', type: 'AsyncIterator', items }, options);
}

@@ -7,3 +7,3 @@ "use strict";

const index_2 = require("../union/index");
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
// ------------------------------------------------------------------

@@ -40,4 +40,4 @@ // TypeGuard

/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
function Awaited(T, options = {}) {
return (0, type_1.CloneType)(AwaitedResolve(T), options);
function Awaited(T, options) {
return (0, type_1.CreateType)(AwaitedResolve(T), options);
}

@@ -6,9 +6,6 @@ "use strict";

const index_1 = require("../symbols/index");
const index_2 = require("../create/index");
/** `[JavaScript]` Creates a BigInt type */
function BigInt(options = {}) {
return {
...options,
[index_1.Kind]: 'BigInt',
type: 'bigint',
};
function BigInt(options) {
return (0, index_2.CreateType)({ [index_1.Kind]: 'BigInt', type: 'bigint' }, options);
}

@@ -6,9 +6,6 @@ "use strict";

const index_1 = require("../symbols/index");
const index_2 = require("../create/index");
/** `[Json]` Creates a Boolean type */
function Boolean(options = {}) {
return {
...options,
[index_1.Kind]: 'Boolean',
type: 'boolean',
};
function Boolean(options) {
return (0, index_2.CreateType)({ [index_1.Kind]: 'Boolean', type: 'boolean' }, options);
}

@@ -1,2 +0,2 @@

import type { TSchema, SchemaOptions } from '../schema/index';
import { TSchema, SchemaOptions } from '../schema/index';
/** Clones a Rest */

@@ -3,0 +3,0 @@ export declare function CloneRest<T extends TSchema[]>(schemas: T): T;

@@ -12,4 +12,4 @@ "use strict";

/** Clones a Type */
function CloneType(schema, options = {}) {
return { ...(0, value_1.Clone)(schema), ...options };
function CloneType(schema, options) {
return options === undefined ? (0, value_1.Clone)(schema) : (0, value_1.Clone)({ ...options, ...schema });
}

@@ -41,3 +41,3 @@ "use strict";

// prettier-ignore
function Composite(T, options = {}) {
function Composite(T, options) {
const K = CompositeKeys(T);

@@ -44,0 +44,0 @@ const P = CompositeProperties(T, K);

@@ -18,3 +18,3 @@ "use strict";

const index_13 = require("../unknown/index");
const index_14 = require("../clone/index");
const index_14 = require("../create/index");
// ------------------------------------------------------------------

@@ -57,4 +57,4 @@ // ValueGuard

/** `[JavaScript]` Creates a readonly const type from the given value. */
function Const(T, options = {}) {
return (0, index_14.CloneType)(FromValue(T, true), options);
function Const(T, options) {
return (0, index_14.CreateType)(FromValue(T, true), options);
}

@@ -6,6 +6,5 @@ "use strict";

const index_1 = require("../tuple/index");
const type_1 = require("../clone/type");
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
function ConstructorParameters(schema, options = {}) {
return (0, index_1.Tuple)((0, type_1.CloneRest)(schema.parameters), { ...options });
function ConstructorParameters(schema, options) {
return (0, index_1.Tuple)(schema.parameters, options);
}

@@ -5,13 +5,7 @@ "use strict";

exports.Constructor = Constructor;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Constructor type */
function Constructor(parameters, returns, options) {
return {
...options,
[index_1.Kind]: 'Constructor',
type: 'Constructor',
parameters: (0, type_1.CloneRest)(parameters),
returns: (0, type_1.CloneType)(returns),
};
return (0, type_1.CreateType)({ [index_1.Kind]: 'Constructor', type: 'Constructor', parameters, returns }, options);
}

@@ -6,9 +6,6 @@ "use strict";

const index_1 = require("../symbols/index");
const type_1 = require("../create/type");
/** `[JavaScript]` Creates a Date type */
function Date(options = {}) {
return {
...options,
[index_1.Kind]: 'Date',
type: 'Date',
};
function Date(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Date', type: 'Date' }, options);
}

@@ -0,1 +1,2 @@

/** Discards property keys from the given value. This function returns a shallow Clone. */
export declare function Discard(value: Record<PropertyKey, any>, keys: PropertyKey[]): Record<PropertyKey, any>;

@@ -9,4 +9,5 @@ "use strict";

}
/** Discards property keys from the given value. This function returns a shallow Clone. */
function Discard(value, keys) {
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
}

@@ -13,3 +13,3 @@ "use strict";

/** `[Json]` Creates a Enum type */
function Enum(item, options = {}) {
function Enum(item, options) {
if ((0, value_1.IsUndefined)(item))

@@ -16,0 +16,0 @@ throw new Error('Enum undefined or empty');

@@ -5,6 +5,6 @@ "use strict";

exports.Exclude = Exclude;
const type_1 = require("../create/type");
const index_1 = require("../union/index");
const index_2 = require("../never/index");
const index_3 = require("../extends/index");
const type_1 = require("../clone/type");
const exclude_from_mapped_result_1 = require("./exclude-from-mapped-result");

@@ -24,8 +24,8 @@ const exclude_from_template_literal_1 = require("./exclude-from-template-literal");

if ((0, kind_1.IsTemplateLiteral)(L))
return (0, type_1.CloneType)((0, exclude_from_template_literal_1.ExcludeFromTemplateLiteral)(L, R), options);
return (0, type_1.CreateType)((0, exclude_from_template_literal_1.ExcludeFromTemplateLiteral)(L, R), options);
if ((0, kind_1.IsMappedResult)(L))
return (0, type_1.CloneType)((0, exclude_from_mapped_result_1.ExcludeFromMappedResult)(L, R), options);
return (0, type_1.CreateType)((0, exclude_from_mapped_result_1.ExcludeFromMappedResult)(L, R), options);
// prettier-ignore
return (0, type_1.CloneType)((0, kind_1.IsUnion)(L) ? ExcludeRest(L.anyOf, R) :
return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExcludeRest(L.anyOf, R) :
(0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? (0, index_2.Never)() : L, options);
}

@@ -13,3 +13,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>> = (TMappedResult<P>);
export declare function ExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>>(T: T, U: U, L: L, R: R, options: SchemaOptions): TMappedResult<P>;
export declare function ExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>>(T: T, U: U, L: L, R: R, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -8,6 +8,7 @@ "use strict";

const extends_1 = require("./extends");
const value_1 = require("../clone/value");
// prettier-ignore
function FromPropertyKey(K, U, L, R, options) {
return {
[K]: (0, extends_1.Extends)((0, index_2.Literal)(K), U, L, R, options)
[K]: (0, extends_1.Extends)((0, index_2.Literal)(K), U, L, R, (0, value_1.Clone)(options))
};

@@ -14,0 +15,0 @@ }

@@ -10,3 +10,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TExtendsFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema, P extends TProperties = TFromMappedResult<Left, Right, True, False>> = (TMappedResult<P>);
export declare function ExtendsFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema, P extends TProperties = TFromMappedResult<Left, Right, True, False>>(Left: Left, Right: Right, True: True, False: False, options: SchemaOptions): TMappedResult<P>;
export declare function ExtendsFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema, P extends TProperties = TFromMappedResult<Left, Right, True, False>>(Left: Left, Right: Right, True: True, False: False, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,2 +7,3 @@ "use strict";

const extends_1 = require("./extends");
const value_1 = require("../clone/value");
// prettier-ignore

@@ -12,3 +13,3 @@ function FromProperties(P, Right, True, False, options) {

for (const K2 of globalThis.Object.getOwnPropertyNames(P))
Acc[K2] = (0, extends_1.Extends)(P[K2], Right, True, False, options);
Acc[K2] = (0, extends_1.Extends)(P[K2], Right, True, False, (0, value_1.Clone)(options));
return Acc;

@@ -15,0 +16,0 @@ }

@@ -5,5 +5,5 @@ "use strict";

exports.Extends = Extends;
const type_1 = require("../create/type");
const index_1 = require("../union/index");
const extends_check_1 = require("./extends-check");
const type_1 = require("../clone/type");
const extends_from_mapped_key_1 = require("./extends-from-mapped-key");

@@ -23,7 +23,7 @@ const extends_from_mapped_result_1 = require("./extends-from-mapped-result");

/** `[Json]` Creates a Conditional type */
function Extends(L, R, T, F, options = {}) {
function Extends(L, R, T, F, options) {
// prettier-ignore
return ((0, kind_1.IsMappedResult)(L) ? (0, extends_from_mapped_result_1.ExtendsFromMappedResult)(L, R, T, F, options) :
(0, kind_1.IsMappedKey)(L) ? (0, type_1.CloneType)((0, extends_from_mapped_key_1.ExtendsFromMappedKey)(L, R, T, F, options)) :
(0, type_1.CloneType)(ExtendsResolve(L, R, T, F), options));
(0, kind_1.IsMappedKey)(L) ? (0, type_1.CreateType)((0, extends_from_mapped_key_1.ExtendsFromMappedKey)(L, R, T, F, options)) :
(0, type_1.CreateType)(ExtendsResolve(L, R, T, F), options));
}

@@ -5,6 +5,6 @@ "use strict";

exports.Extract = Extract;
const type_1 = require("../create/type");
const index_1 = require("../union/index");
const index_2 = require("../never/index");
const index_3 = require("../extends/index");
const type_1 = require("../clone/type");
const extract_from_mapped_result_1 = require("./extract-from-mapped-result");

@@ -21,11 +21,11 @@ const extract_from_template_literal_1 = require("./extract-from-template-literal");

/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
function Extract(L, R, options = {}) {
function Extract(L, R, options) {
// overloads
if ((0, kind_1.IsTemplateLiteral)(L))
return (0, type_1.CloneType)((0, extract_from_template_literal_1.ExtractFromTemplateLiteral)(L, R), options);
return (0, type_1.CreateType)((0, extract_from_template_literal_1.ExtractFromTemplateLiteral)(L, R), options);
if ((0, kind_1.IsMappedResult)(L))
return (0, type_1.CloneType)((0, extract_from_mapped_result_1.ExtractFromMappedResult)(L, R), options);
return (0, type_1.CreateType)((0, extract_from_mapped_result_1.ExtractFromMappedResult)(L, R), options);
// prettier-ignore
return (0, type_1.CloneType)((0, kind_1.IsUnion)(L) ? ExtractRest(L.anyOf, R) :
return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExtractRest(L.anyOf, R) :
(0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? L : (0, index_2.Never)(), options);
}

@@ -5,13 +5,7 @@ "use strict";

exports.Function = Function;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Function type */
function Function(parameters, returns, options) {
return {
...options,
[index_1.Kind]: 'Function',
type: 'Function',
parameters: (0, type_1.CloneRest)(parameters),
returns: (0, type_1.CloneType)(returns),
};
return (0, type_1.CreateType)({ [index_1.Kind]: 'Function', type: 'Function', parameters, returns }, options);
}

@@ -19,2 +19,5 @@ "use strict";

exports.IsUndefined = IsUndefined;
// --------------------------------------------------------------------------
// Object Instances
// --------------------------------------------------------------------------
/** Returns true if this value is an async iterator */

@@ -21,0 +24,0 @@ function IsAsyncIterator(value) {

@@ -12,3 +12,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TIndexFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TMappedIndexProperties<T, K>> = (Ensure<TMappedResult<P>>);
export declare function IndexFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TMappedIndexProperties<T, K>>(T: T, K: K, options: SchemaOptions): TMappedResult<P>;
export declare function IndexFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TMappedIndexProperties<T, K>>(T: T, K: K, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,5 +7,6 @@ "use strict";

const index_1 = require("../mapped/index");
const value_1 = require("../clone/value");
// prettier-ignore
function MappedIndexPropertyKey(T, K, options) {
return { [K]: (0, indexed_1.Index)(T, [K], options) };
return { [K]: (0, indexed_1.Index)(T, [K], (0, value_1.Clone)(options)) };
}

@@ -12,0 +13,0 @@ // prettier-ignore

@@ -11,3 +11,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TIndexFromMappedResult<T extends TSchema, R extends TMappedResult, P extends TProperties = TFromMappedResult<T, R>> = (TMappedResult<P>);
export declare function IndexFromMappedResult<T extends TSchema, R extends TMappedResult, P extends TProperties = TFromMappedResult<T, R>>(T: T, R: R, options: SchemaOptions): TMappedResult<P>;
export declare function IndexFromMappedResult<T extends TSchema, R extends TMappedResult, P extends TProperties = TFromMappedResult<T, R>>(T: T, R: R, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,6 +7,6 @@ "use strict";

exports.Index = Index;
const type_1 = require("../create/type");
const index_1 = require("../never/index");
const index_2 = require("../intersect/index");
const index_3 = require("../union/index");
const type_1 = require("../clone/type");
const indexed_property_keys_1 = require("./indexed-property-keys");

@@ -75,8 +75,12 @@ const indexed_from_mapped_key_1 = require("./indexed-from-mapped-key");

/** `[Json]` Returns an Indexed property type for the given keys */
function Index(T, K, options = {}) {
function Index(T, K, options) {
// mapped-types
if ((0, kind_1.IsMappedResult)(K))
return (0, indexed_from_mapped_result_1.IndexFromMappedResult)(T, K, options);
if ((0, kind_1.IsMappedKey)(K))
return (0, indexed_from_mapped_key_1.IndexFromMappedKey)(T, K, options);
// prettier-ignore
return ((0, kind_1.IsMappedResult)(K) ? (0, type_1.CloneType)((0, indexed_from_mapped_result_1.IndexFromMappedResult)(T, K, options)) :
(0, kind_1.IsMappedKey)(K) ? (0, type_1.CloneType)((0, indexed_from_mapped_key_1.IndexFromMappedKey)(T, K, options)) :
(0, kind_1.IsSchema)(K) ? (0, type_1.CloneType)(FromSchema(T, (0, indexed_property_keys_1.IndexPropertyKeys)(K)), options) :
(0, type_1.CloneType)(FromSchema(T, K), options));
return (0, type_1.CreateType)((0, kind_1.IsSchema)(K)
? FromSchema(T, (0, indexed_property_keys_1.IndexPropertyKeys)(K))
: FromSchema(T, K), options);
}

@@ -5,6 +5,6 @@ "use strict";

exports.InstanceType = InstanceType;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
function InstanceType(schema, options = {}) {
return (0, type_1.CloneType)(schema.returns, options);
function InstanceType(schema, options) {
return (0, type_1.CreateType)(schema.returns, options);
}

@@ -5,10 +5,7 @@ "use strict";

exports.Integer = Integer;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates an Integer type */
function Integer(options = {}) {
return {
...options,
[index_1.Kind]: 'Integer',
type: 'integer',
};
function Integer(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Integer', type: 'integer' }, options);
}
import type { TSchema } from '../schema/index';
import type { TIntersect, IntersectOptions } from './intersect-type';
export declare function IntersectCreate<T extends TSchema[]>(T: [...T], options: IntersectOptions): TIntersect<T>;
export declare function IntersectCreate<T extends TSchema[]>(T: [...T], options?: IntersectOptions): TIntersect<T>;

@@ -5,4 +5,4 @@ "use strict";

exports.IntersectCreate = IntersectCreate;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
// ------------------------------------------------------------------

@@ -16,10 +16,10 @@ // TypeGuard

// prettier-ignore
function IntersectCreate(T, options) {
function IntersectCreate(T, options = {}) {
const allObjects = T.every((schema) => (0, kind_1.IsObject)(schema));
const clonedUnevaluatedProperties = (0, kind_1.IsSchema)(options.unevaluatedProperties)
? { unevaluatedProperties: (0, type_1.CloneType)(options.unevaluatedProperties) }
? { unevaluatedProperties: options.unevaluatedProperties }
: {};
return ((options.unevaluatedProperties === false || (0, kind_1.IsSchema)(options.unevaluatedProperties) || allObjects
? { ...options, ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', type: 'object', allOf: (0, type_1.CloneRest)(T) }
: { ...options, ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', allOf: (0, type_1.CloneRest)(T) }));
return (0, type_1.CreateType)((options.unevaluatedProperties === false || (0, kind_1.IsSchema)(options.unevaluatedProperties) || allObjects
? { ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', type: 'object', allOf: T }
: { ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', allOf: T }), options);
}

@@ -6,3 +6,3 @@ "use strict";

const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_2 = require("../discard/index");

@@ -39,3 +39,3 @@ const index_3 = require("../never/index");

if (T.length === 1)
return (0, type_1.CloneType)(T[0], options);
return (0, type_1.CreateType)(T[0], options);
if (T.some((schema) => (0, kind_1.IsTransform)(schema)))

@@ -42,0 +42,0 @@ throw new Error('Cannot intersect transform types');

@@ -5,3 +5,3 @@ "use strict";

exports.Intersect = Intersect;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../never/index");

@@ -14,7 +14,7 @@ const intersect_create_1 = require("./intersect-create");

/** `[Json]` Creates an evaluated Intersect type */
function Intersect(T, options = {}) {
function Intersect(T, options) {
if (T.length === 0)
return (0, index_1.Never)(options);
if (T.length === 1)
return (0, type_1.CloneType)(T[0], options);
return (0, type_1.CreateType)(T[0], options);
if (T.some((schema) => (0, kind_1.IsTransform)(schema)))

@@ -21,0 +21,0 @@ throw new Error('Cannot intersect transform types');

@@ -8,6 +8,7 @@ "use strict";

const index_2 = require("../literal/index");
const value_1 = require("../clone/value");
// prettier-ignore
function MappedIntrinsicPropertyKey(K, M, options) {
return {
[K]: (0, intrinsic_1.Intrinsic)((0, index_2.Literal)(K), M, options)
[K]: (0, intrinsic_1.Intrinsic)((0, index_2.Literal)(K), M, (0, value_1.Clone)(options))
};

@@ -17,5 +18,6 @@ }

function MappedIntrinsicPropertyKeys(K, M, options) {
return K.reduce((Acc, L) => {
const result = K.reduce((Acc, L) => {
return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
}, {});
return result;
}

@@ -22,0 +24,0 @@ // prettier-ignore

@@ -5,2 +5,3 @@ "use strict";

exports.Intrinsic = Intrinsic;
const type_1 = require("../create/type");
const index_1 = require("../template-literal/index");

@@ -66,3 +67,4 @@ const intrinsic_from_mapped_key_1 = require("./intrinsic-from-mapped-key");

(0, kind_1.IsLiteral)(schema) ? (0, index_2.Literal)(FromLiteralValue(schema.const, mode), options) :
schema);
// Default Type
(0, type_1.CreateType)(schema, options));
}

@@ -5,12 +5,7 @@ "use strict";

exports.Iterator = Iterator;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates an Iterator type */
function Iterator(items, options = {}) {
return {
...options,
[index_1.Kind]: 'Iterator',
type: 'Iterator',
items: (0, type_1.CloneType)(items),
};
function Iterator(items, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Iterator', type: 'Iterator', items }, options);
}

@@ -11,3 +11,3 @@ import type { SchemaOptions } from '../schema/index';

export type TKeyOfFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (Ensure<TMappedResult<P>>);
export declare function KeyOfFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options: SchemaOptions): TMappedResult<P>;
export declare function KeyOfFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,2 +7,3 @@ "use strict";

const keyof_1 = require("./keyof");
const value_1 = require("../clone/value");
// prettier-ignore

@@ -12,3 +13,3 @@ function FromProperties(K, options) {

for (const K2 of globalThis.Object.getOwnPropertyNames(K))
Acc[K2] = (0, keyof_1.KeyOf)(K[K2], options);
Acc[K2] = (0, keyof_1.KeyOf)(K[K2], (0, value_1.Clone)(options));
return Acc;

@@ -15,0 +16,0 @@ }

@@ -6,2 +6,3 @@ "use strict";

exports.KeyOf = KeyOf;
const type_1 = require("../create/type");
const index_1 = require("../literal/index");

@@ -11,3 +12,2 @@ const index_2 = require("../number/index");

const index_3 = require("../union/index");
const type_1 = require("../clone/type");
const keyof_from_mapped_result_1 = require("./keyof-from-mapped-result");

@@ -23,3 +23,3 @@ // ------------------------------------------------------------------

/** `[Json]` Creates a KeyOf type */
function KeyOf(T, options = {}) {
function KeyOf(T, options) {
if ((0, kind_1.IsMappedResult)(T)) {

@@ -32,4 +32,4 @@ return (0, keyof_from_mapped_result_1.KeyOfFromMappedResult)(T, options);

const U = (0, index_3.UnionEvaluated)(S);
return (0, type_1.CloneType)(U, options);
return (0, type_1.CreateType)(U, options);
}
}

@@ -5,11 +5,11 @@ "use strict";

exports.Literal = Literal;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Literal type */
function Literal(value, options = {}) {
return {
...options,
function Literal(value, options) {
return (0, type_1.CreateType)({
[index_1.Kind]: 'Literal',
const: value,
type: typeof value,
};
}, options);
}

@@ -5,9 +5,10 @@ "use strict";

exports.MappedKey = MappedKey;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
// prettier-ignore
function MappedKey(T) {
return {
return (0, type_1.CreateType)({
[index_1.Kind]: 'MappedKey',
keys: T
};
});
}

@@ -5,9 +5,10 @@ "use strict";

exports.MappedResult = MappedResult;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
// prettier-ignore
function MappedResult(properties) {
return {
return (0, type_1.CreateType)({
[index_1.Kind]: 'MappedResult',
properties
};
});
}

@@ -7,3 +7,2 @@ "use strict";

const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const index_2 = require("../discard/index");

@@ -102,7 +101,7 @@ // evaluation types

/** `[Json]` Creates a Mapped object type */
function Mapped(key, map, options = {}) {
function Mapped(key, map, options) {
const K = (0, kind_1.IsSchema)(key) ? (0, index_7.IndexPropertyKeys)(key) : key;
const RT = map({ [index_1.Kind]: 'MappedKey', keys: K });
const R = MappedFunctionReturnType(K, RT);
return (0, type_1.CloneType)((0, index_11.Object)(R), options);
return (0, index_11.Object)(R, options);
}

@@ -5,10 +5,7 @@ "use strict";

exports.Never = Never;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Never type */
function Never(options = {}) {
return {
...options,
[index_1.Kind]: 'Never',
not: {},
};
function Never(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Never', not: {} }, options);
}

@@ -10,2 +10,2 @@ import type { TSchema, SchemaOptions } from '../schema/index';

/** `[Json]` Creates a Not type */
export declare function Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
export declare function Not<T extends TSchema>(not: T, options?: SchemaOptions): TNot<T>;

@@ -5,11 +5,7 @@ "use strict";

exports.Not = Not;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Not type */
function Not(schema, options) {
return {
...options,
[index_1.Kind]: 'Not',
not: (0, type_1.CloneType)(schema),
};
function Not(not, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Not', not }, options);
}

@@ -5,10 +5,7 @@ "use strict";

exports.Null = Null;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Null type */
function Null(options = {}) {
return {
...options,
[index_1.Kind]: 'Null',
type: 'null',
};
function Null(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Null', type: 'null' }, options);
}

@@ -5,10 +5,7 @@ "use strict";

exports.Number = Number;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Number type */
function Number(options = {}) {
return {
...options,
[index_1.Kind]: 'Number',
type: 'number',
};
function Number(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Number', type: 'number' }, options);
}

@@ -5,3 +5,3 @@ "use strict";

exports.Object = void 0;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");

@@ -12,16 +12,17 @@ // ------------------------------------------------------------------

const kind_1 = require("../guard/kind");
function RequiredKeys(properties) {
const keys = [];
for (let key in properties) {
if (!(0, kind_1.IsOptional)(properties[key]))
keys.push(key);
}
return keys;
}
/** `[Json]` Creates an Object type */
function _Object(properties, options = {}) {
const propertyKeys = globalThis.Object.getOwnPropertyNames(properties);
const optionalKeys = propertyKeys.filter((key) => (0, kind_1.IsOptional)(properties[key]));
const requiredKeys = propertyKeys.filter((name) => !optionalKeys.includes(name));
const clonedAdditionalProperties = (0, kind_1.IsSchema)(options.additionalProperties) ? { additionalProperties: (0, type_1.CloneType)(options.additionalProperties) } : {};
const clonedProperties = {};
for (const key of propertyKeys)
clonedProperties[key] = (0, type_1.CloneType)(properties[key]);
return (requiredKeys.length > 0
? { ...options, ...clonedAdditionalProperties, [index_1.Kind]: 'Object', type: 'object', properties: clonedProperties, required: requiredKeys }
: { ...options, ...clonedAdditionalProperties, [index_1.Kind]: 'Object', type: 'object', properties: clonedProperties });
function _Object(properties, options) {
const required = RequiredKeys(properties);
const schematic = required.length > 0 ? { [index_1.Kind]: 'Object', type: 'object', properties, required } : { [index_1.Kind]: 'Object', type: 'object', properties };
return (0, type_1.CreateType)(schematic, options);
}
/** `[Json]` Creates an Object type */
exports.Object = _Object;

@@ -11,3 +11,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TOmitFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>> = (TMappedResult<P>);
export declare function OmitFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>>(T: T, K: K, options: SchemaOptions): TMappedResult<P>;
export declare function OmitFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>>(T: T, K: K, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,6 +7,7 @@ "use strict";

const omit_1 = require("./omit");
const value_1 = require("../clone/value");
// prettier-ignore
function FromPropertyKey(T, K, options) {
return {
[K]: (0, omit_1.Omit)(T, [K], options)
[K]: (0, omit_1.Omit)(T, [K], (0, value_1.Clone)(options))
};

@@ -13,0 +14,0 @@ }

@@ -11,3 +11,3 @@ import type { SchemaOptions } from '../schema/index';

export type TOmitFromMappedResult<T extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<T, K>> = (Ensure<TMappedResult<P>>);
export declare function OmitFromMappedResult<R extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<R, K>>(R: R, K: [...K], options: SchemaOptions): TMappedResult<P>;
export declare function OmitFromMappedResult<R extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<R, K>>(R: R, K: [...K], options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,2 +7,3 @@ "use strict";

const omit_1 = require("./omit");
const value_1 = require("../clone/value");
// prettier-ignore

@@ -12,3 +13,3 @@ function FromProperties(P, K, options) {

for (const K2 of globalThis.Object.getOwnPropertyNames(P))
Acc[K2] = (0, omit_1.Omit)(P[K2], K, options);
Acc[K2] = (0, omit_1.Omit)(P[K2], K, (0, value_1.Clone)(options));
return Acc;

@@ -15,0 +16,0 @@ }

@@ -5,2 +5,3 @@ "use strict";

exports.Omit = Omit;
const type_1 = require("../create/type");
const index_1 = require("../intersect/index");

@@ -12,3 +13,2 @@ const index_2 = require("../union/index");

const index_6 = require("../symbols/index");
const type_1 = require("../clone/type");
const omit_from_mapped_key_1 = require("./omit-from-mapped-key");

@@ -50,3 +50,3 @@ const omit_from_mapped_result_1 = require("./omit-from-mapped-result");

}
function Omit(T, K, options = {}) {
function Omit(T, K, options) {
// mapped

@@ -60,4 +60,4 @@ if ((0, kind_1.IsMappedKey)(K))

const D = (0, index_5.Discard)(T, [index_6.TransformKind, '$id', 'required']);
const R = (0, type_1.CloneType)(OmitResolve(T, I), options);
return { ...D, ...R };
const R = OmitResolve(T, I);
return (0, type_1.CreateType)({ ...D, ...R }, options);
}

@@ -5,4 +5,4 @@ "use strict";

exports.Optional = Optional;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const index_2 = require("../discard/index");

@@ -12,6 +12,6 @@ const optional_from_mapped_result_1 = require("./optional-from-mapped-result");

function RemoveOptional(schema) {
return (0, index_2.Discard)((0, type_1.CloneType)(schema), [index_1.OptionalKind]);
return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.OptionalKind]));
}
function AddOptional(schema) {
return { ...(0, type_1.CloneType)(schema), [index_1.OptionalKind]: 'Optional' };
return (0, type_1.CreateType)({ ...schema, [index_1.OptionalKind]: 'Optional' });
}

@@ -18,0 +18,0 @@ // prettier-ignore

@@ -6,6 +6,5 @@ "use strict";

const index_1 = require("../tuple/index");
const type_1 = require("../clone/type");
/** `[JavaScript]` Extracts the Parameters from the given Function type */
function Parameters(schema, options = {}) {
return (0, index_1.Tuple)((0, type_1.CloneRest)(schema.parameters), { ...options });
function Parameters(schema, options) {
return (0, index_1.Tuple)(schema.parameters, options);
}

@@ -11,3 +11,3 @@ import type { SchemaOptions } from '../schema/index';

export type TPartialFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (Ensure<TMappedResult<P>>);
export declare function PartialFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options: SchemaOptions): TMappedResult<P>;
export declare function PartialFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,2 +7,3 @@ "use strict";

const partial_1 = require("./partial");
const value_1 = require("../clone/value");
// prettier-ignore

@@ -12,3 +13,3 @@ function FromProperties(K, options) {

for (const K2 of globalThis.Object.getOwnPropertyNames(K))
Acc[K2] = (0, partial_1.Partial)(K[K2], options);
Acc[K2] = (0, partial_1.Partial)(K[K2], (0, value_1.Clone)(options));
return Acc;

@@ -15,0 +16,0 @@ }

@@ -5,2 +5,3 @@ "use strict";

exports.Partial = Partial;
const type_1 = require("../create/type");
const index_1 = require("../optional/index");

@@ -12,3 +13,2 @@ const index_2 = require("../object/index");

const index_6 = require("../symbols/index");
const type_1 = require("../clone/type");
const partial_from_mapped_result_1 = require("./partial-from-mapped-result");

@@ -41,8 +41,8 @@ // ------------------------------------------------------------------

/** `[Json]` Constructs a type where all properties are optional */
function Partial(T, options = {}) {
function Partial(T, options) {
if ((0, kind_1.IsMappedResult)(T))
return (0, partial_from_mapped_result_1.PartialFromMappedResult)(T, options);
const D = (0, index_5.Discard)(T, [index_6.TransformKind, '$id', 'required']);
const R = (0, type_1.CloneType)(PartialResolve(T), options);
return { ...D, ...R };
const R = PartialResolve(T);
return (0, type_1.CreateType)({ ...options, ...D, ...R });
}

@@ -11,3 +11,3 @@ import type { TSchema, SchemaOptions } from '../schema/index';

export type TPickFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>> = (TMappedResult<P>);
export declare function PickFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>>(T: T, K: K, options: SchemaOptions): TMappedResult<P>;
export declare function PickFromMappedKey<T extends TSchema, K extends TMappedKey, P extends TProperties = TFromMappedKey<T, K>>(T: T, K: K, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,6 +7,7 @@ "use strict";

const pick_1 = require("./pick");
const value_1 = require("../clone/value");
// prettier-ignore
function FromPropertyKey(T, K, options) {
return {
[K]: (0, pick_1.Pick)(T, [K], options)
[K]: (0, pick_1.Pick)(T, [K], (0, value_1.Clone)(options))
};

@@ -13,0 +14,0 @@ }

@@ -11,3 +11,3 @@ import type { SchemaOptions } from '../schema/index';

export type TPickFromMappedResult<T extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<T, K>> = (Ensure<TMappedResult<P>>);
export declare function PickFromMappedResult<R extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<R, K>>(R: R, K: [...K], options: SchemaOptions): TMappedResult<P>;
export declare function PickFromMappedResult<R extends TMappedResult, K extends PropertyKey[], P extends TProperties = TFromMappedResult<R, K>>(R: R, K: [...K], options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -7,2 +7,3 @@ "use strict";

const pick_1 = require("./pick");
const value_1 = require("../clone/value");
// prettier-ignore

@@ -12,3 +13,3 @@ function FromProperties(P, K, options) {

for (const K2 of globalThis.Object.getOwnPropertyNames(P))
Acc[K2] = (0, pick_1.Pick)(P[K2], K, options);
Acc[K2] = (0, pick_1.Pick)(P[K2], K, (0, value_1.Clone)(options));
return Acc;

@@ -15,0 +16,0 @@ }

@@ -5,2 +5,3 @@ "use strict";

exports.Pick = Pick;
const type_1 = require("../create/type");
const index_1 = require("../intersect/index");

@@ -12,3 +13,2 @@ const index_2 = require("../union/index");

const index_6 = require("../symbols/index");
const type_1 = require("../clone/type");
const pick_from_mapped_key_1 = require("./pick-from-mapped-key");

@@ -45,3 +45,3 @@ const pick_from_mapped_result_1 = require("./pick-from-mapped-result");

}
function Pick(T, K, options = {}) {
function Pick(T, K, options) {
// mapped

@@ -55,4 +55,4 @@ if ((0, kind_1.IsMappedKey)(K))

const D = (0, index_5.Discard)(T, [index_6.TransformKind, '$id', 'required']);
const R = (0, type_1.CloneType)(PickResolve(T, I), options);
return { ...D, ...R };
const R = PickResolve(T, I);
return (0, type_1.CreateType)({ ...D, ...R }, options);
}

@@ -5,12 +5,7 @@ "use strict";

exports.Promise = Promise;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Promise type */
function Promise(item, options = {}) {
return {
...options,
[index_1.Kind]: 'Promise',
type: 'Promise',
item: (0, type_1.CloneType)(item),
};
function Promise(item, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Promise', type: 'Promise', item }, options);
}

@@ -5,4 +5,4 @@ "use strict";

exports.Readonly = Readonly;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const index_2 = require("../discard/index");

@@ -12,6 +12,6 @@ const readonly_from_mapped_result_1 = require("./readonly-from-mapped-result");

function RemoveReadonly(schema) {
return (0, index_2.Discard)((0, type_1.CloneType)(schema), [index_1.ReadonlyKind]);
return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.ReadonlyKind]));
}
function AddReadonly(schema) {
return { ...(0, type_1.CloneType)(schema), [index_1.ReadonlyKind]: 'Readonly' };
return (0, type_1.CreateType)({ ...schema, [index_1.ReadonlyKind]: 'Readonly' });
}

@@ -18,0 +18,0 @@ // prettier-ignore

@@ -5,2 +5,3 @@ "use strict";

exports.Record = Record;
const type_1 = require("../create/type");
const index_1 = require("../object/index");

@@ -13,3 +14,2 @@ const index_2 = require("../never/index");

const index_7 = require("../symbols/index");
const type_1 = require("../clone/type");
// ------------------------------------------------------------------

@@ -28,8 +28,7 @@ // ValueGuard

function RecordCreateFromPattern(pattern, T, options) {
return {
...options,
return (0, type_1.CreateType)({
[index_7.Kind]: 'Record',
type: 'object',
patternProperties: { [pattern]: (0, type_1.CloneType)(T) }
};
patternProperties: { [pattern]: T }
}, options);
}

@@ -43,3 +42,3 @@ // ------------------------------------------------------------------

for (const K2 of K)
Acc[K2] = (0, type_1.CloneType)(T);
Acc[K2] = T;
return (0, index_1.Object)(Acc, { ...options, [index_7.Hint]: 'Record' });

@@ -46,0 +45,0 @@ }

@@ -6,2 +6,3 @@ "use strict";

const type_1 = require("../clone/type");
const type_2 = require("../create/type");
const value_1 = require("../guard/value");

@@ -15,6 +16,6 @@ const index_1 = require("../symbols/index");

options.$id = `T${Ordinal++}`;
const thisType = callback({ [index_1.Kind]: 'This', $ref: `${options.$id}` });
const thisType = (0, type_1.CloneType)(callback({ [index_1.Kind]: 'This', $ref: `${options.$id}` }));
thisType.$id = options.$id;
// prettier-ignore
return (0, type_1.CloneType)({ ...options, [index_1.Hint]: 'Recursive', ...thisType });
return (0, type_2.CreateType)({ [index_1.Hint]: 'Recursive', ...thisType }, options);
}

@@ -5,2 +5,3 @@ "use strict";

exports.Ref = Ref;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");

@@ -12,12 +13,8 @@ // ------------------------------------------------------------------

/** `[Json]` Creates a Ref type. */
function Ref(unresolved, options = {}) {
function Ref(unresolved, options) {
if ((0, value_1.IsString)(unresolved))
return { ...options, [index_1.Kind]: 'Ref', $ref: unresolved };
return (0, type_1.CreateType)({ [index_1.Kind]: 'Ref', $ref: unresolved }, options);
if ((0, value_1.IsUndefined)(unresolved.$id))
throw new Error('Reference target type must specify an $id');
return {
...options,
[index_1.Kind]: 'Ref',
$ref: unresolved.$id,
};
return (0, type_1.CreateType)({ [index_1.Kind]: 'Ref', $ref: unresolved.$id }, options);
}

@@ -5,8 +5,9 @@ "use strict";

exports.RegExp = RegExp;
const type_1 = require("../create/type");
const value_1 = require("../guard/value");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a RegExp type */
function RegExp(unresolved, options = {}) {
function RegExp(unresolved, options) {
const expr = (0, value_1.IsString)(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
return { ...options, [index_1.Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags };
return (0, type_1.CreateType)({ [index_1.Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags }, options);
}

@@ -11,3 +11,3 @@ import type { SchemaOptions } from '../schema/index';

export type TRequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (Ensure<TMappedResult<P>>);
export declare function RequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options: SchemaOptions): TMappedResult<P>;
export declare function RequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options?: SchemaOptions): TMappedResult<P>;
export {};

@@ -5,2 +5,3 @@ "use strict";

exports.Required = Required;
const type_1 = require("../create/type");
const index_1 = require("../intersect/index");

@@ -10,3 +11,2 @@ const index_2 = require("../union/index");

const index_4 = require("../symbols/index");
const type_1 = require("../clone/type");
const index_5 = require("../discard/index");

@@ -40,3 +40,3 @@ const required_from_mapped_result_1 = require("./required-from-mapped-result");

/** `[Json]` Constructs a type where all properties are required */
function Required(T, options = {}) {
function Required(T, options) {
if ((0, kind_1.IsMappedResult)(T)) {

@@ -47,5 +47,5 @@ return (0, required_from_mapped_result_1.RequiredFromMappedResult)(T, options);

const D = (0, index_5.Discard)(T, [index_4.TransformKind, '$id', 'required']);
const R = (0, type_1.CloneType)(RequiredResolve(T), options);
return { ...D, ...R };
const R = RequiredResolve(T);
return (0, type_1.CreateType)({ ...D, ...R }, options);
}
}

@@ -5,3 +5,3 @@ import type { TSchema } from '../schema/index';

import type { TTuple } from '../tuple/index';
type TRestResolve<T extends TSchema> = T extends TIntersect<infer S> ? [...S] : T extends TUnion<infer S> ? [...S] : T extends TTuple<infer S> ? [...S] : [
type TRestResolve<T extends TSchema> = T extends TIntersect<infer S extends TSchema[]> ? S : T extends TUnion<infer S extends TSchema[]> ? S : T extends TTuple<infer S extends TSchema[]> ? S : [
];

@@ -8,0 +8,0 @@ export type TRest<T extends TSchema> = TRestResolve<T>;

@@ -5,3 +5,2 @@ "use strict";

exports.Rest = Rest;
const type_1 = require("../clone/type");
// ------------------------------------------------------------------

@@ -13,5 +12,5 @@ // TypeGuard

function RestResolve(T) {
return ((0, kind_1.IsIntersect)(T) ? (0, type_1.CloneRest)(T.allOf) :
(0, kind_1.IsUnion)(T) ? (0, type_1.CloneRest)(T.anyOf) :
(0, kind_1.IsTuple)(T) ? (0, type_1.CloneRest)(T.items ?? []) :
return ((0, kind_1.IsIntersect)(T) ? T.allOf :
(0, kind_1.IsUnion)(T) ? T.anyOf :
(0, kind_1.IsTuple)(T) ? T.items ?? [] :
[]);

@@ -21,3 +20,3 @@ }

function Rest(T) {
return (0, type_1.CloneRest)(RestResolve(T));
return RestResolve(T);
}

@@ -5,6 +5,6 @@ "use strict";

exports.ReturnType = ReturnType;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
function ReturnType(schema, options = {}) {
return (0, type_1.CloneType)(schema.returns, options);
function ReturnType(schema, options) {
return (0, type_1.CreateType)(schema.returns, options);
}

@@ -5,6 +5,7 @@ "use strict";

exports.String = String;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a String type */
function String(options = {}) {
return { ...options, [index_1.Kind]: 'String', type: 'string' };
function String(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'String', type: 'string' }, options);
}

@@ -5,6 +5,7 @@ "use strict";

exports.Symbol = Symbol;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Symbol type */
function Symbol(options) {
return { ...options, [index_1.Kind]: 'Symbol', type: 'symbol' };
return (0, type_1.CreateType)({ [index_1.Kind]: 'Symbol', type: 'symbol' }, options);
}

@@ -5,2 +5,3 @@ "use strict";

exports.TemplateLiteral = TemplateLiteral;
const type_1 = require("../create/type");
const syntax_1 = require("./syntax");

@@ -12,7 +13,7 @@ const pattern_1 = require("./pattern");

// prettier-ignore
function TemplateLiteral(unresolved, options = {}) {
function TemplateLiteral(unresolved, options) {
const pattern = (0, value_1.IsString)(unresolved)
? (0, pattern_1.TemplateLiteralPattern)((0, syntax_1.TemplateLiteralSyntax)(unresolved))
: (0, pattern_1.TemplateLiteralPattern)(unresolved);
return { ...options, [index_1.Kind]: 'TemplateLiteral', type: 'string', pattern };
return (0, type_1.CreateType)({ [index_1.Kind]: 'TemplateLiteral', type: 'string', pattern }, options);
}

@@ -7,3 +7,2 @@ "use strict";

const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
// ------------------------------------------------------------------

@@ -42,4 +41,3 @@ // TypeGuard

Encode(encode) {
const schema = (0, type_1.CloneType)(this.schema);
return ((0, kind_1.IsTransform)(schema) ? this.EncodeTransform(encode, schema) : this.EncodeSchema(encode, schema));
return ((0, kind_1.IsTransform)(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema));
}

@@ -46,0 +44,0 @@ }

@@ -5,12 +5,10 @@ "use strict";

exports.Tuple = Tuple;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Tuple type */
function Tuple(items, options = {}) {
// return TupleResolver.Resolve(T)
const [additionalItems, minItems, maxItems] = [false, items.length, items.length];
function Tuple(items, options) {
// prettier-ignore
return (items.length > 0 ?
{ ...options, [index_1.Kind]: 'Tuple', type: 'array', items: (0, type_1.CloneRest)(items), additionalItems, minItems, maxItems } :
{ ...options, [index_1.Kind]: 'Tuple', type: 'array', minItems, maxItems });
return (0, type_1.CreateType)(items.length > 0 ?
{ [index_1.Kind]: 'Tuple', type: 'array', items, additionalItems: false, minItems: items.length, maxItems: items.length } :
{ [index_1.Kind]: 'Tuple', type: 'array', minItems: items.length, maxItems: items.length }, options);
}

@@ -26,15 +26,15 @@ "use strict";

/** `[JavaScript]` Creates a AsyncIterator type */
AsyncIterator(items, options = {}) {
AsyncIterator(items, options) {
return (0, index_1.AsyncIterator)(items, options);
}
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
Awaited(schema, options = {}) {
Awaited(schema, options) {
return (0, index_2.Awaited)(schema, options);
}
/** `[JavaScript]` Creates a BigInt type */
BigInt(options = {}) {
BigInt(options) {
return (0, index_3.BigInt)(options);
}
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
ConstructorParameters(schema, options = {}) {
ConstructorParameters(schema, options) {
return (0, index_5.ConstructorParameters)(schema, options);

@@ -55,23 +55,23 @@ }

/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
InstanceType(schema, options = {}) {
InstanceType(schema, options) {
return (0, index_8.InstanceType)(schema, options);
}
/** `[JavaScript]` Creates an Iterator type */
Iterator(items, options = {}) {
Iterator(items, options) {
return (0, index_9.Iterator)(items, options);
}
/** `[JavaScript]` Extracts the Parameters from the given Function type */
Parameters(schema, options = {}) {
Parameters(schema, options) {
return (0, index_10.Parameters)(schema, options);
}
/** `[JavaScript]` Creates a Promise type */
Promise(item, options = {}) {
Promise(item, options) {
return (0, index_11.Promise)(item, options);
}
/** `[JavaScript]` Creates a RegExp type */
RegExp(unresolved, options = {}) {
RegExp(unresolved, options) {
return (0, index_12.RegExp)(unresolved, options);
}
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
ReturnType(schema, options = {}) {
ReturnType(schema, options) {
return (0, index_13.ReturnType)(schema, options);

@@ -84,11 +84,11 @@ }

/** `[JavaScript]` Creates a Undefined type */
Undefined(options = {}) {
Undefined(options) {
return (0, index_16.Undefined)(options);
}
/** `[JavaScript]` Creates a Uint8Array type */
Uint8Array(options = {}) {
Uint8Array(options) {
return (0, index_15.Uint8Array)(options);
}
/** `[JavaScript]` Creates a Void type */
Void(options = {}) {
Void(options) {
return (0, index_17.Void)(options);

@@ -95,0 +95,0 @@ }

@@ -74,15 +74,15 @@ "use strict";

/** `[Json]` Creates an Any type */
Any(options = {}) {
Any(options) {
return (0, index_1.Any)(options);
}
/** `[Json]` Creates an Array type */
Array(schema, options = {}) {
Array(schema, options) {
return (0, index_2.Array)(schema, options);
}
/** `[Json]` Creates a Boolean type */
Boolean(options = {}) {
Boolean(options) {
return (0, index_3.Boolean)(options);
}
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
Capitalize(schema, options = {}) {
Capitalize(schema, options) {
return (0, index_14.Capitalize)(schema, options);

@@ -95,3 +95,3 @@ }

/** `[JavaScript]` Creates a readonly const type from the given value. */
Const(value, options = {}) {
Const(value, options) {
return (0, index_5.Const)(value, options);

@@ -104,47 +104,47 @@ }

/** `[Json]` Creates a Enum type */
Enum(item, options = {}) {
Enum(item, options) {
return (0, index_7.Enum)(item, options);
}
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
Exclude(unionType, excludedMembers, options = {}) {
Exclude(unionType, excludedMembers, options) {
return (0, index_8.Exclude)(unionType, excludedMembers, options);
}
/** `[Json]` Creates a Conditional type */
Extends(L, R, T, F, options = {}) {
Extends(L, R, T, F, options) {
return (0, index_9.Extends)(L, R, T, F, options);
}
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
Extract(type, union, options = {}) {
Extract(type, union, options) {
return (0, index_10.Extract)(type, union, options);
}
/** `[Json]` Returns an Indexed property type for the given keys */
Index(schema, unresolved, options = {}) {
Index(schema, unresolved, options) {
return (0, index_11.Index)(schema, unresolved, options);
}
/** `[Json]` Creates an Integer type */
Integer(options = {}) {
Integer(options) {
return (0, index_12.Integer)(options);
}
/** `[Json]` Creates an Intersect type */
Intersect(T, options = {}) {
Intersect(T, options) {
return (0, index_13.Intersect)(T, options);
}
/** `[Json]` Creates a KeyOf type */
KeyOf(schema, options = {}) {
KeyOf(schema, options) {
return (0, index_15.KeyOf)(schema, options);
}
/** `[Json]` Creates a Literal type */
Literal(value, options = {}) {
Literal(value, options) {
return (0, index_16.Literal)(value, options);
}
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
Lowercase(schema, options = {}) {
Lowercase(schema, options) {
return (0, index_14.Lowercase)(schema, options);
}
/** `[Json]` Creates a Mapped object type */
Mapped(key, map, options = {}) {
Mapped(key, map, options) {
return (0, index_17.Mapped)(key, map, options);
}
/** `[Json]` Creates a Never type */
Never(options = {}) {
Never(options) {
return (0, index_18.Never)(options);

@@ -157,39 +157,39 @@ }

/** `[Json]` Creates a Null type */
Null(options = {}) {
Null(options) {
return (0, index_20.Null)(options);
}
/** `[Json]` Creates a Number type */
Number(options = {}) {
Number(options) {
return (0, index_21.Number)(options);
}
/** `[Json]` Creates an Object type */
Object(properties, options = {}) {
Object(properties, options) {
return (0, index_22.Object)(properties, options);
}
/** `[Json]` Constructs a type whose keys are omitted from the given type */
Omit(schema, unresolved, options = {}) {
Omit(schema, unresolved, options) {
return (0, index_23.Omit)(schema, unresolved, options);
}
/** `[Json]` Constructs a type where all properties are optional */
Partial(schema, options = {}) {
Partial(schema, options) {
return (0, index_25.Partial)(schema, options);
}
/** `[Json]` Constructs a type whose keys are picked from the given type */
Pick(schema, unresolved, options = {}) {
Pick(schema, unresolved, options) {
return (0, index_26.Pick)(schema, unresolved, options);
}
/** `[Json]` Creates a Record type */
Record(key, schema, options = {}) {
Record(key, schema, options) {
return (0, index_29.Record)(key, schema, options);
}
/** `[Json]` Creates a Recursive type */
Recursive(callback, options = {}) {
Recursive(callback, options) {
return (0, index_30.Recursive)(callback, options);
}
/** `[Json]` Creates a Ref type. */
Ref(unresolved, options = {}) {
Ref(unresolved, options) {
return (0, index_31.Ref)(unresolved, options);
}
/** `[Json]` Constructs a type where all properties are required */
Required(schema, options = {}) {
Required(schema, options) {
return (0, index_32.Required)(schema, options);

@@ -202,7 +202,7 @@ }

/** `[Json]` Creates a String type */
String(options = {}) {
String(options) {
return (0, index_35.String)(options);
}
/** `[Json]` Creates a TemplateLiteral type */
TemplateLiteral(unresolved, options = {}) {
TemplateLiteral(unresolved, options) {
return (0, index_36.TemplateLiteral)(unresolved, options);

@@ -215,23 +215,23 @@ }

/** `[Json]` Creates a Tuple type */
Tuple(items, options = {}) {
Tuple(items, options) {
return (0, index_38.Tuple)(items, options);
}
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
Uncapitalize(schema, options = {}) {
Uncapitalize(schema, options) {
return (0, index_14.Uncapitalize)(schema, options);
}
/** `[Json]` Creates a Union type */
Union(schemas, options = {}) {
Union(schemas, options) {
return (0, index_39.Union)(schemas, options);
}
/** `[Json]` Creates an Unknown type */
Unknown(options = {}) {
Unknown(options) {
return (0, index_40.Unknown)(options);
}
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
Unsafe(options = {}) {
Unsafe(options) {
return (0, index_41.Unsafe)(options);
}
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
Uppercase(schema, options = {}) {
Uppercase(schema, options) {
return (0, index_14.Uppercase)(schema, options);

@@ -238,0 +238,0 @@ }

@@ -5,6 +5,7 @@ "use strict";

exports.Uint8Array = Uint8Array;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Uint8Array type */
function Uint8Array(options = {}) {
return { ...options, [index_1.Kind]: 'Uint8Array', type: 'Uint8Array' };
function Uint8Array(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Uint8Array', type: 'Uint8Array' }, options);
}

@@ -5,6 +5,7 @@ "use strict";

exports.Undefined = Undefined;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Undefined type */
function Undefined(options = {}) {
return { ...options, [index_1.Kind]: 'Undefined', type: 'undefined' };
function Undefined(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Undefined', type: 'undefined' }, options);
}
import type { TSchema, SchemaOptions } from '../schema/index';
import { TUnion } from './union-type';
export declare function UnionCreate<T extends TSchema[]>(T: [...T], options: SchemaOptions): TUnion<T>;
export declare function UnionCreate<T extends TSchema[]>(T: [...T], options?: SchemaOptions): TUnion<T>;

@@ -5,6 +5,6 @@ "use strict";

exports.UnionCreate = UnionCreate;
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
function UnionCreate(T, options) {
return { ...options, [index_1.Kind]: 'Union', anyOf: (0, type_1.CloneRest)(T) };
return (0, type_1.CreateType)({ [index_1.Kind]: 'Union', anyOf: T }, options);
}

@@ -5,4 +5,4 @@ "use strict";

exports.UnionEvaluated = UnionEvaluated;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const type_1 = require("../clone/type");
const index_2 = require("../discard/index");

@@ -35,7 +35,7 @@ const index_3 = require("../never/index");

/** `[Json]` Creates an evaluated Union type */
function UnionEvaluated(T, options = {}) {
function UnionEvaluated(T, options) {
// prettier-ignore
return (T.length === 0 ? (0, index_3.Never)(options) :
T.length === 1 ? (0, type_1.CloneType)(T[0], options) :
T.length === 1 ? (0, type_1.CreateType)(T[0], options) :
ResolveUnion(T, options));
}

@@ -6,10 +6,10 @@ "use strict";

const index_1 = require("../never/index");
const type_1 = require("../clone/type");
const type_1 = require("../create/type");
const union_create_1 = require("./union-create");
/** `[Json]` Creates a Union type */
function Union(T, options = {}) {
function Union(T, options) {
// prettier-ignore
return (T.length === 0 ? (0, index_1.Never)(options) :
T.length === 1 ? (0, type_1.CloneType)(T[0], options) :
T.length === 1 ? (0, type_1.CreateType)(T[0], options) :
(0, union_create_1.UnionCreate)(T, options));
}

@@ -5,9 +5,7 @@ "use strict";

exports.Unknown = Unknown;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates an Unknown type */
function Unknown(options = {}) {
return {
...options,
[index_1.Kind]: 'Unknown',
};
function Unknown(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Unknown' }, options);
}

@@ -5,9 +5,7 @@ "use strict";

exports.Unsafe = Unsafe;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
function Unsafe(options = {}) {
return {
...options,
[index_1.Kind]: options[index_1.Kind] ?? 'Unsafe',
};
return (0, type_1.CreateType)({ [index_1.Kind]: options[index_1.Kind] ?? 'Unsafe' }, options);
}

@@ -5,10 +5,7 @@ "use strict";

exports.Void = Void;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Void type */
function Void(options = {}) {
return {
...options,
[index_1.Kind]: 'Void',
type: 'void',
};
function Void(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Void', type: 'void' }, options);
}
{
"name": "@sinclair/typebox",
"version": "0.32.35",
"version": "0.33.0",
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc