MCPcopy Create free account
hub / github.com/alignoth/alignoth / wT

Function wT

resources/vega.min.js:27729–27810  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

27727 };
27728 }
27729 function wT(t) {
27730 const e = (t = t || {}).allowed ? Tt(t.allowed) : {},
27731 n = t.forbidden ? Tt(t.forbidden) : {},
27732 r = t.constants || xT,
27733 i = (t.functions || bT)(h),
27734 o = t.globalvar,
27735 a = t.fieldvar,
27736 u = J(o) ? o : (t) => `${o}["${t}"]`;
27737 let l = {},
27738 c = {},
27739 f = 0;
27740 function h(t) {
27741 if (_t(t)) return t;
27742 const e = d[t.type];
27743 return (null == e && s("Unsupported type: " + t.type), e(t));
27744 }
27745 const d = {
27746 Literal: (t) => t.raw,
27747 Identifier: (t) => {
27748 const i = t.name;
27749 return f > 0
27750 ? i
27751 : ut(n, i)
27752 ? s("Illegal identifier: " + i)
27753 : ut(r, i)
27754 ? r[i]
27755 : ut(e, i)
27756 ? i
27757 : ((l[i] = 1), u(i));
27758 },
27759 MemberExpression: (t) => {
27760 const e = !t.computed,
27761 n = h(t.object);
27762 e && (f += 1);
27763 const r = h(t.property);
27764 return (
27765 n === a &&
27766 (c[
27767 (function (t) {
27768 const e = t && t.length - 1;
27769 return e &&
27770 (('"' === t[0] && '"' === t[e]) ||
27771 ("'" === t[0] && "'" === t[e]))
27772 ? t.slice(1, -1)
27773 : t;
27774 })(r)
27775 ] = 1),
27776 e && (f -= 1),
27777 n + (e ? "." + r : "[" + r + "]")
27778 );
27779 },
27780 CallExpression: (t) => {
27781 "Identifier" !== t.callee.type &&
27782 s("Illegal callee type: " + t.callee.type);
27783 const e = t.callee.name,
27784 n = t.arguments,
27785 r = ut(i, e) && i[e];
27786 return (

Callers 1

vega.min.jsFile · 0.85

Calls 8

TtFunction · 0.85
JFunction · 0.70
utFunction · 0.70
sFunction · 0.70
uFunction · 0.70
hFunction · 0.70
rFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected