kungfooman / RuntimeTypeInspector.js

Checking JSDoc types at runtime for high-quality types - Trust is good, control is better.
MIT License
8 stars 0 forks source link

`createType`: support indexed access #121

Closed kungfooman closed 6 months ago

kungfooman commented 6 months ago

Minimal example:

/**
 * @typedef {{a: 'aa', b: 'bb', c: 'cc'}} Obj
 * @typedef {Obj[keyof Obj]} ObjValues
 */
const t = createType(typedefs.ObjValues, console.log);
console.log(t);

REPL

Error:

image