(s: string)
| 25 | const CACHE_LIMIT_DEF = 300; // default max groups to cache |
| 26 | const CACHE_LIMIT_MIN = 10; |
| 27 | const CACHE_LIMIT_MAX = 1000; |
| 28 | |
| 29 | const htmlEsc = (s: string) => |
| 30 | s.replace(/[&<>"']/g, (m) => { |
| 31 | if (m === "&") return "&"; |
| 32 | if (m === "<") return "<"; |
| 33 | if (m === ">") return ">"; |
| 34 | if (m === '"') return """; |
| 35 | return "'"; |
| 36 | }); |
| 37 |