arktype
arktype copied to clipboard
Support constraints for generic parameters
Would use the expected syntax:
const inScope = scope({
"box<s extends string>": {
box: "s",
},
});
const inType = type("<s extends string>", {
box: "s",
});
Should also update tsGenerics
from the default scope to include the appropriate constraints, e.g.
Record<K extends string | number | symbol, V>
(currently we need a @ts-expect-error
comment here to avoid a semantic validation error when checking the indexed key definition).