github arktypeio/arktype arktype@2.0.0-dev.22

latest releases: @arktype/util@0.49.0, @ark/util@0.49.0, @ark/type@2.1.22...
15 months ago

Allow overriding builtin keywords

// all references to string in this scope now enforce minLength: 1
const $ = scope({
	foo: {
		// has minLength: 1
		bar: "string"
	},
	string: schema({ domain: "string" }).constrain("minLength", 1)
})

// has minLength: 1
const s = $.type("string")

Fix a ParseError compiling certain morphs with cyclic inputs

Types like the following will now work:

const types = scope({
	ArraySchema: {
		"items?": "Schema"
	},
	Schema: "TypeWithKeywords",
	TypeWithKeywords: "ArraySchema"
}).export()

const t = types.Schema.pipe(o => JSON.stringify(o))

Don't miss a new arktype release

NewReleases is sending notifications on new releases.