(text: string)
| 57 | }; |
| 58 | |
| 59 | const globSplit = (text: string): string[] => { |
| 60 | const split = text.split(/([*?]{2,})/g); |
| 61 | for (let i = 1; i < split.length; i += 2) { |
| 62 | // "*????" 改成 "????*",避免 backward 处理 |
| 63 | // api定义的 glob * 是等价于 glob ** |
| 64 | const p = split[i]; // **??**??** |
| 65 | const q = p.replace(/\*/g, ""); // ???? |
| 66 | if (p !== q) split[i] = `${q}*`; // ????* |
| 67 | } |
| 68 | return split.join("").split(/([*?])/g); |
| 69 | }; |
| 70 | |
| 71 | export const extractUrlPatterns = (lines: string[]): URLRuleEntry[] => { |
| 72 | const rules = []; |
no outgoing calls
no test coverage detected