typebox 1.1.3 → 1.1.4

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.
@@ -1,7 +1,7 @@
1
1
  import { type TLocalizedValidationError } from '../error/index.mjs';
2
2
  import * as Schema from './types/index.mjs';
3
3
  import * as Static from './static/index.mjs';
4
- export declare class Validator<Schema extends Schema.XSchema, Value extends unknown = Static.XStatic<Schema>> {
4
+ export declare class Validator<Schema extends Schema.XSchema = Schema.XSchema, Value extends unknown = Static.XStatic<Schema>> {
5
5
  private readonly build;
6
6
  private readonly result;
7
7
  constructor(context: Record<string, Schema.XSchema>, schema: Schema);
@@ -1,9 +1,9 @@
1
1
  type TEscape0<Index extends string> = Index extends `${infer Left}~0${infer Right}` ? `${Left}~${TEscape<Right>}` : Index;
2
2
  type TEscape1<Index extends string> = Index extends `${infer Left}~1${infer Right}` ? `${Left}/${TEscape<Right>}` : Index;
3
3
  type TEscape<Index extends string, Escaped0 extends string = TEscape0<Index>, Escaped1 extends string = TEscape1<Escaped0>> = Escaped1;
4
- type IndicesReduce<Pointer extends string, Result extends string[] = []> = Pointer extends `${infer Left extends string}/${infer Right extends string}` ? Left extends '' ? IndicesReduce<Right, Result> : IndicesReduce<Right, [...Result, TEscape<Left>]> : [...Result, TEscape<Pointer>];
4
+ type IndicesReduce<Pointer extends string, Result extends string[] = []> = (Pointer extends `${infer Left extends string}/${infer Right extends string}` ? Left extends '' ? IndicesReduce<Right, Result> : IndicesReduce<Right, [...Result, TEscape<Left>]> : [...Result, TEscape<Pointer>]);
5
5
  type TIndices<Pointer extends string, Result extends string[] = Pointer extends '' ? [] : IndicesReduce<Pointer>> = Result;
6
- type TResolve<Value extends unknown, Indices extends string[]> = Indices extends [infer Left extends string, ...infer Right extends string[]] ? Left extends keyof Value ? TResolve<Value[Left], Right> : undefined : Value;
6
+ type TResolve<Value extends unknown, Indices extends string[]> = (Indices extends [infer Left extends string, ...infer Right extends string[]] ? Left extends keyof Value ? TResolve<Value[Left], Right> : undefined : Value);
7
7
  /** Type Level RFC 6901 Json Pointer Resolver */
8
8
  export type XPointerGet<Value extends unknown, Pointer extends string, Indices extends string[] = TIndices<Pointer>, Result extends unknown = TResolve<Value, Indices>> = Result;
9
9
  export {};
@@ -1 +1,2 @@
1
+ // deno-fmt-ignore-file
1
2
  export {};
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.3",
4
+ "version": "1.1.4",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"