arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Index access expressions

Open ssalbdivad opened this issue 1 year ago • 0 comments

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.

ssalbdivad avatar Jul 21 '23 16:07 ssalbdivad