Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/router / dist / deps / checks.js
Size: Mime:
"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