Unlink scripts submodule and commit contents as normal directory
This commit is contained in:
1 parent
4f7dea111f
commit
6488b3ea85
48 files changed
+2876
-1
No files matched your search
@@ -0,0 +1,16 @@
|
||||
const { getServerIPs } = require('./services/ipFetcher.js');
|
||||
|
||||
let ipPattern = null;
|
||||
|
||||
const buildPattern = () => {
|
||||
const ips = getServerIPs();
|
||||
if (!ips.length) return null;
|
||||
|
||||
const escaped = ips.map(i => i.replace(/[.:\\[\](){}^$*+?|]/g, '\\$&'));
|
||||
return new RegExp(escaped.join('|'), 'g');
|
||||
};
|
||||
|
||||
module.exports = str => {
|
||||
if (ipPattern === null) ipPattern = buildPattern() || false;
|
||||
return ipPattern ? str.replace(ipPattern, '[SOME-IP]') : str;
|
||||
};
|
||||
Reference in new issue
Block a user