MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getQueryValue

Function getQueryValue

test/tool/utils.js:4–11  ·  view source on GitHub ↗
(url, key)

Source from the content-addressed store, hash-verified

2 * 获取url的某个查询参数值
3 */
4export function getQueryValue(url, key) {
5 const reg = new RegExp('(^|&|\\?)' + key + '=([^&]*)(&|$)');
6 const match = reg.exec(url);
7 if (match && match.length >= 3) {
8 return match[2];
9 }
10 return null;
11}

Calls 1

execMethod · 0.45

Tested by

no test coverage detected