0.21.0 • Published 8 months ago

@arktype/schema v0.21.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@ark/schema

Underlying schema language parsed from arktype syntax.

UNDER DEVELOPMENT

The parts of ArkType's type system that exist in TS (i.e. not runtime-only constraints like bounds, divisors, custom predicates, morphs etc.) are structured like this:

  • Union: a set of intersections
  • Intersection: a set of a basis and constraints
  • Basis: this is the base type to which refinements like props are applied. It is one of three things, getting narrower as you move down the list:
    • Domain: "string" | "number" | "bigint" | "object" | "symbol" parallels built-in TS keywords for non-enumerable value sets
    • Proto: Must be an instanceof some class (implies domain "object")
    • Unit: Must === some value (can be intersected with any other constraint and reduced to itself or a disjoint)
  • Constraint: an individual condition that must be satisfied:
    • Required: must have a specified literal string or symbol key and a value that conforms to a specified union or intersection
    • Optional: Required conditions met or the specified key is not present
    • Index: all keys that satisfy an index type must have values satisfying the corresponding value type

In this system, L extends/subtypes/is assignable to R if and only if the intersection L & R is equal to L.

0.21.0

8 months ago

0.20.0

8 months ago

0.19.0

8 months ago

0.18.0

8 months ago

0.15.0

9 months ago

0.17.0

9 months ago

0.16.0

9 months ago

0.11.0

9 months ago

0.13.0

9 months ago

0.9.0

9 months ago

0.5.0

10 months ago

0.7.0

10 months ago

0.12.0

9 months ago

0.14.0

9 months ago

0.10.0

9 months ago

0.8.0

10 months ago

0.6.0

10 months ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.20

12 months ago

0.1.21

12 months ago

0.1.22

12 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.16

1 year ago

0.1.8

1 year ago

0.1.17

12 months ago

0.1.7

1 year ago

0.1.18

12 months ago

0.1.19

12 months ago

0.1.9

1 year ago

0.3.2

11 months ago

0.4.0

10 months ago

0.3.1

11 months ago

0.2.2

11 months ago

0.1.6

1 year ago

0.3.3

10 months ago

0.1.5

1 year ago

0.1.4-cjs

1 year ago

0.1.4

1 year ago

0.1.2

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.5

1 year ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago