MCPcopy
hub / github.com/extractus/article-extractor / findTransformations

Function findTransformations

src/utils/transformation.js:81–94  ·  view source on GitHub ↗
(links)

Source from the content-addressed store, hash-verified

79 * @returns {Transformation[]} Matching transformations
80 */
81export 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.

Callers 3

execPreParserFunction · 0.85
execPostParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…