You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
666 B
23 lines
666 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = _default;
|
|
|
|
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
|
|
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+)?)\)?$/;
|
|
|
|
function _default(str) {
|
|
(0, _assertString.default)(str);
|
|
if (!str.includes(',')) return false;
|
|
var pair = str.split(',');
|
|
return lat.test(pair[0]) && long.test(pair[1]);
|
|
}
|
|
|
|
module.exports = exports.default;
|
|
module.exports.default = exports.default;
|