arktype 2.0.0-rc.22 → 2.0.0-rc.24
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 +1 -0
- package/out/keywords/string/string.d.ts +12 -12
- package/out/keywords/string/string.js +11 -11
- package/out/keywords/ts.d.ts +3 -3
- package/out/keywords/ts.js +3 -3
- package/out/methods/base.d.ts +3 -4
- package/package.json +3 -3
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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";
|
|
3
4
|
export { Generic } from "./generic.ts";
|
|
4
5
|
export { ark, declare, define, generic, keywords, type, type Ark } from "./keywords/keywords.ts";
|
|
5
6
|
export { Module, type BoundModule, type Submodule } from "./module.ts";
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
semver,
|
|
31
|
-
ip,
|
|
27
|
+
capitalize,
|
|
32
28
|
creditCard,
|
|
29
|
+
date: stringDate,
|
|
30
|
+
digits,
|
|
33
31
|
email,
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
integer,
|
|
33
|
+
ip,
|
|
36
34
|
json,
|
|
37
|
-
trim,
|
|
38
|
-
upper,
|
|
39
35
|
lower,
|
|
40
36
|
normalize,
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
numeric,
|
|
38
|
+
semver,
|
|
39
|
+
trim,
|
|
40
|
+
upper,
|
|
41
|
+
url,
|
|
42
|
+
uuid
|
|
43
43
|
});
|
package/out/keywords/ts.d.ts
CHANGED
|
@@ -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
|
}
|
package/out/keywords/ts.js
CHANGED
|
@@ -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
|
});
|
package/out/methods/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArkErrors, BaseRoot, Disjoint, JsonSchema, MetaSchema, Morph, Predicate, PredicateCast,
|
|
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
|
|
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,8 +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
|
-
"~
|
|
143
|
-
"~types": StandardSchema.Types<this["inferIn"], this["inferOut"]>;
|
|
142
|
+
"~standard": StandardSchemaV1.ArkTypeProps<this["inferIn"], this["inferOut"]>;
|
|
144
143
|
/** @deprecated */
|
|
145
144
|
apply: Function["apply"];
|
|
146
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.
|
|
4
|
+
"version": "2.0.0-rc.24",
|
|
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.
|
|
38
|
-
"@ark/schema": "0.
|
|
37
|
+
"@ark/util": "0.24.0",
|
|
38
|
+
"@ark/schema": "0.24.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|