arktype 2.1.10 → 2.1.12

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,4 +1,4 @@
1
- import type { BaseRoot, Disjoint, JsonSchema, Morph, NodeSelector, Predicate, StandardSchemaV1, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
1
+ import type { BaseNode, BaseRoot, Disjoint, JsonSchema, Morph, NodeSelector, Predicate, StandardSchemaV1, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
2
2
  import type { anyOrNever, array, Callable, ErrorMessage, inferred, JsonStructure, unset } from "@ark/util";
3
3
  import type { defaultFor, distill, inferIntersection, inferMorphOut, inferPipe, inferPipes, InferredMorph, Out, To } from "../attributes.ts";
4
4
  import type { ArkAmbient } from "../config.ts";
@@ -357,6 +357,16 @@ export interface Inferred<out t = unknown, $ = {}> {
357
357
  * const parseUser = type("string").pipe(s => JSON.parse(s)).to({ name: "string" })
358
358
  */
359
359
  to<const def, r = instantiateType<inferPipe<t, type.infer<def, $>>, $>>(def: type.validate<def, $>): r extends infer _ ? _ : never;
360
+ /**
361
+ * #### query internal node references
362
+ *
363
+ * @experimental filters and returns the Type's internal representation from `@ark/schema`
364
+ *
365
+ * @example
366
+ * // ["blue", "red"]
367
+ * const values = type("'red' | 'blue'").select("unit").map(u => u.unit)
368
+ */
369
+ select: BaseNode["select"];
360
370
  }
361
371
  /** @ts-ignore cast variance */
362
372
  interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => distill.Out<t> | ArkEnv.onFail>, Inferred<t, $> {
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.1.10",
4
+ "version": "2.1.12",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,8 +34,8 @@
34
34
  "out"
35
35
  ],
36
36
  "dependencies": {
37
- "@ark/util": "0.45.0",
38
- "@ark/schema": "0.45.0"
37
+ "@ark/util": "0.45.2",
38
+ "@ark/schema": "0.45.2"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -43,9 +43,10 @@
43
43
  "scripts": {
44
44
  "build": "ts ../repo/build.ts",
45
45
  "test": "ts ../repo/testPackage.ts; pnpm testIntegration",
46
- "testIntegration": "pnpm testSimpleConfig && pnpm testAllConfig && pnpm testOnFailConfig",
46
+ "testIntegration": "pnpm testSimpleConfig && pnpm testAllConfig && pnpm testOnFailConfig && pnpm testEoptConfig",
47
47
  "testSimpleConfig": "ts ./__tests__/integration/testSimpleConfig.ts",
48
48
  "testAllConfig": "ts ./__tests__/integration/testAllConfig.ts",
49
- "testOnFailConfig": "ts ./__tests__/integration/testOnFailConfig.ts"
49
+ "testOnFailConfig": "ts ./__tests__/integration/testOnFailConfig.ts",
50
+ "testEoptConfig": "ts ./__tests__/integration/testEoptConfig.ts"
50
51
  }
51
52
  }