MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / getQxReInfo

Function getQxReInfo

Rewrite-Parser.js:2106–2123  ·  view source on GitHub ↗
(x, y, mark)

Source from the content-addressed store, hash-verified

2104} //reJsValue
2105
2106function getQxReInfo(x, y, mark) {
2107 let noteK = isNoteK(x)
2108 let retype = /\surl\s+request-/i.test(x) ? 'request' : 'response'
2109 let jstype = 'http-' + retype
2110 let hdorbd = /\surl\s+re[^\s]+?-header\s/i.test(x) ? 'header' : 'body'
2111 let breakpoint = retype + '-' + hdorbd
2112 let jsptn = x.split(/\s+url\s+re/)[0].replace(/^#/, '')
2113 let jsname = /body/.test(hdorbd) ? 'replaceBody' : 'replaceHeader'
2114 let jsurl = /header/.test(hdorbd)
2115 ? 'https://raw.githubusercontent.com/Script-Hub-Org/Script-Hub/main/scripts/replace-header.js'
2116 : 'https://raw.githubusercontent.com/Script-Hub-Org/Script-Hub/main/scripts/replace-body.js'
2117 let rearg1 = x.split(breakpoint)[1].trim()
2118 let rearg2 = x.split(breakpoint)[2].trim()
2119 let jsarg = encodeURIComponent(rearg1 + '->' + rearg2)
2120 let rebody = /body/.test(hdorbd) ? 'true' : ''
2121 let size = /body/.test(hdorbd) ? '-1' : ''
2122 jsBox.push({ mark, noteK, jsname, jstype, jsptn, jsurl, rebody, size, timeout: '30', jsarg, ori: x, num: y })
2123}
2124
2125function getHn(x, arr, addMethod) {
2126 let hnBox2 = x

Callers 1

Rewrite-Parser.jsFile · 0.70

Calls 1

isNoteKFunction · 0.70

Tested by

no test coverage detected