(glob: string)
| 494 | } |
| 495 | |
| 496 | function globToRegExp(glob: string): RegExp { |
| 497 | let source = "^" |
| 498 | for (let index = 0; index < glob.length; index++) { |
| 499 | const char = glob[index] |
| 500 | const next = glob[index + 1] |
| 501 | if (char === "*") { |
| 502 | if (next === "*") { |
| 503 | source += ".*" |
| 504 | index++ |
| 505 | } else { |
| 506 | source += "[^/]*" |
| 507 | } |
| 508 | } else if (char === "?") { |
| 509 | source += "[^/]" |
| 510 | } else { |
| 511 | source += escapeRegExp(char) |
| 512 | } |
| 513 | } |
| 514 | return new RegExp(`${source}$`) |
| 515 | } |
| 516 | |
| 517 | /** |
| 518 | * Creates a predicate that checks whether a filename is included by the configured JSDoc globs. |
nothing calls this directly
no test coverage detected