Skip to content

Instantly share code, notes, and snippets.

@dcb9
Created August 18, 2024 15:10
Show Gist options
  • Save dcb9/e3b3409e94f4b1ca9fa20af9c8fc539a to your computer and use it in GitHub Desktop.
Save dcb9/e3b3409e94f4b1ca9fa20af9c8fc539a to your computer and use it in GitHub Desktop.
module.exports.parse = ({ content, name, url }, { yaml, axios, notify }) => {
if (content && content.rules) {
const targets = ["国外流量"]
for (const target of targets) {
const hasTarget = content.rules.some((ele) => ele.includes(target))
if (hasTarget) {
const domainSuffixes = [
"rs", "io", "npmjs.org", "notion.so", "etherscan.io",
]
for (const domain of domainSuffixes) {
content.rules.unshift(`DOMAIN-SUFFIX,${domain},${target}`)
}
}
}
}
return content
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment