(patterns)
| 46 | * @returns {number} Number of transformations removed |
| 47 | */ |
| 48 | export const removeTransformations = (patterns) => { |
| 49 | if (!patterns) { |
| 50 | const removed = transformations.length |
| 51 | transformations.length = 0 |
| 52 | return removed |
| 53 | } |
| 54 | let removing = 0 |
| 55 | for (let i = transformations.length - 1; i >= 0; i--) { |
| 56 | const { patterns: ipatterns } = transformations[i] |
| 57 | const matched = ipatterns.some((ptn) => patterns.some((pattern) => String(pattern) === String(ptn))) |
| 58 | if (matched) { |
| 59 | transformations.splice(i, 1) |
| 60 | removing += 1 |
| 61 | } |
| 62 | } |
| 63 | return removing |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Get a copy of all registered transformations. |
no outgoing calls
no test coverage detected
searching dependent graphs…