Repository URL to install this package:
|
Version:
7.0.2 ▾
|
"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;
function isRelativeWebAddress(address) {
return address.startsWith('/') || isFullyQualifiedWebAddress(address) === false;
}
exports.isRelativeWebAddress = isRelativeWebAddress;
/**
* @TODO isInOurRoutes
*/
// function isinOurRoutes(address: string) {
// // check if it matches
// }
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