summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/node_modules/validator/lib/isFQDN.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/addressbook/node_modules/validator/lib/isFQDN.js
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/addressbook/node_modules/validator/lib/isFQDN.js')
-rw-r--r--includes/external/addressbook/node_modules/validator/lib/isFQDN.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/includes/external/addressbook/node_modules/validator/lib/isFQDN.js b/includes/external/addressbook/node_modules/validator/lib/isFQDN.js
deleted file mode 100644
index dca1ba3..0000000
--- a/includes/external/addressbook/node_modules/validator/lib/isFQDN.js
+++ /dev/null
@@ -1,90 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = isFQDN;
-
-var _assertString = _interopRequireDefault(require("./util/assertString"));
-
-var _merge = _interopRequireDefault(require("./util/merge"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var default_fqdn_options = {
- require_tld: true,
- allow_underscores: false,
- allow_trailing_dot: false,
- allow_numeric_tld: false,
- allow_wildcard: false,
- ignore_max_length: false
-};
-
-function isFQDN(str, options) {
- (0, _assertString.default)(str);
- options = (0, _merge.default)(options, default_fqdn_options);
- /* Remove the optional trailing dot before checking validity */
-
- if (options.allow_trailing_dot && str[str.length - 1] === '.') {
- str = str.substring(0, str.length - 1);
- }
- /* Remove the optional wildcard before checking validity */
-
-
- if (options.allow_wildcard === true && str.indexOf('*.') === 0) {
- str = str.substring(2);
- }
-
- var parts = str.split('.');
- var tld = parts[parts.length - 1];
-
- if (options.require_tld) {
- // disallow fqdns without tld
- if (parts.length < 2) {
- return false;
- }
-
- if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
- return false;
- } // disallow spaces
-
-
- if (/\s/.test(tld)) {
- return false;
- }
- } // reject numeric TLDs
-
-
- if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
- return false;
- }
-
- return parts.every(function (part) {
- if (part.length > 63 && !options.ignore_max_length) {
- return false;
- }
-
- if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
- return false;
- } // disallow full-width chars
-
-
- if (/[\uff01-\uff5e]/.test(part)) {
- return false;
- } // disallow parts starting or ending with hyphen
-
-
- if (/^-|-$/.test(part)) {
- return false;
- }
-
- if (!options.allow_underscores && /_/.test(part)) {
- return false;
- }
-
- return true;
- });
-}
-
-module.exports = exports.default;
-module.exports.default = exports.default; \ No newline at end of file