arktype 2.0.0-rc.23 → 2.0.0-rc.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.
package/out/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { ArkError, ArkErrors, type ArkConfig, type ArkScopeConfig, type JsonSchema } from "@ark/schema";
2
2
  export { Hkt, inferred } from "@ark/util";
3
+ export type { distill } from "./attributes.ts";
4
+ export * from "./config.ts";
3
5
  export { Generic } from "./generic.ts";
4
6
  export { ark, declare, define, generic, keywords, type, type Ark } from "./keywords/keywords.ts";
5
7
  export { Module, type BoundModule, type Submodule } from "./module.ts";
package/out/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { ArkError, ArkErrors } from "@ark/schema";
2
2
  export { Hkt, inferred } from "@ark/util";
3
+ export * from "./config.js";
3
4
  export { Generic } from "./generic.js";
4
5
  export { ark, declare, define, generic, keywords, type } from "./keywords/keywords.js";
5
6
  export { Module } from "./module.js";
@@ -36,9 +36,9 @@ export declare const ark: Scope<Ark>;
36
36
  export declare const keywords: Module<Ark>;
37
37
  export declare const type: TypeParser<{}>;
38
38
  export declare namespace type {
39
- type cast<t> = {
40
- [inferred]?: t;
41
- };
39
+ interface cast<to> {
40
+ [inferred]?: to;
41
+ }
42
42
  type errors = ArkErrors;
43
43
  /** @ts-ignore cast variance */
44
44
  interface Any<out t = any> extends BaseType<t, any> {
@@ -69,9 +69,9 @@ export declare const string: Module<{
69
69
  v7: unknown;
70
70
  v8: unknown;
71
71
  }>;
72
- upper: Submodule<upper.submodule>;
73
- lower: Submodule<lower.submodule>;
74
72
  capitalize: Submodule<capitalize.submodule>;
73
+ lower: Submodule<lower.submodule>;
74
+ upper: Submodule<upper.submodule>;
75
75
  }>;
76
76
  export type Matching<rule> = {
77
77
  matching: constraint<rule>;
@@ -100,22 +100,22 @@ export declare namespace string {
100
100
  alpha: alpha;
101
101
  alphanumeric: alphanumeric;
102
102
  base64: base64.submodule;
103
- digits: digits;
104
- numeric: stringNumeric.submodule;
105
- integer: stringInteger.submodule;
103
+ capitalize: capitalize.submodule;
106
104
  creditCard: creditCard;
105
+ date: stringDate.submodule;
106
+ digits: digits;
107
107
  email: email;
108
- uuid: uuid.submodule;
109
- semver: semver;
108
+ integer: stringInteger.submodule;
110
109
  ip: ip.submodule;
111
110
  json: stringJson.submodule;
112
- date: stringDate.submodule;
113
- url: url.submodule;
114
- trim: trim.submodule;
115
- normalize: normalize.submodule;
116
- capitalize: capitalize.submodule;
117
111
  lower: lower.submodule;
112
+ normalize: normalize.submodule;
113
+ numeric: stringNumeric.submodule;
114
+ semver: semver;
115
+ trim: trim.submodule;
118
116
  upper: upper.submodule;
117
+ url: url.submodule;
118
+ uuid: uuid.submodule;
119
119
  };
120
120
  type branded<rule> = brand<string, Nominal<rule>>;
121
121
  namespace branded {
@@ -21,23 +21,23 @@ import { url } from "./url.js";
21
21
  import { uuid } from "./uuid.js";
22
22
  export const string = arkModule({
23
23
  root: intrinsic.string,
24
- numeric,
25
- integer,
26
24
  alpha,
27
25
  alphanumeric,
28
26
  base64,
29
- digits,
30
- semver,
31
- ip,
27
+ capitalize,
32
28
  creditCard,
29
+ date: stringDate,
30
+ digits,
33
31
  email,
34
- uuid,
35
- url,
32
+ integer,
33
+ ip,
36
34
  json,
37
- trim,
38
- upper,
39
35
  lower,
40
36
  normalize,
41
- capitalize,
42
- date: stringDate
37
+ numeric,
38
+ semver,
39
+ trim,
40
+ upper,
41
+ url,
42
+ uuid
43
43
  });
@@ -89,12 +89,12 @@ export declare namespace arkTsGenerics {
89
89
  type module = Module<arkTsGenerics.$>;
90
90
  type submodule = Submodule<$>;
91
91
  type $ = {
92
- Record: typeof Record.t;
93
- Pick: typeof Pick.t;
94
- Omit: typeof Omit.t;
95
92
  Exclude: typeof Exclude.t;
96
93
  Extract: typeof Extract.t;
94
+ Omit: typeof Omit.t;
97
95
  Partial: typeof Partial.t;
96
+ Pick: typeof Pick.t;
97
+ Record: typeof Record.t;
98
98
  Required: typeof Required.t;
99
99
  };
100
100
  }
@@ -59,11 +59,11 @@ class ExtractHkt extends Hkt {
59
59
  }
60
60
  const Extract = genericNode("T", "U")(args => args.T.extract(args.U), ExtractHkt);
61
61
  export const arkTsGenerics = arkModule({
62
- Record,
63
- Pick,
64
- Omit,
65
62
  Exclude,
66
63
  Extract,
64
+ Omit,
67
65
  Partial,
66
+ Pick,
67
+ Record,
68
68
  Required
69
69
  });
@@ -1,4 +1,4 @@
1
- import type { ArkErrors, ArkTypeStandardSchemaProps, BaseRoot, Disjoint, JsonSchema, MetaSchema, Morph, Predicate, PredicateCast, UndeclaredKeyBehavior } from "@ark/schema";
1
+ import type { ArkErrors, BaseRoot, Disjoint, JsonSchema, MetaSchema, Morph, Predicate, PredicateCast, StandardSchemaV1, UndeclaredKeyBehavior } from "@ark/schema";
2
2
  import type { anyOrNever, array, Callable, ErrorMessage, inferred, Json, unset } from "@ark/util";
3
3
  import type { associateAttributes, associateAttributesFromSchema, brandAttributes, Default, DefaultFor, distill, inferIntersection, inferMorphOut, inferPipes, InferredMorph, Nominal, Optional, Out, To } from "../attributes.ts";
4
4
  import type { ArkAmbient } from "../config.ts";
@@ -7,7 +7,7 @@ import type { Scope } from "../scope.ts";
7
7
  import type { ArrayType } from "./array.ts";
8
8
  import type { instantiateType } from "./instantiate.ts";
9
9
  /** @ts-ignore cast variance */
10
- interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => distill.Out<t> | ArkErrors, ArkTypeStandardSchemaProps> {
10
+ interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => distill.Out<t> | ArkErrors> {
11
11
  [inferred]: t;
12
12
  t: t;
13
13
  infer: this["inferOut"];
@@ -139,7 +139,7 @@ interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => dist
139
139
  * @example const withMorph = type({ foo: type("string.numeric.parse").default("123") }); withMorph({}) // { foo: 123 }
140
140
  */
141
141
  default<const value extends this["inferIn"], r = associateAttributes<t, Default<value>>>(value: DefaultFor<value>): instantiateType<r, $>;
142
- "~standard": ArkTypeStandardSchemaProps<this["inferIn"], this["inferOut"]>;
142
+ "~standard": StandardSchemaV1.ArkTypeProps<this["inferIn"], this["inferOut"]>;
143
143
  /** @deprecated */
144
144
  apply: Function["apply"];
145
145
  /** @deprecated */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arktype",
3
3
  "description": "TypeScript's 1:1 validator, optimized from editor to runtime",
4
- "version": "2.0.0-rc.23",
4
+ "version": "2.0.0-rc.25",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "David Blass",
@@ -34,8 +34,8 @@
34
34
  "out"
35
35
  ],
36
36
  "dependencies": {
37
- "@ark/util": "0.23.0",
38
- "@ark/schema": "0.23.0"
37
+ "@ark/util": "0.25.0",
38
+ "@ark/schema": "0.25.0"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"