Matt W
Matt W
Given that boxed objects only have a single prototype chain, they can't be more than one primitive type. The intersection `number & string` is indeed nonsensible as you can't have...
This would reduce the available cases to `primitive & object`, not `primitiveA & primitiveB & object`
In summary: ``` import typia from "typia"; let n = 123; const x = Object.assign(n,{ u: 'u' }); // TS type: `const x: number & { u: string; }` console.log(typia.validate(x));...
To fix the above example (not "branding", but auto-boxing), the issue can be resolved by correctly (or rather, more strictly) implementing the ObjectConstructor. The following code runs without error: ```...
Simpler version, that remove the `Explode` and `async` from the possible source of errors. It's now just a simple mapped type that extracts the Parameters for each function in the...
Narrowed it down further: typia doesn't correctly recognise keys that are functions in mapped types. However it DOES recognise property keys that are initialized to functions. [Playground link](https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYQKZwCCKtUA5gK4hUB2MAzgDy0AFAJIA+OAF44AbzJw4AbVQo4wDnADWVRBAx1hAXQBcCgB7GObAEZUo+8gF8K1Os24S6DZm049eMuXIA9IEYEBAAFGZwFiDWUACU5lY2JHDBcABCAEoAorQA0gDKxgAGoRAlKm4cEPAgSmBUACYIEHDoAG6oADbATagwwBAcsgHlhpFJsTbxEmIxcanpAOrQ6tyl5ZXA1bVw9WCNLTBtnT19A0Mj9iLklMg0jEzcAEzu-mNhxvJRCzZ2ZHsdwAxsNuPAur1+icoO5CGgAHTAqBUAZUABq52hVH4rhE4Xi5FBHHBcEhFxhb0k8NQSJRaMxULRuOeL3xhIoxO4EG6VAR3QgTHC5Oh0HCUkwXwUAEYAAz6OD2eLxMhcnl8gVCkUDaAvcWSiDfOUKpUqtW8-mC4VYnVQfXjBQwKAsKgm5VpQJwAS0QqFHKFAA0mQAqgAVOCFAASAHlgwAZAAicAAYrQhHHVWD1ZatTbKfapfInS63fEgA) Key observation:...
Canonical example, that shows that the function declarations vs function expression behave differently. [Playground](https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYQKZwCyqYYVUAPABoB8cAvHAN5k4cANoBpOMAB2cANZVEEDHDYBdAFxwAzjChSA5mQC+FanABqARh79BmCBAAUASg0A3CMAAm5Y2QDGEJKaEAA2VAB0IRB6DraEaOGuqCFeqDBULPSMzCyWHBwOfHYQGgDkGPalcIZOADRxyAlJKZ5pGVlMrHkFRRUlcJIAriEh1U5wAPQTcACSAHIAwgDyAEorAKILACoAMgCacAAKAIIAyqfrp2ROJsg0ZgBM1gJCfRrO3FzuXj4UAUGhCJRGINIiJZKpdKZBidXIPfKFYplPpVGr1ITxVDglptaHZLrwnpIgbDUY1a5kIA) ```typescript import typia from "typia"; type Mapper = { [K in keyof X]: string } type...
@samchon Perhaps https://github.com/samchon/typia/blob/master/src/factories/internal/metadata/emplace_metadata_object.ts#L179 should be: ``` ts.isShorthandPropertyAssignment(node) || ts.isPropertySignature(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node) || ``` ? I've not yet worked out if this will have any other detrimental effects, as...
Ok, so that "fix" breaks lots of code as it new tries (fails) to generate validators for all function members. Typia does not (at present) generate validation tests for function...
This [playground link](https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYQKZwCyqYYVUAPABoB8cAvHAN5k4cANoBpOMAB2cANZVEEDHDYBdAFxwAzjChSA5mQC+FDAFdJAYxjAI0gI6mAHgAoAlH2MXb2uA6c84N24OD3IvSR8ANwAmAIEhDAgINw8AGjgAegy4AFUAOQA1AEEAGQBJABEigBUAUQrBOAAjVCg1IJDDVMaWgC81M0trWxSuxodHdKzcwtLKmvrx039p-OLyqrqG40pkGgLY3mpFOBjyajpDugYmVgOOMO94ECu+ZtaNAHJHT-S+r5+cEMjwi8CUR2QaAAdMBNCxaNEOM4Xq4yOFNBAADZUKGYiB6ZwYVzkMjTWiwzT6OCfRIQX7Uib0z5+QEAWlOqExwAAJqhhtJNAALCCmTHc5o0DCczRUP6meDAGCfTQIKCmKik7IAARgmlZVEcTCs+qg2CgaKepxeGgRAReJCAA) seems to narrow down the issue to a cover all cases (updated: 30/9/2024 to cover 'quux' case) Given that it _can_ work as expected, depending on the...