(glob: string)
| 508 | } |
| 509 | |
| 510 | function globToRegExp(glob: string): RegExp { |
| 511 | let source = "^" |
| 512 | for (let index = 0; index < glob.length; index++) { |
| 513 | const char = glob[index] |
| 514 | const next = glob[index + 1] |
| 515 | if (char === "*") { |
| 516 | if (next === "*") { |
| 517 | source += ".*" |
| 518 | index++ |
| 519 | } else { |
| 520 | source += "[^/]*" |
| 521 | } |
| 522 | } else if (char === "?") { |
| 523 | source += "[^/]" |
| 524 | } else { |
| 525 | source += escapeRegExp(char) |
| 526 | } |
| 527 | } |
| 528 | return new RegExp(`${source}$`) |
| 529 | } |
| 530 | |
| 531 | /** |
| 532 | * Creates a predicate that checks whether a filename is included by the configured JSDoc globs. |
nothing calls this directly
no test coverage detected