Repository URL to install this package:
|
Version:
6.0.1 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const exotic_1 = require("exotic");
// const matchProtocol = /^(?:[a-z]+:)?/
const matchProtocol = /^(?:[a-z]+:)/;
const hasProtocol = (x) => matchProtocol.test(x);
exports.hasProtocol = hasProtocol;
function isFullyQualifiedWebAddress(address) {
return hasProtocol(address);
}
exports.isFullyQualifiedWebAddress = isFullyQualifiedWebAddress;
/**
* @TODO isInOurRoutes
*/
function isRelativeWebAddress(address) {
return address;
}
exports.isRelativeWebAddress = isRelativeWebAddress;
function isStringifiedParams(x) {
if (!exotic_1.isString(x)) {
return false;
}
else if (x.includes('=')) {
return true;
}
else if (x.startsWith('?')) {
return true;
}
else if (x.startsWith('#')) {
return true;
}
else {
return false;
}
}
exports.isStringifiedParams = isStringifiedParams;
const isHash = (to) => exotic_1.isString(to) && to.startsWith('#');
exports.isHash = isHash;
//# sourceMappingURL=checks.js.map