aboutsummaryrefslogtreecommitdiff
path: root/api/lib/checkIfAllowedIP/index.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-04-14 16:54:13 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-04-14 16:54:13 +0300
commit333864c5fe098b6993066d73b8d6d8e6fb358eb0 (patch)
tree039442bc2fb7f1e535087639db34ca3afa30d455 /api/lib/checkIfAllowedIP/index.js
parentb9c719d094c3ac8a802b59d7667a97514d03faed (diff)
downloadarching-kaos-tools-333864c5fe098b6993066d73b8d6d8e6fb358eb0.tar.gz
arching-kaos-tools-333864c5fe098b6993066d73b8d6d8e6fb358eb0.tar.bz2
arching-kaos-tools-333864c5fe098b6993066d73b8d6d8e6fb358eb0.zip
[api] Removes unnecessary anonymous JS functions
Diffstat (limited to 'api/lib/checkIfAllowedIP/index.js')
-rw-r--r--api/lib/checkIfAllowedIP/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/lib/checkIfAllowedIP/index.js b/api/lib/checkIfAllowedIP/index.js
index d9693d9..2e50418 100644
--- a/api/lib/checkIfAllowedIP/index.js
+++ b/api/lib/checkIfAllowedIP/index.js
@@ -1,8 +1,9 @@
-
-module.exports = (address) => {
+function checkIfAllowedIP(address)
+{
var test_cjdns = /^fc[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/
var test_yggdrasil = /^2[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/
var test_yggdrasil_sub = /^3[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/
return (test_cjdns.test(address) || test_yggdrasil.test(address) || test_yggdrasil_sub.test(address)) ? true : false;
};
+module.exports = checkIfAllowedIP;