arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Support `this` in `2.0` release candidate

Open ssalbdivad opened this issue 6 months ago • 0 comments

Currently, the this keyword works at a type-level, but fails at runtime.

This needs to be addressed, and the tests in this.test.ts reenabled, e.g.:

const disappointingGift = type({
  label: "string",
  "box?": "this",
});

type ExpectedDisappointingGift = {
  label: string;
  box?: ExpectedDisappointingGift;
};
attest<ExpectedDisappointingGift>(disappointingGift.infer);

ssalbdivad avatar Aug 06 '24 14:08 ssalbdivad