@darwish/utils-core
Version:
21 lines (20 loc) • 512 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
*
* @param URL URL地址
* @returns URL中所带的参数
*/
var getQueryParams = function (URL) {
if (URL === void 0) { URL = ''; }
try {
return JSON.parse('{"' +
decodeURI((URL.split('?')[1] || '').replace(/&/g, '","').replace(/=/g, '":"') +
'"}'));
}
catch (_a) {
console.error('发生错误了🥵');
return '';
}
};
exports.default = getQueryParams;