MCPcopy Create free account
hub / github.com/idank/explainshell / D

Function D

explainshell/web/static/js/highlight.min.js:94–100  ·  view source on GitHub ↗
(e,t)

Source from the content-addressed store, hash-verified

92 if(e.begin||e.end)throw Error("begin & end are not supported with match")
93 ;e.begin=e.match,delete e.match}}function P(e,t){
94 void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return
95 ;if(e.starts)throw Error("beforeMatch cannot be used with starts")
96 ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]
97 })),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={
98 relevance:0,contains:[Object.assign(n,{endsParent:!0})]
99 },e.relevance=0,delete n.beforeMatch
100 },H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword"
101 ;function $(e,t,n=C){const i=Object.create(null)
102 ;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{
103 Object.assign(i,$(e[n],t,n))})),i;function s(e,n){

Callers

nothing calls this directly

Calls 2

hFunction · 0.70
gFunction · 0.70

Tested by

no test coverage detected