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

Function _i

resources/vega-lite.min.js:1162–1225  ·  view source on GitHub ↗
(e, n)

Source from the content-addressed store, hash-verified

1160 ],
1161 Ci = zi.map((e) => e.substr(0, 3));
1162 function _i(e, n) {
1163 const i = [];
1164 if (
1165 (n &&
1166 void 0 !== e.day &&
1167 D(e).length > 1 &&
1168 (Si(
1169 (function (e) {
1170 return `Dropping day from datetime ${Q(e)} as day cannot be combined with other units.`;
1171 })(e),
1172 ),
1173 delete (e = l(e)).day),
1174 void 0 !== e.year ? i.push(e.year) : i.push(2012),
1175 void 0 !== e.month)
1176 ) {
1177 const r = n
1178 ? (function (e) {
1179 if ((G(e) && (e = +e), t.isNumber(e))) return e - 1;
1180 {
1181 const t = e.toLowerCase(),
1182 n = Fi.indexOf(t);
1183 if (-1 !== n) return n;
1184 const i = t.substr(0, 3),
1185 r = Oi.indexOf(i);
1186 if (-1 !== r) return r;
1187 throw new Error(vi("month", e));
1188 }
1189 })(e.month)
1190 : e.month;
1191 i.push(r);
1192 } else if (void 0 !== e.quarter) {
1193 const r = n
1194 ? (function (e) {
1195 if ((G(e) && (e = +e), t.isNumber(e)))
1196 return (e > 4 && Si(vi("quarter", e)), e - 1);
1197 throw new Error(vi("quarter", e));
1198 })(e.quarter)
1199 : e.quarter;
1200 i.push(t.isNumber(r) ? 3 * r : `${r}*3`);
1201 } else i.push(0);
1202 if (void 0 !== e.date) i.push(e.date);
1203 else if (void 0 !== e.day) {
1204 const r = n
1205 ? (function (e) {
1206 if ((G(e) && (e = +e), t.isNumber(e))) return e % 7;
1207 {
1208 const t = e.toLowerCase(),
1209 n = zi.indexOf(t);
1210 if (-1 !== n) return n;
1211 const i = t.substr(0, 3),
1212 r = Ci.indexOf(i);
1213 if (-1 !== r) return r;
1214 throw new Error(vi("day", e));
1215 }
1216 })(e.day)
1217 : e.day;
1218 i.push(t.isNumber(r) ? r + 1 : `${r}+1`);
1219 } else i.push(1);

Callers 3

PiFunction · 0.70
UiFunction · 0.70
VcFunction · 0.70

Calls 6

DFunction · 0.85
SiFunction · 0.70
QFunction · 0.70
lFunction · 0.70
GFunction · 0.70
viFunction · 0.70

Tested by

no test coverage detected