MCPcopy Create free account
hub / github.com/danvk/webdiff / B

Function B

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

EFunction · 0.70
mFunction · 0.70

Tested by

no test coverage detected