summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/node_modules/validator/lib/isLatLong.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/isLatLong.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/isLatLong.js')
-rw-r--r--includes/external/addressbook/node_modules/validator/lib/isLatLong.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/includes/external/addressbook/node_modules/validator/lib/isLatLong.js b/includes/external/addressbook/node_modules/validator/lib/isLatLong.js
deleted file mode 100644
index e288812..0000000
--- a/includes/external/addressbook/node_modules/validator/lib/isLatLong.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = isLatLong;
-
-var _assertString = _interopRequireDefault(require("./util/assertString"));
-
-var _merge = _interopRequireDefault(require("./util/merge"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
-var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
-var latDMS = /^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i;
-var longDMS = /^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i;
-var defaultLatLongOptions = {
- checkDMS: false
-};
-
-function isLatLong(str, options) {
- (0, _assertString.default)(str);
- options = (0, _merge.default)(options, defaultLatLongOptions);
- if (!str.includes(',')) return false;
- var pair = str.split(',');
- if (pair[0].startsWith('(') && !pair[1].endsWith(')') || pair[1].endsWith(')') && !pair[0].startsWith('(')) return false;
-
- if (options.checkDMS) {
- return latDMS.test(pair[0]) && longDMS.test(pair[1]);
- }
-
- return lat.test(pair[0]) && long.test(pair[1]);
-}
-
-module.exports = exports.default;
-module.exports.default = exports.default; \ No newline at end of file