({gen, it: {opts}}: KeywordCxt, pattern: string)
| 93 | const newRegExp = _`new RegExp` |
| 94 | |
| 95 | export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { |
| 96 | const u = opts.unicodeRegExp ? "u" : "" |
| 97 | const {regExp} = opts.code |
| 98 | const rx = regExp(pattern, u) |
| 99 | |
| 100 | return gen.scopeValue("pattern", { |
| 101 | key: rx.toString(), |
| 102 | ref: rx, |
| 103 | code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`, |
| 104 | }) |
| 105 | } |
| 106 | |
| 107 | export function validateArray(cxt: KeywordCxt): Name { |
| 108 | const {gen, data, keyword, it} = cxt |
no test coverage detected
searching dependent graphs…