Socket
Socket
Sign inDemoInstall

@sinclair/typebox

Package Overview
Dependencies
0
Maintainers
1
Versions
306
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.32.0-dev-24 to 0.32.0-dev-25

build/import/type/indexed/indexed-from-mapped-result.d.mts

2

build/require/index.d.ts

@@ -25,3 +25,3 @@ export { Kind, Hint, ReadonlyKind, OptionalKind, TransformKind } from './type/symbols/index';

export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index';
export { Index, IndexPropertyKeys, IndexFromMappedKey, type TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey } from './type/indexed/index';
export { Index, IndexPropertyKeys, IndexFromMappedKey, IndexFromMappedResult, type TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey, type TIndexFromMappedResult } from './type/indexed/index';
export { InstanceType, type TInstanceType } from './type/instance-type/index';

@@ -28,0 +28,0 @@ export { Integer, type TInteger, type IntegerOptions } from './type/integer/index';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Capitalize = exports.IntrinsicFromMappedKey = exports.Intrinsic = exports.Iterator = exports.IntersectEvaluated = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexFromMappedKey = exports.IndexPropertyKeys = exports.Index = exports.Increment = exports.Function = exports.Extract = exports.ExtendsUndefinedCheck = exports.ExtendsResult = exports.ExtendsCheck = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = exports.TypeBoxError = exports.CloneRest = exports.CloneType = exports.ValueGuard = exports.TypeGuard = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternString = exports.PatternNumberExact = exports.PatternNumber = exports.PatternBooleanExact = exports.PatternBoolean = exports.TransformKind = exports.OptionalKind = exports.ReadonlyKind = exports.Hint = exports.Kind = void 0;
exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.TemplateLiteralExpressionGenerate = exports.TemplateLiteralGenerate = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.IsTemplateLiteralExpressionFinite = exports.IsTemplateLiteralFinite = exports.TemplateLiteral = exports.Symbol = exports.String = exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.ReadonlyFromMappedResult = exports.Readonly = exports.Promise = exports.Pick = exports.PartialFromMappedResult = exports.Partial = exports.Parameters = exports.OptionalFromMappedResult = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.MappedResult = exports.MappedKey = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfPropertyKeys = exports.KeyOf = exports.Uppercase = exports.Uncapitalize = exports.Lowercase = void 0;
exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.UnionEvaluated = void 0;
exports.IntrinsicFromMappedKey = exports.Intrinsic = exports.Iterator = exports.IntersectEvaluated = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexFromMappedResult = exports.IndexFromMappedKey = exports.IndexPropertyKeys = exports.Index = exports.Increment = exports.Function = exports.Extract = exports.ExtendsUndefinedCheck = exports.ExtendsResult = exports.ExtendsCheck = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = exports.TypeBoxError = exports.CloneRest = exports.CloneType = exports.ValueGuard = exports.TypeGuard = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternString = exports.PatternNumberExact = exports.PatternNumber = exports.PatternBooleanExact = exports.PatternBoolean = exports.TransformKind = exports.OptionalKind = exports.ReadonlyKind = exports.Hint = exports.Kind = void 0;
exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.TemplateLiteralExpressionGenerate = exports.TemplateLiteralGenerate = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.IsTemplateLiteralExpressionFinite = exports.IsTemplateLiteralFinite = exports.TemplateLiteral = exports.Symbol = exports.String = exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.ReadonlyFromMappedResult = exports.Readonly = exports.Promise = exports.Pick = exports.PartialFromMappedResult = exports.Partial = exports.Parameters = exports.OptionalFromMappedResult = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.MappedResult = exports.MappedKey = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfPropertyKeys = exports.KeyOf = exports.Uppercase = exports.Uncapitalize = exports.Lowercase = exports.Capitalize = void 0;
exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.UnionEvaluated = exports.Union = void 0;
// ------------------------------------------------------------------

