typebox 1.1.28 → 1.1.29

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.
@@ -6,24 +6,24 @@ import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
6
6
  // ------------------------------------------------------------------
7
7
  export function BuildRefine(_stack, _context, schema, value) {
8
8
  const refinements = V.CreateVariable(schema['~refine'].map((refinement) => refinement));
9
- return E.Every(refinements, E.Constant(0), ['refinement', '_'], E.Call(E.Member('refinement', 'refine'), [value]));
9
+ return E.Every(refinements, E.Constant(0), ['refinement', '_'], E.Call(E.Member('refinement', 'check'), [value]));
10
10
  }
11
11
  // ------------------------------------------------------------------
12
12
  // Check
13
13
  // ------------------------------------------------------------------
14
14
  export function CheckRefine(_stack, _context, schema, value) {
15
- return G.Every(schema['~refine'], 0, (refinement, _) => refinement.refine(value));
15
+ return G.Every(schema['~refine'], 0, (refinement, _) => refinement.check(value));
16
16
  }
17
17
  // ------------------------------------------------------------------
18
18
  // Error
19
19
  // ------------------------------------------------------------------
20
20
  export function ErrorRefine(_stack, context, schemaPath, instancePath, schema, value) {
21
21
  return G.EveryAll(schema['~refine'], 0, (refinement, index) => {
22
- return refinement.refine(value) || context.AddError({
22
+ return refinement.check(value) || context.AddError({
23
23
  keyword: '~refine',
24
24
  schemaPath,
25
25
  instancePath,
26
- params: { index, message: refinement.message },
26
+ params: { index, message: refinement.error(value) },
27
27
  });
28
28
  });
29
29
  }
@@ -1,7 +1,7 @@
1
1
  import type { XSchemaObject } from './schema.mjs';
2
2
  export interface XRefinement {
3
- refine: (value: unknown) => boolean;
4
- message: string;
3
+ check: (value: unknown) => boolean;
4
+ error: (value: unknown) => string;
5
5
  }
6
6
  export interface XRefine<Refinements extends XRefinement[] = XRefinement[]> {
7
7
  '~refine': Refinements;
@@ -11,8 +11,8 @@ export function IsRefine(value) {
11
11
  return Guard.HasPropertyKey(value, '~refine')
12
12
  && Guard.IsArray(value["~refine"])
13
13
  && Guard.Every(value['~refine'], 0, value => Guard.IsObject(value)
14
- && Guard.HasPropertyKey(value, 'refine')
15
- && Guard.HasPropertyKey(value, 'message')
16
- && Guard.IsFunction(value.refine)
17
- && Guard.IsString(value.message));
14
+ && Guard.HasPropertyKey(value, 'check')
15
+ && Guard.HasPropertyKey(value, 'error')
16
+ && Guard.IsFunction(value.check)
17
+ && Guard.IsFunction(value.error));
18
18
  }
@@ -1,9 +1,14 @@
1
1
  import { type TProperties } from '../../types/properties.mjs';
2
2
  import { type TSchema } from '../../types/schema.mjs';
3
+ import { type TNumber } from '../../types/number.mjs';
4
+ import { type TPropertyKeys } from '../../types/properties.mjs';
3
5
  import { type TEvaluateUnion } from '../evaluate/evaluate.mjs';
4
6
  import { type TToIndexableKeys } from '../indexable/to-indexable-keys.mjs';
5
- type TSelectProperty<Properties extends TProperties, Key extends string, PropertyKey extends string = keyof Properties extends string | number ? `${keyof Properties}` : never, Result extends TSchema[] = Key extends PropertyKey ? [Properties[Key]] : []> = Result;
7
+ type TSelectProperty<Properties extends TProperties, Key extends string, CanonicalKey extends string = keyof Properties extends string | number ? `${keyof Properties}` : never, Result extends TSchema[] = Key extends CanonicalKey ? [Properties[Key]] : []> = Result;
6
8
  type TSelectProperties<Properties extends TProperties, Keys extends string[], Result extends TSchema[] = []> = (Keys extends [infer Left extends string, ...infer Right extends string[]] ? TSelectProperties<Properties, Right, [...Result, ...TSelectProperty<Properties, Left>]> : Result);
7
- export type TFromObject<Properties extends TProperties, Indexer extends TSchema, Keys extends string[] = TToIndexableKeys<Indexer>, Variants extends TSchema[] = TSelectProperties<Properties, Keys>, Result extends TSchema = TEvaluateUnion<Variants>> = Result;
9
+ type TFromIndexer<Properties extends TProperties, Indexer extends TSchema, Keys extends string[] = TToIndexableKeys<Indexer>, Variants extends TSchema[] = TSelectProperties<Properties, Keys>, Result extends TSchema = TEvaluateUnion<Variants>> = Result;
10
+ type TNumericKeys<Keys extends string[], Result extends string[] = []> = (Keys extends [infer Left extends string, ...infer Right extends string[]] ? Left extends `${infer _ extends number}` ? TNumericKeys<Right, [...Result, Left]> : TNumericKeys<Right, Result> : Result);
11
+ type TFromIndexerNumber<Properties extends TProperties, Keys extends string[] = TPropertyKeys<Properties>, NumericKeys extends string[] = TNumericKeys<Keys>, Variants extends TSchema[] = TSelectProperties<Properties, NumericKeys>, Result extends TSchema = TEvaluateUnion<Variants>> = Result;
12
+ export type TFromObject<Properties extends TProperties, Indexer extends TSchema, Result extends TSchema = Indexer extends TNumber ? TFromIndexerNumber<Properties> : TFromIndexer<Properties, Indexer>> = Result;
8
13
  export declare function FromObject<Properties extends TProperties, Indexer extends TSchema>(properties: Properties, indexer: Indexer): TFromObject<Properties, Indexer>;
9
14
  export {};
@@ -1,18 +1,37 @@
1
1
  // deno-fmt-ignore-file
2
+ import { IsNumber } from '../../types/number.mjs';
3
+ import { PropertyKeys } from '../../types/properties.mjs';
2
4
  import { EvaluateUnion } from '../evaluate/evaluate.mjs';
3
5
  import { ToIndexableKeys } from '../indexable/to-indexable-keys.mjs';
4
- function SelectProperty(properties, indexer) {
5
- const result = indexer in properties ? [properties[indexer]] : [];
6
+ import { IntegerKey } from '../../types/record.mjs';
7
+ function SelectProperty(properties, key) {
8
+ const result = key in properties ? [properties[key]] : [];
6
9
  return result;
7
10
  }
8
- function SelectProperties(properties, indexer) {
9
- return indexer.reduce((result, left) => {
11
+ function SelectProperties(properties, keys) {
12
+ return keys.reduce((result, left) => {
10
13
  return [...result, ...SelectProperty(properties, left)];
11
14
  }, []);
12
15
  }
13
- export function FromObject(properties, indexer) {
16
+ function FromIndexer(properties, indexer) {
14
17
  const keys = ToIndexableKeys(indexer);
15
18
  const variants = SelectProperties(properties, keys);
16
19
  const result = EvaluateUnion(variants);
17
20
  return result;
18
21
  }
22
+ const NumericKeyPattern = new RegExp(IntegerKey);
23
+ function NumericKeys(keys) {
24
+ const result = keys.filter(key => NumericKeyPattern.test(key));
25
+ return result;
26
+ }
27
+ function FromIndexerNumber(properties) {
28
+ const keys = PropertyKeys(properties);
29
+ const numericKeys = NumericKeys(keys);
30
+ const variants = SelectProperties(properties, numericKeys);
31
+ const result = EvaluateUnion(variants);
32
+ return result;
33
+ }
34
+ export function FromObject(properties, indexer) {
35
+ const result = IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
36
+ return result;
37
+ }
@@ -1,5 +1,5 @@
1
1
  import { type TSchema } from '../../types/index.mjs';
2
- import { type TLiteral } from '../../types/literal.mjs';
2
+ import { type TLiteral, type TLiteralValue } from '../../types/literal.mjs';
3
3
  import { type TEnum, type TEnumValue } from '../../types/enum.mjs';
4
4
  import { type TTemplateLiteral } from '../../types/template-literal.mjs';
5
5
  import { type TUnion } from '../../types/union.mjs';
@@ -7,7 +7,8 @@ import { type TEnumValuesToVariants } from '../enum/index.mjs';
7
7
  import { type TTemplateLiteralDecode } from '../template-literal/decode.mjs';
8
8
  type TFromTemplateLiteral<Pattern extends string, Decoded extends TSchema = TTemplateLiteralDecode<Pattern>, Result extends TSchema[] = TFromType<Decoded>> = Result;
9
9
  type TFromUnion<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion<Right, [...Result, ...TFromType<Left>]> : Result);
10
- type TFromType<Type extends TSchema, Result extends TSchema[] = (Type extends TEnum<infer Values extends TEnumValue[]> ? TFromUnion<TEnumValuesToVariants<Values>> : Type extends TLiteral<string | number> ? [Type] : Type extends TTemplateLiteral<infer Pattern extends string> ? TFromTemplateLiteral<Pattern> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion<Types> : [
10
+ type TFromLiteral<Value extends TLiteralValue, Result extends TSchema[] = Value extends number ? [TLiteral<`${Value}`>] : [TLiteral<Value>]> = Result;
11
+ type TFromType<Type extends TSchema, Result extends TSchema[] = (Type extends TEnum<infer Values extends TEnumValue[]> ? TFromUnion<TEnumValuesToVariants<Values>> : Type extends TLiteral<infer Value extends number> ? TFromLiteral<Value> : Type extends TTemplateLiteral<infer Pattern extends string> ? TFromTemplateLiteral<Pattern> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion<Types> : [
11
12
  Type
12
13
  ])> = Result;
13
14
  export type TMappedVariants<Type extends TSchema, Result extends TSchema[] = TFromType<Type>> = Result;
@@ -1,5 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
- import { IsLiteralNumber, IsLiteralString } from '../../types/literal.mjs';
2
+ import { Guard } from '../../../guard/index.mjs';
3
+ import { Literal, IsLiteral } from '../../types/literal.mjs';
3
4
  import { IsEnum } from '../../types/enum.mjs';
4
5
  import { IsTemplateLiteral } from '../../types/template-literal.mjs';
5
6
  import { IsUnion } from '../../types/union.mjs';
@@ -15,9 +16,13 @@ function FromUnion(types) {
15
16
  return [...result, ...FromType(left)];
16
17
  }, []);
17
18
  }
19
+ function FromLiteral(value) {
20
+ const result = Guard.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];
21
+ return result;
22
+ }
18
23
  function FromType(type) {
19
24
  const result = (IsEnum(type) ? FromUnion(EnumValuesToVariants(type.enum)) :
20
- IsLiteralString(type) || IsLiteralNumber(type) ? [type] :
25
+ IsLiteral(type) ? FromLiteral(type.const) :
21
26
  IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) :
22
27
  IsUnion(type) ? FromUnion(type.anyOf) :
23
28
  [type]);
@@ -1,11 +1,13 @@
1
1
  import { type TSchema } from '../types/schema.mjs';
2
2
  import { type TProperties } from '../types/properties.mjs';
3
3
  import { type TCyclic } from '../types/cyclic.mjs';
4
+ import { type TUnknown } from '../types/unknown.mjs';
5
+ import { type TUnsafe } from '../types/unsafe.mjs';
4
6
  import { type TExtendsLeft } from './extends-left.mjs';
5
7
  import { type TCyclicExtends } from '../engine/cyclic/index.mjs';
6
- type TNormal<Type extends TSchema> = (Type extends TCyclic ? TCyclicExtends<Type> : Type);
8
+ type TCanonical<Type extends TSchema> = (Type extends TCyclic ? TCyclicExtends<Type> : Type extends TUnsafe ? TUnknown : Type);
7
9
  /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
8
- export type TExtends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema, NormalLeft extends TSchema = TNormal<Left>, NormalRight extends TSchema = TNormal<Right>> = TExtendsLeft<Inferred, NormalLeft, NormalRight>;
10
+ export type TExtends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema, CanonicalLeft extends TSchema = TCanonical<Left>, CanonicalRight extends TSchema = TCanonical<Right>> = TExtendsLeft<Inferred, CanonicalLeft, CanonicalRight>;
9
11
  /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
10
12
  export declare function Extends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtends<Inferred, Left, Right>;
11
13
  export {};
@@ -1,15 +1,17 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { IsCyclic } from '../types/cyclic.mjs';
3
+ import { Unknown } from '../types/unknown.mjs';
4
+ import { IsUnsafe } from '../types/unsafe.mjs';
3
5
  import { ExtendsLeft } from './extends-left.mjs';
4
6
  import { CyclicExtends } from '../engine/cyclic/index.mjs';
5
- function Normal(type) {
6
- return (IsCyclic(type)
7
- ? CyclicExtends(type)
8
- : type);
7
+ function Canonical(type) {
8
+ return (IsCyclic(type) ? CyclicExtends(type) :
9
+ IsUnsafe(type) ? Unknown() :
10
+ type);
9
11
  }
10
12
  /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
11
13
  export function Extends(inferred, left, right) {
12
- const normalLeft = Normal(left);
13
- const normalRight = Normal(right);
14
- return ExtendsLeft(inferred, normalLeft, normalRight);
14
+ const canonicalLeft = Canonical(left);
15
+ const canonicalRight = Canonical(right);
16
+ return ExtendsLeft(inferred, canonicalLeft, canonicalRight);
15
17
  }
@@ -8,12 +8,19 @@ export declare function RefineAdd<Type extends TSchema>(type: Type, refinement:
8
8
  export type TRefine<Type extends TSchema = TSchema> = (Type & {
9
9
  '~refine': TRefinement<Type>[];
10
10
  });
11
- export type TRefineCallback<Type extends TSchema> = (value: Static<Type>) => boolean;
11
+ export type TRefineCheckCallback<Type extends TSchema = TSchema> = (value: Static<Type>) => boolean;
12
+ export type TRefineErrorCallback<Type extends TSchema = TSchema> = (value: Static<Type>) => string;
12
13
  export interface TRefinement<Type extends TSchema = TSchema> {
13
- refine: TRefineCallback<Type>;
14
- message: string;
14
+ check: TRefineCheckCallback<Type>;
15
+ error: TRefineErrorCallback<Type>;
15
16
  }
16
- /** Applies a Refine check to the given type. */
17
- export declare function Refine<Type extends TSchema>(type: Type, refine: TRefineCallback<Type>, message?: string): TRefineAdd<Type>;
17
+ /** Refines a type with an explicit check */
18
+ export declare function Refine<Type extends TSchema>(type: Type, check: TRefineCheckCallback<Type>, error: TRefineErrorCallback<Type>): TRefineAdd<Type>;
19
+ /** Refines a type with an explicit check */
20
+ export declare function Refine<Type extends TSchema>(type: Type, check: TRefineCheckCallback<Type>): TRefineAdd<Type>;
21
+ /** @deprecated Use the error callback signature to generate error message. This overload will be removed in the next version */
22
+ export declare function Refine<Type extends TSchema>(type: Type, check: TRefineCheckCallback<Type>, message: string): TRefineAdd<Type>;
23
+ /** Returns true if the given value is a TRefinement. */
24
+ export declare function IsRefinement(value: unknown): value is TRefinement;
18
25
  /** Returns true if the given value is a TRefine. */
19
- export declare function IsRefine(value: unknown): value is TRefine<TSchema>;
26
+ export declare function IsRefine(value: unknown): value is TRefine;
@@ -1,4 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
+ import { Arguments } from '../../system/arguments/index.mjs';
2
3
  import { Memory } from '../../system/memory/index.mjs';
3
4
  import { Guard } from '../../guard/index.mjs';
4
5
  import { IsSchema } from './schema.mjs';
@@ -7,14 +8,30 @@ export function RefineAdd(type, refinement) {
7
8
  const refinements = IsRefine(type) ? [...type['~refine'], refinement] : [refinement];
8
9
  return Memory.Update(type, { '~refine': refinements }, {});
9
10
  }
10
- /** Applies a Refine check to the given type. */
11
- export function Refine(type, refine, message = 'error') {
12
- return RefineAdd(type, { refine, message });
11
+ /** Refines a type with an explicit check */
12
+ export function Refine(...args) {
13
+ const [type, check, error_or_message] = Arguments.Match(args, {
14
+ 3: (type, check, error) => [type, check, error],
15
+ 2: (type, check) => [type, check, () => 'Refine Error'],
16
+ });
17
+ const error = Guard.IsString(error_or_message) ? () => error_or_message : error_or_message;
18
+ return RefineAdd(type, { check, error });
13
19
  }
14
20
  // ------------------------------------------------------------------
15
21
  // Guard
16
22
  // ------------------------------------------------------------------
23
+ /** Returns true if the given value is a TRefinement. */
24
+ export function IsRefinement(value) {
25
+ return Guard.IsObjectNotArray(value)
26
+ && Guard.HasPropertyKey(value, 'check')
27
+ && Guard.HasPropertyKey(value, 'error')
28
+ && Guard.IsFunction(value.check)
29
+ && Guard.IsFunction(value.error);
30
+ }
17
31
  /** Returns true if the given value is a TRefine. */
18
32
  export function IsRefine(value) {
19
- return IsSchema(value) && Guard.HasPropertyKey(value, '~refine');
33
+ return IsSchema(value)
34
+ && Guard.HasPropertyKey(value, '~refine')
35
+ && Guard.IsArray(value['~refine'])
36
+ && Guard.Every(value['~refine'], 0, value => IsRefinement(value));
20
37
  }
@@ -30,8 +30,9 @@ export type TRequiredArray<Properties extends TProperties, RequiredProperties ex
30
30
  }, RequiredKeys extends string[] = TUnionToTuple<Extract<keyof RequiredProperties, string>>, Result extends string[] | undefined = RequiredKeys extends [] ? undefined : RequiredKeys> = Result;
31
31
  /** Creates a RequiredArray derived from the given TProperties value. */
32
32
  export declare function RequiredArray<Properties extends TProperties>(properties: Properties): TRequiredArray<Properties>;
33
+ type TKeyToString<Key extends number | string> = `${Key}`;
33
34
  /** Extracts a tuple of keys from a TProperties value. */
34
- export type TPropertyKeys<Properties extends TProperties, Result extends string[] = TUnionToTuple<Extract<keyof Properties, string>>> = Result;
35
+ export type TPropertyKeys<Properties extends TProperties, ExtractKey extends number | string = Extract<keyof Properties, number | string>, StringKey extends string = TKeyToString<ExtractKey>, Result extends string[] = TUnionToTuple<StringKey>> = Result;
35
36
  /** Extracts a tuple of keys from a TProperties value. */
36
37
  export declare function PropertyKeys<Properties extends TProperties>(properties: Properties): TPropertyKeys<Properties>;
37
38
  type TPropertyValuesReduce<Properties extends TProperties, Keys extends string[], Result extends TSchema[] = []> = Keys extends [infer Left extends string, ...infer Right extends string[]] ? Left extends keyof Properties ? TPropertyValuesReduce<Properties, Right, [...Result, Properties[Left]]> : TPropertyValuesReduce<Properties, Right, Result> : Result;
@@ -27,8 +27,6 @@ export interface TRecord<Key extends string = string, Value extends TSchema = TS
27
27
  export type TRecordDeferred<Key extends TSchema = TSchema, Value extends TSchema = TSchema> = (TDeferred<'Record', [Key, Value]>);
28
28
  /** Represents a deferred Record action. */
29
29
  export declare function RecordDeferred<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: TObjectOptions): TRecordDeferred<Key, Value>;
30
- /** Returns true if this value is a deferred Interface action. */
31
- export declare function IsRecordDeferred(value: unknown): value is TRecordDeferred;
32
30
  /** Creates a Record type. */
33
31
  export declare function Record<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: TObjectOptions): TRecordAction<Key, Value>;
34
32
  /** Creates a Record type from regular expression pattern. */
@@ -1,7 +1,7 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Memory } from '../../system/memory/index.mjs';
3
3
  import { Guard } from '../../guard/index.mjs';
4
- import { IsKind, IsSchema } from './schema.mjs';
4
+ import { IsKind } from './schema.mjs';
5
5
  import { Integer, IntegerPattern } from './integer.mjs';
6
6
  import { Number, NumberPattern } from './number.mjs';
7
7
  import { String, StringPattern } from './string.mjs';
@@ -16,15 +16,6 @@ export const StringKey = `^${StringPattern}$`;
16
16
  export function RecordDeferred(key, value, options = {}) {
17
17
  return Deferred('Record', [key, value], options);
18
18
  }
19
- // ------------------------------------------------------------------
20
- // Guard
21
- // ------------------------------------------------------------------
22
- /** Returns true if this value is a deferred Interface action. */
23
- export function IsRecordDeferred(value) {
24
- return IsSchema(value)
25
- && Guard.HasPropertyKey(value, 'action')
26
- && Guard.IsEqual(value.action, 'Record');
27
- }
28
19
  // -------------------------------------------------------------------
29
20
  // Factory
30
21
  // -------------------------------------------------------------------
@@ -2,8 +2,7 @@ import { type TSchema } from './schema.mjs';
2
2
  export type StaticUnsafe<Type extends unknown> = Type;
3
3
  /** Represents an Unsafe type. */
4
4
  export interface TUnsafe<Type extends unknown = unknown> extends TSchema {
5
- '~kind': 'Unsafe';
6
- '~hint': Type;
5
+ '~unsafe': Type;
7
6
  }
8
7
  /** Creates a Unsafe type. */
9
8
  export declare function Unsafe<Type extends unknown>(schema: TSchema): TUnsafe<Type>;
@@ -1,18 +1,20 @@
1
1
  // deno-fmt-ignore-file
2
2
  // deno-lint-ignore-file
3
+ import { Guard } from '../../guard/index.mjs';
3
4
  import { Memory } from '../../system/memory/index.mjs';
4
- import { IsKind } from './schema.mjs';
5
5
  // ------------------------------------------------------------------
6
6
  // Factory
7
7
  // ------------------------------------------------------------------
8
8
  /** Creates a Unsafe type. */
9
9
  export function Unsafe(schema) {
10
- return Memory.Create({ ['~kind']: 'Unsafe' }, {}, schema);
10
+ return Memory.Update(schema, { ['~unsafe']: null }, {});
11
11
  }
12
12
  // ------------------------------------------------------------------
13
13
  // Guard
14
14
  // ------------------------------------------------------------------
15
15
  /** Returns true if the given value is TUnsafe. */
16
16
  export function IsUnsafe(value) {
17
- return IsKind(value, 'Unsafe');
17
+ return Guard.IsObjectNotArray(value)
18
+ && Guard.HasPropertyKey(value, '~unsafe')
19
+ && Guard.IsNull(value['~unsafe']);
18
20
  }
@@ -30,7 +30,7 @@ export { Codec, Decode, DecodeBuilder, Encode, EncodeBuilder, IsCodec, type TCod
30
30
  export { Immutable, IsImmutable, type TImmutable } from './type/types/_immutable.mjs';
31
31
  export { IsOptional, Optional, type TOptional } from './type/types/_optional.mjs';
32
32
  export { IsReadonly, Readonly, type TReadonly } from './type/types/_readonly.mjs';
33
- export { IsRefine, Refine, type TRefine, type TRefineCallback, type TRefinement } from './type/types/_refine.mjs';
33
+ export { IsRefine, Refine, type TRefine, type TRefineCheckCallback, type TRefineErrorCallback, type TRefinement } from './type/types/_refine.mjs';
34
34
  export { Any, IsAny, type TAny } from './type/types/any.mjs';
35
35
  export { Array, IsArray, type TArray } from './type/types/array.mjs';
36
36
  export { AsyncIterator, IsAsyncIterator, type TAsyncIterator } from './type/types/async-iterator.mjs';
@@ -5,5 +5,7 @@ export type TMutable = {
5
5
  * Performs a deep structural assignment, applying values from next to current while retaining internal references. This function
6
6
  * is written for use in infrastructure that interprets reference changes as a signal to perform some action (i.e. React redraw), this
7
7
  * function can mitigate this by applying mutable updates deep within a value, ensuring parent references are retained.
8
+ *
9
+ * @deprecated This function is being removed in the next version but will be retained as a reference under examples.
8
10
  */
9
11
  export declare function Mutate(current: TMutable, next: TMutable): void;
@@ -29,6 +29,8 @@ function IsMismatchedValue(left, right) {
29
29
  * Performs a deep structural assignment, applying values from next to current while retaining internal references. This function
30
30
  * is written for use in infrastructure that interprets reference changes as a signal to perform some action (i.e. React redraw), this
31
31
  * function can mitigate this by applying mutable updates deep within a value, ensuring parent references are retained.
32
+ *
33
+ * @deprecated This function is being removed in the next version but will be retained as a reference under examples.
32
34
  */
33
35
  export function Mutate(current, next) {
34
36
  if (IsNonMutableValue(current) || IsNonMutableValue(next))
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.1.28",
4
+ "version": "1.1.29",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"