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

Function tr

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

Source from the content-addressed store, hash-verified

2023 Qn = [Pn, jn, In, Wn, Hn, Yn, Gn, Vn, Xn, Jn, Zn],
2024 Kn = Qn.reduce((t, e, n) => ((t[e] = 1 + n), t), {});
2025 function tr(t) {
2026 const e = V(t).slice(),
2027 n = {};
2028 (e.length || s("Missing time unit."),
2029 e.forEach((t) => {
2030 ut(Kn, t) ? (n[t] = 1) : s(`Invalid time unit: ${t}.`);
2031 }));
2032 return (
2033 (n[Wn] || n[Yn] ? 1 : 0) +
2034 (n[jn] || n[In] || n[Hn] ? 1 : 0) +
2035 (n[Gn] ? 1 : 0) >
2036 1 && s(`Incompatible time units: ${t}`),
2037 e.sort((t, e) => Kn[t] - Kn[e]),
2038 e
2039 );
2040 }
2041 const er = {
2042 [Pn]: "%Y ",
2043 [jn]: "Q%q ",

Callers 2

nrFunction · 0.70
_floorFunction · 0.70

Calls 3

VFunction · 0.70
sFunction · 0.70
utFunction · 0.70

Tested by

no test coverage detected