MCPcopy Create free account
hub / github.com/chavyleung/scripts / matchParam

Function matchParam

zsfc/zsfc.js:342–347  ·  view source on GitHub ↗

* 从输入字符串中提取指定关键字的值。 * * @param {string} input - 输入字符串,要从中提取关键字的值。 * @param {string} key - 要提取的关键字。 * @returns {string} - 返回匹配到的关键字值,如果没有匹配到则返回空字符串。

(input, key)

Source from the content-addressed store, hash-verified

340 * @returns {string} - 返回匹配到的关键字值,如果没有匹配到则返回空字符串。
341 */
342function matchParam(input, key) {
343 const separator = input.includes("&") ? "&" : ";";
344 const pattern = new RegExp(`${key}=([^${separator}]+)`);
345 const match = input.match(pattern);
346 return match ? match[1] : '';
347}
348
349/**
350 * @description 掌飞购物相关函数,获取当前月份对应的游戏道具。

Callers 1

zsfc.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected