arktype
arktype copied to clipboard
Index access expressions
Would allow expressions like the following:
const types = scope({
base: {
foo: "true",
bar: "false",
},
// 1:1 with TS
foo: "base['foo']",
// Allow more convenient dot notation from JS
bar: "base.bar",
});
Should check that the accessed expression extends keyof the base type, otherwise should result in a semantic validation error.