(links)
| 79 | * @returns {Transformation[]} Matching transformations |
| 80 | */ |
| 81 | export const findTransformations = (links) => { |
| 82 | const urls = !isArray(links) ? [links] : links |
| 83 | const tfms = [] |
| 84 | for (const transformation of transformations) { |
| 85 | const { patterns } = transformation |
| 86 | const matched = urls.some((url) => patterns.some((pattern) => pattern.test(url))) |
| 87 | if (matched) { |
| 88 | tfms.push({ |
| 89 | ...transformation, |
| 90 | }) |
| 91 | } |
| 92 | } |
| 93 | return tfms |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Run pre-extraction transformations on raw HTML. |
no outgoing calls
no test coverage detected
searching dependent graphs…