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