kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
42 lines (40 loc) • 5.25 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parseUri = parseUri;
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
/**
* Allows to break down a url into multiple params
* from http://blog.stevenlevithan.com/archives/parseuri
*/
function parseUri(str) {
var o = parseUri.options;
var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);
var uri = {};
var i = 14;
while (i--) uri[o.key[i]] = (m === null || m === void 0 ? void 0 : m[i]) || '';
uri[o.q.name] = {};
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
if ($1) uri[o.q.name][$1] = $2;
});
return uri;
}
parseUri.options = {
strictMode: false,
key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],
q: {
name: 'queryKey',
parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
strict:
// eslint-disable-next-line no-useless-escape
/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose:
// eslint-disable-next-line no-useless-escape
/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
}
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJwYXJzZVVyaSIsInN0ciIsIm8iLCJvcHRpb25zIiwibSIsInBhcnNlciIsInN0cmljdE1vZGUiLCJleGVjIiwidXJpIiwiaSIsImtleSIsInEiLCJuYW1lIiw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