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

Function Y

webdiff/static/js/highlight.min.js:101–105  ·  view source on GitHub ↗
(e,t,a="keyword")

Source from the content-addressed store, hash-verified

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){
104t&&(a=a.map((e=>e.toLowerCase()))),a.forEach((t=>{const a=t.split("|")
105;n[a[0]]=[e,H(a[0],a[1])]}))}}function H(e,t){
106return t?Number(t):(e=>G.includes(e.toLowerCase()))(e)?0:1}const V={},q=e=>{
107console.error(e)},z=(e,...t)=>{console.log("WARN: "+e,...t)},$=(e,t)=>{
108V[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),V[`${e}/${t}`]=!0)

Callers 1

jFunction · 0.85

Calls 1

rFunction · 0.70

Tested by

no test coverage detected