typebox 1.0.23 → 1.0.25

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.
@@ -7,7 +7,7 @@ import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
7
7
  export function BuildPrefixItems(context, schema, value) {
8
8
  return E.ReduceAnd(schema.prefixItems.map((schema, index) => {
9
9
  const isLength = E.IsGreaterEqualThan(E.Constant(index), E.Member(value, 'length'));
10
- const isSchema = BuildSchema(context, schema, `value[${index}]`);
10
+ const isSchema = BuildSchema(context, schema, `${value}[${index}]`);
11
11
  const addIndex = context.AddIndex(E.Constant(index));
12
12
  const guarded = context.UseUnevaluated() ? E.And(isSchema, addIndex) : isSchema;
13
13
  return E.Or(isLength, guarded);
@@ -1,11 +1,12 @@
1
+ import type { TLocalizedValidationError } from '../../error/index.mjs';
1
2
  import type { Static, TProperties, TSchema } from '../../type/index.mjs';
2
3
  export declare class AssertError extends Error {
3
4
  readonly cause: {
4
5
  source: string;
5
- errors: object[];
6
+ errors: TLocalizedValidationError[];
6
7
  value: unknown;
7
8
  };
8
- constructor(source: string, value: unknown, errors: object[]);
9
+ constructor(source: string, value: unknown, errors: TLocalizedValidationError[]);
9
10
  }
10
11
  /** Asserts the a value matches the given type. This function returns a TypeScript type asserts predicate and will throw AssertError if value does not match. */
11
12
  export declare function Assert<Context extends TProperties, const Type extends TSchema, Result extends unknown = Static<Type, Context>>(context: Context, type: Type, value: unknown): asserts value is Result;
@@ -1,7 +1,8 @@
1
+ import { type TLocalizedValidationError } from '../../error/errors.mjs';
1
2
  import { type TProperties, type TSchema, type StaticDecode } from '../../type/index.mjs';
2
3
  import { AssertError } from '../assert/index.mjs';
3
4
  export declare class DecodeError extends AssertError {
4
- constructor(value: unknown, errors: object[]);
5
+ constructor(value: unknown, errors: TLocalizedValidationError[]);
5
6
  }
6
7
  /** Executes Decode callbacks only */
7
8
  export declare function DecodeUnsafe(context: TProperties, type: TSchema, value: unknown): unknown;
@@ -1,7 +1,8 @@
1
+ import { type TLocalizedValidationError } from '../../error/errors.mjs';
1
2
  import { type TProperties, type TSchema, type StaticEncode } from '../../type/index.mjs';
2
3
  import { AssertError } from '../assert/index.mjs';
3
4
  export declare class EncodeError extends AssertError {
4
- constructor(value: unknown, errors: object[]);
5
+ constructor(value: unknown, errors: TLocalizedValidationError[]);
5
6
  }
6
7
  /** Executes Encode callbacks only */
7
8
  export declare function EncodeUnsafe(context: TProperties, type: TSchema, value: unknown): unknown;
@@ -1,7 +1,8 @@
1
+ import { type TLocalizedValidationError } from '../../error/errors.mjs';
1
2
  import { type TProperties, type TSchema, type StaticParse } from '../../type/index.mjs';
2
3
  import { AssertError } from '../assert/index.mjs';
3
4
  export declare class ParseError extends AssertError {
4
- constructor(value: unknown, errors: object[]);
5
+ constructor(value: unknown, errors: TLocalizedValidationError[]);
5
6
  }
6
7
  export declare const Parser: import("../pipeline/pipeline.mjs").PipelineInterface;
7
8
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "A Runtime Type System for JavaScript",
4
- "version": "1.0.23",
4
+ "version": "1.0.25",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"