MCPcopy Create free account
hub / github.com/ClydeTime/Surge / queryObj

Method queryObj

Script/Env.js:360–372  ·  view source on GitHub ↗

* * @param {String} options * @returns {Object} 将 queryStr: key=val&name=senku 字符串 转换成 Object

(options)

Source from the content-addressed store, hash-verified

358 * @returns {Object} 将 queryStr: key=val&name=senku 字符串 转换成 Object
359 */
360 queryObj(options) {
361 let obj = {}
362 let pairs = options.split('&')
363 for (let pair of pairs) {
364 let keyValue = pair.split('=')
365 let key = keyValue[0]
366 let value = keyValue[1] || ''
367 if (key) {
368 obj[key] = value
369 }
370 }
371 return obj
372 }
373
374 /**
375 * 系统通知

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected