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

Function pulse

resources/vega.min.js:3388–3424  ·  view source on GitHub ↗
(s, u)

Source from the content-addressed store, hash-verified

3386 return ((a = !0), this);
3387 },
3388 pulse(s, u) {
3389 const l = {},
3390 c = {};
3391 let f, h, d, p, g, m;
3392 for (f = 0, h = u.length; f < h; ++f) l[ma(u[f])] = 1;
3393 for (f = 0, h = e.length; f < h; ++f) ((g = e[f]), (l[ma(g)] = -1));
3394 for (f = 0, h = r.length; f < h; ++f)
3395 ((p = r[f]),
3396 u.forEach((t) => {
3397 p(t) && (l[ma(t)] = -1);
3398 }));
3399 for (f = 0, h = t.length; f < h; ++f)
3400 ((g = t[f]), (m = ma(g)), l[m] ? (l[m] = 1) : s.add.push(va(t[f])));
3401 for (f = 0, h = u.length; f < h; ++f)
3402 ((g = u[f]), l[ma(g)] < 0 && s.rem.push(g));
3403 function y(t, e, n) {
3404 (n ? (t[e] = n(t)) : (s.encode = e), a || (c[ma(t)] = t));
3405 }
3406 for (f = 0, h = n.length; f < h; ++f)
3407 ((d = n[f]),
3408 (g = d.tuple),
3409 (p = d.field),
3410 (m = l[ma(g)]),
3411 m > 0 && (y(g, p, d.value), s.modifies(p)));
3412 for (f = 0, h = i.length; f < h; ++f)
3413 ((d = i[f]),
3414 (p = d.filter),
3415 u.forEach((t) => {
3416 p(t) && l[ma(t)] > 0 && y(t, d.field, d.value);
3417 }),
3418 s.modifies(d.field));
3419 if (a)
3420 s.mod =
3421 e.length || r.length ? u.filter((t) => l[ma(t)] > 0) : u.slice();
3422 else for (m in c) s.mod.push(c[m]);
3423 return ((o || (null == o && (e.length || r.length))) && s.clean(!0), s);
3424 },
3425 };
3426 }
3427 const Ma = "_:mod:_";

Callers

nothing calls this directly

Calls 4

maFunction · 0.70
pFunction · 0.70
vaFunction · 0.70
yFunction · 0.70

Tested by

no test coverage detected