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

Method stringify

Script/BiliBili/ADBlock.js:465–465  ·  view source on GitHub ↗
(s=this.json)

Source from the content-addressed store, hash-verified

463
464// https://github.com/DualSubs/URL/blob/main/URLs.embedded.min.js
465function URLs(s){return new class{constructor(s=[]){this.name="URL v1.0.2",this.opts=s,this.json={scheme:"",host:"",path:"",params:{}}}parse(s){let t=s.match(/(?<scheme>.+):\/\/(?<host>[^/]+)\/?(?<path>[^?]+)?\??(?<params>.*)?/)?.groups??null;return t?.path||(t.path=""),t?.params&&(t.params=Object.fromEntries(t.params.split("&").map((s=>s.split("="))))),t}stringify(s=this.json){return s?.params?s.scheme+"://"+s.host+"/"+s.path+"?"+Object.entries(s.params).map((s=>s.join("="))).join("&"):s.scheme+"://"+s.host+"/"+s.path}}(s)}

Callers 6

ADBlock.jsFile · 0.45
toJsonStringMethod · 0.45
toStrMethod · 0.45
setjsonMethod · 0.45
setdataMethod · 0.45
queryStrMethod · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected