mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 22:09:55 +00:00
fix: simplify telemetry scan
This commit is contained in:
@@ -32,13 +32,11 @@ for (const file of files) {
|
||||
const extension = extname(file).toLowerCase()
|
||||
if (ignoredExtensions.has(extension)) continue
|
||||
|
||||
const content = (await readFile(file)).toString('utf8')
|
||||
const hits = telemetryPatterns
|
||||
.map((pattern) => {
|
||||
const match = content.match(pattern.regex)
|
||||
return match ? { label: pattern.label, match: match[0] } : null
|
||||
})
|
||||
.filter((hit): hit is { label: string; match: string } => hit !== null)
|
||||
const content = await readFile(file, 'utf8')
|
||||
const hits = telemetryPatterns.flatMap((pattern) => {
|
||||
const match = content.match(pattern.regex)
|
||||
return match ? [{ label: pattern.label, match: match[0] }] : []
|
||||
})
|
||||
|
||||
if (hits.length > 0) {
|
||||
violations.push({ file, hits })
|
||||
|
||||
Reference in New Issue
Block a user