arktype 2.0.0-beta.4 → 2.0.0-beta.5

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,11 +1,17 @@
1
- import type { ErrorType, merge } from "@ark/util";
1
+ import type { array, ErrorType, merge } from "@ark/util";
2
2
  import type { type } from "../ark.js";
3
3
  import type { arkKeyOf, getArkKey, toArkKey } from "../keys.js";
4
4
  import type { inferTypeRoot, validateTypeRoot } from "../type.js";
5
+ import type { ArrayType } from "./array.js";
5
6
  import type { instantiateType } from "./instantiate.js";
6
7
  import type { ValidatorType } from "./validator.js";
7
8
  /** @ts-ignore cast variance */
8
9
  interface Type<out t extends object = object, $ = {}> extends ValidatorType<t, $> {
10
+ readonly(): t extends array ? ArrayType<{
11
+ readonly [i in keyof t]: t[i];
12
+ }, $> : Type<{
13
+ readonly [k in keyof t]: t[k];
14
+ }, $>;
9
15
  keyof(): instantiateType<keyof t, $>;
10
16
  get<k1 extends arkKeyOf<t>, r = instantiateType<getArkKey<t, k1>, $>>(k1: k1 | type.cast<k1>): r;
11
17
  get<k1 extends arkKeyOf<t>, k2 extends arkKeyOf<getArkKey<t, k1>>, r = instantiateType<getArkKey<getArkKey<t, k1>, k2>, $>>(k1: k1 | type.cast<k1>, k2: k2 | type.cast<k2>): r;
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-beta.4",
4
+ "version": "2.0.0-beta.5",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "David Blass",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@ark/util": "0.2.1",
29
- "@ark/schema": "0.3.1"
29
+ "@ark/schema": "0.3.2"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"