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

Function pO

resources/vega.min.js:30521–30561  ·  view source on GitHub ↗
(t, e, n)

Source from the content-addressed store, hash-verified

30519 }
30520 const dO = { code: "_.$value", ast: { type: "Identifier", value: "value" } };
30521 function pO(t, e, n) {
30522 const r = t.encode,
30523 i = { target: n };
30524 let o = t.events,
30525 a = t.update,
30526 u = [];
30527 (o || s("Signal update missing events specification."),
30528 _t(o) && (o = tN(o, e.isSubscope() ? eO : nO)),
30529 (o = V(o).filter((t) => (t.signal || t.scale ? (u.push(t), 0) : 1))),
30530 u.length > 1 && (u = [gO(u)]),
30531 o.length && u.push(o.length > 1 ? { merge: o } : o[0]),
30532 null != r &&
30533 (a && s("Signal encode and update are mutually exclusive."),
30534 (a = "encode(item()," + Dt(r) + ")")),
30535 (i.update = _t(a)
30536 ? BB(a, e)
30537 : null != a.expr
30538 ? BB(a.expr, e)
30539 : null != a.value
30540 ? a.value
30541 : null != a.signal
30542 ? { $expr: dO, $params: { $value: e.signalRef(a.signal) } }
30543 : s("Invalid signal update specification.")),
30544 t.force && (i.options = { force: !0 }),
30545 u.forEach((t) =>
30546 e.addUpdate(
30547 ot(
30548 (function (t, e) {
30549 return {
30550 source: t.signal
30551 ? e.signalRef(t.signal)
30552 : t.scale
30553 ? e.scaleRef(t.scale)
30554 : uO(t, e),
30555 };
30556 })(t, e),
30557 i,
30558 ),
30559 ),
30560 ));
30561 }
30562 function gO(t) {
30563 return {
30564 signal:

Callers 1

cUFunction · 0.85

Calls 9

tNFunction · 0.85
gOFunction · 0.85
DtFunction · 0.85
BBFunction · 0.85
uOFunction · 0.85
sFunction · 0.70
_tFunction · 0.70
VFunction · 0.70
otFunction · 0.70

Tested by

no test coverage detected