clutz icon indicating copy to clipboard operation
clutz copied to clipboard

Invalid d.ts generated from typedef with invalid field name

Open evmar opened this issue 7 years ago • 0 comments

goog.module('demo');

/**
 * @typedef {{
 *   name: string,
 *   container-url: string,
 *   run-command: (string|undefined),
 *   run-args: (string|undefined),
 *   options: {
 *     privileged: boolean
 *   }
 * }}
 */
exports.X;

The hyphenated names show up in the output dts verbatim, e.g. { container-url : string, ... }. We should instead quote them.

Note: you might wonder how these can even be used from Closure code. The answer seems to be using quoted access. (You can codesearch in g3 for an example of this typedef.)

evmar avatar Apr 11 '17 15:04 evmar