Default values for tuple elements
This would allow an expression like the following with the same semantics as the default value expressions currently available on object literals:
const t = type(["string", ["number", "=", 5]]);
type Expected = Type<[string, (In?: number | undefined) => Default<5>]>;
attest<[string, number?]>(o.inferIn);
attest<[string, number]>(o.infer);
See tests for object literals at ark/type/__tests__/defaults.test.ts.
hey @ssalbdivad can i work on this issue?
@renu-123-pixel This issue is a lot more approachable than most other issues in the repo because all the correct behavior can be inferred from the object literal behavior, but it will still involve a fair amount of complex work with TypeScript and type-level functionality.
If you feel confident in those areas, feel free, but it might not be a good fit if you're new to the ecosystem.
ok ! if u say so u can assign it to someone else ! As I'm literal noob!! Thank you for your response !