@@ -80,2 +80,3 @@ // Infrastructure

Object.defineProperty(exports, "IndexFromMappedKey", { enumerable: true, get: function () { return index_24.IndexFromMappedKey; } });
Object.defineProperty(exports, "IndexFromMappedResult", { enumerable: true, get: function () { return index_24.IndexFromMappedResult; } });
var index_25 = require("./type/instance-type/index");

@@ -82,0 +83,0 @@ Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_25.InstanceType; } });

export * from './indexed-from-mapped-key';
export * from './indexed-from-mapped-result';
export * from './indexed-property-keys';
export * from './indexed';

@@ -19,3 +19,4 @@ "use strict";

__exportStar(require("./indexed-from-mapped-key"), exports);
__exportStar(require("./indexed-from-mapped-result"), exports);
__exportStar(require("./indexed-property-keys"), exports);
__exportStar(require("./indexed"), exports);

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

import { type TIntersect } from '../intersect/index';
import { type TMappedKey } from '../mapped/index';
import { TMappedResult, type TMappedKey } from '../mapped/index';
import { type TUnion } from '../union/index';

@@ -16,2 +16,3 @@ import { type TTuple } from '../tuple/index';

import { type TIndexFromMappedKey } from './indexed-from-mapped-key';
import { type TIndexFromMappedResult } from './indexed-from-mapped-result';
type TFromRest<T extends TSchema[], K extends PropertyKey, Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, K, [...Acc, Assert<TFromKey<L, K>, TSchema>]> : Acc);

@@ -32,2 +33,4 @@ type TFromIntersectRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? TFromIntersectRest<R, [...Acc]> : TFromIntersectRest<R, [...Acc, L]> : Acc);

/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<T extends TSchema, K extends TMappedResult>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedResult<T, K>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedKey<T, K>;

@@ -34,0 +37,0 @@ /** `[Json]` Returns an Indexed property type for the given keys */

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

const indexed_from_mapped_key_1 = require("./indexed-from-mapped-key");
const indexed_from_mapped_result_1 = require("./indexed-from-mapped-result");
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
// prettier-ignore
const type_2 = require("../guard/type");

@@ -91,6 +91,7 @@ // prettier-ignore

// prettier-ignore
return ((0, type_2.IsMappedKey)(K) ? (0, type_1.CloneType)((0, indexed_from_mapped_key_1.IndexFromMappedKey)(T, K, options)) :
(0, type_2.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_2.IsMappedResult)(K) ? (0, type_1.CloneType)((0, indexed_from_mapped_result_1.IndexFromMappedResult)(T, K, options)) :
(0, type_2.IsMappedKey)(K) ? (0, type_1.CloneType)((0, indexed_from_mapped_key_1.IndexFromMappedKey)(T, K, options)) :
(0, type_2.IsSchema)(K) ? (0, type_1.CloneType)(FromSchema(T, (0, indexed_property_keys_1.IndexPropertyKeys)(K)), options) :
(0, type_1.CloneType)(FromSchema(T, K), options));
}
exports.Index = Index;

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

import { type TExtract, type TExtractFromMappedResult } from '../extract/index';
import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey } from '../indexed/index';
import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey, type TIndexFromMappedResult } from '../indexed/index';
import { type IntegerOptions, type TInteger } from '../integer/index';

@@ -97,2 +97,4 @@ import { Intersect, type IntersectOptions } from '../intersect/index';

/** `[Json]` Returns an Indexed property type for the given keys */
Index<T extends TSchema, K extends TMappedResult>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedResult<T, K>;
/** `[Json]` Returns an Indexed property type for the given keys */
Index<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedKey<T, K>;

@@ -99,0 +101,0 @@ /** `[Json]` Returns an Indexed property type for the given keys */

{
"name": "@sinclair/typebox",
"version": "0.32.0-dev-24",
"version": "0.32.0-dev-25",
"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 too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc