Source

network/fromQueryString.js

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var qs_1 = __importDefault(require("qs"));
/**
 * Parse query string
 *
 * @param str Query string (?a=1&b=2)
 * @param fallback The fallback object
 * @category network
 * @module fromQueryString
 */
function fromQueryString(str, fallback) {
    if (fallback === void 0) { fallback = {}; }
    return (qs_1.default.parse(/^\?/.test(str) ? str.substring(1) : str) || fallback);
}
exports.default = fromQueryString;