@sinclair/typebox 0.32.19 → 0.32.20

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,35 +1,29 @@
1
1
  import type { Static } from '../../type/static/index.mjs';
2
2
  import { TypeBoxError } from '../../type/error/index.mjs';
3
+ import { type TLiteral } from '../../type/literal/index.mjs';
4
+ import { type TObject } from '../../type/object/index.mjs';
5
+ import { type TString } from '../../type/string/index.mjs';
6
+ import { type TUnknown } from '../../type/unknown/index.mjs';
7
+ import { type TUnion } from '../../type/union/index.mjs';
3
8
  export type Insert = Static<typeof Insert>;
4
- export declare const Insert: import("src/type/object/object.mjs").TObject<{
5
- type: import("src/type/literal/literal.mjs").TLiteral<"insert">;
6
- path: import("src/type/string/string.mjs").TString;
7
- value: import("src/type/unknown/unknown.mjs").TUnknown;
9
+ export declare const Insert: TObject<{
10
+ type: TLiteral<'insert'>;
11
+ path: TString;
12
+ value: TUnknown;
8
13
  }>;
9
14
  export type Update = Static<typeof Update>;
10
- export declare const Update: import("src/type/object/object.mjs").TObject<{
11
- type: import("src/type/literal/literal.mjs").TLiteral<"update">;
12
- path: import("src/type/string/string.mjs").TString;
13
- value: import("src/type/unknown/unknown.mjs").TUnknown;
15
+ export declare const Update: TObject<{
16
+ type: TLiteral<'update'>;
17
+ path: TString;
18
+ value: TUnknown;
14
19
  }>;
15
20
  export type Delete = Static<typeof Delete>;
16
- export declare const Delete: import("src/type/object/object.mjs").TObject<{
17
- type: import("src/type/literal/literal.mjs").TLiteral<"delete">;
18
- path: import("src/type/string/string.mjs").TString;
21
+ export declare const Delete: TObject<{
22
+ type: TLiteral<'delete'>;
23
+ path: TString;
19
24
  }>;
20
25
  export type Edit = Static<typeof Edit>;
21
- export declare const Edit: import("src/type/union/union-type.mjs").TUnion<[import("src/type/object/object.mjs").TObject<{
22
- type: import("src/type/literal/literal.mjs").TLiteral<"insert">;
23
- path: import("src/type/string/string.mjs").TString;
24
- value: import("src/type/unknown/unknown.mjs").TUnknown;
25
- }>, import("src/type/object/object.mjs").TObject<{
26
- type: import("src/type/literal/literal.mjs").TLiteral<"update">;
27
- path: import("src/type/string/string.mjs").TString;
28
- value: import("src/type/unknown/unknown.mjs").TUnknown;
29
- }>, import("src/type/object/object.mjs").TObject<{
30
- type: import("src/type/literal/literal.mjs").TLiteral<"delete">;
31
- path: import("src/type/string/string.mjs").TString;
32
- }>]>;
26
+ export declare const Edit: TUnion<[typeof Insert, typeof Update, typeof Delete]>;
33
27
  export declare class ValueDeltaError extends TypeBoxError {
34
28
  readonly value: unknown;
35
29
  constructor(value: unknown, message: string);
@@ -2,26 +2,26 @@ import { IsStandardObject, IsArray, IsTypedArray, IsValueType, IsSymbol, IsUndef
2
2
  import { ValuePointer } from '../pointer/index.mjs';
3
3
  import { Clone } from '../clone/index.mjs';
4
4
  import { TypeBoxError } from '../../type/error/index.mjs';
5
- import { Literal as CreateLiteral } from '../../type/literal/index.mjs';
6
- import { Object as CreateObject } from '../../type/object/index.mjs';
7
- import { String as CreateString } from '../../type/string/index.mjs';
8
- import { Unknown as CreateUnknown } from '../../type/unknown/index.mjs';
9
- import { Union as CreateUnion } from '../../type/union/index.mjs';
10
- export const Insert = CreateObject({
11
- type: CreateLiteral('insert'),
12
- path: CreateString(),
13
- value: CreateUnknown(),
5
+ import { Literal } from '../../type/literal/index.mjs';
6
+ import { Object } from '../../type/object/index.mjs';
7
+ import { String } from '../../type/string/index.mjs';
8
+ import { Unknown } from '../../type/unknown/index.mjs';
9
+ import { Union } from '../../type/union/index.mjs';
10
+ export const Insert = Object({
11
+ type: Literal('insert'),
12
+ path: String(),
13
+ value: Unknown(),
14
14
  });
15
- export const Update = CreateObject({
16
- type: CreateLiteral('update'),
17
- path: CreateString(),
18
- value: CreateUnknown(),
15
+ export const Update = Object({
16
+ type: Literal('update'),
17
+ path: String(),
18
+ value: Unknown(),
19
19
  });
20
- export const Delete = CreateObject({
21
- type: CreateLiteral('delete'),
22
- path: CreateString(),
20
+ export const Delete = Object({
21
+ type: Literal('delete'),
22
+ path: String(),
23
23
  });
24
- export const Edit = CreateUnion([Insert, Update, Delete]);
24
+ export const Edit = Union([Insert, Update, Delete]);
25
25
  // ------------------------------------------------------------------
26
26
  // Errors
27
27
  // ------------------------------------------------------------------
@@ -1,35 +1,29 @@
1
1
  import type { Static } from '../../type/static/index';
2
2
  import { TypeBoxError } from '../../type/error/index';
3
+ import { type TLiteral } from '../../type/literal/index';
4
+ import { type TObject } from '../../type/object/index';
5
+ import { type TString } from '../../type/string/index';
6
+ import { type TUnknown } from '../../type/unknown/index';
7
+ import { type TUnion } from '../../type/union/index';
3
8
  export type Insert = Static<typeof Insert>;
4
- export declare const Insert: import("src/type/object/object").TObject<{
5
- type: import("src/type/literal/literal").TLiteral<"insert">;
6
- path: import("src/type/string/string").TString;
7
- value: import("src/type/unknown/unknown").TUnknown;
9
+ export declare const Insert: TObject<{
10
+ type: TLiteral<'insert'>;
11
+ path: TString;
12
+ value: TUnknown;
8
13
  }>;
9
14
  export type Update = Static<typeof Update>;
10
- export declare const Update: import("src/type/object/object").TObject<{
11
- type: import("src/type/literal/literal").TLiteral<"update">;
12
- path: import("src/type/string/string").TString;
13
- value: import("src/type/unknown/unknown").TUnknown;
15
+ export declare const Update: TObject<{
16
+ type: TLiteral<'update'>;
17
+ path: TString;
18
+ value: TUnknown;
14
19
  }>;
15
20
  export type Delete = Static<typeof Delete>;
16
- export declare const Delete: import("src/type/object/object").TObject<{
17
- type: import("src/type/literal/literal").TLiteral<"delete">;
18
- path: import("src/type/string/string").TString;
21
+ export declare const Delete: TObject<{
22
+ type: TLiteral<'delete'>;
23
+ path: TString;
19
24
  }>;
20
25
  export type Edit = Static<typeof Edit>;
21
- export declare const Edit: import("src/type/union/union-type").TUnion<[import("src/type/object/object").TObject<{
22
- type: import("src/type/literal/literal").TLiteral<"insert">;
23
- path: import("src/type/string/string").TString;
24
- value: import("src/type/unknown/unknown").TUnknown;
25
- }>, import("src/type/object/object").TObject<{
26
- type: import("src/type/literal/literal").TLiteral<"update">;
27
- path: import("src/type/string/string").TString;
28
- value: import("src/type/unknown/unknown").TUnknown;
29
- }>, import("src/type/object/object").TObject<{
30
- type: import("src/type/literal/literal").TLiteral<"delete">;
31
- path: import("src/type/string/string").TString;
32
- }>]>;
26
+ export declare const Edit: TUnion<[typeof Insert, typeof Update, typeof Delete]>;
33
27
  export declare class ValueDeltaError extends TypeBoxError {
34
28
  readonly value: unknown;
35
29
  constructor(value: unknown, message: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.32.19",
3
+ "version": "0.32.20",
4
4
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",