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

@callback's not correctly validated #101

Closed kungfooman closed 7 months ago

kungfooman commented 7 months ago

Example:

/**
 * @callback UpdateFunction
 * @param {number} dt - The time since the last update.
 * @ignore
 */
/**
 * @param {UpdateFunction} a
 */
function identity(a) {
  return a;
}
identity(() => undefined);

Output / test:

image

Some time ago I rewrote validateTypedef to prevent stack overflows through circularity, but now it's a bit too restrictive... I have to allow "Function" type typedefs.