MCPcopy Create free account
hub / github.com/arktypeio/arktype / fail

Function fail

ark/aot/shadow.ts:976–991  ·  view source on GitHub ↗
(
	pair: Pair,
	observation: string,
	arktype: string,
	precompiled: string,
	reason = arktype === precompiled ? "though each prints alike" : undefined
)

Source from the content-addressed store, hash-verified

974}
975
976const fail = (
977 pair: Pair,
978 observation: string,
979 arktype: string,
980 precompiled: string,
981 reason = arktype === precompiled ? "though each prints alike" : undefined
982): never => {
983 const error = new Error(
984 `${pair.site} diverges from arktype at ${observation}${reason ? `, ${reason}` : ""}: arktype gives ${arktype}, its validator ${precompiled}`
985 )
986 // also raised where a fallback or `expect(...).toThrow()` can't catch it
987 queueMicrotask(() => {
988 throw error
989 })
990 throw error
991}
992
993const uncopyable = Symbol("uncopyable")
994

Callers 4

checkedMemberFunction · 0.70
heldHandlerOfFunction · 0.70
validateBothFunction · 0.70
compareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected