zeed 0.7.114 → 0.7.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HERPZYOG.js → chunk-6JKKBAK5.js} +2 -2
- package/dist/{chunk-HERPZYOG.js.map → chunk-6JKKBAK5.js.map} +0 -0
- package/dist/{chunk-RR25VKTJ.js → chunk-E33OKTED.js} +2 -2
- package/dist/{chunk-RR25VKTJ.js.map → chunk-E33OKTED.js.map} +0 -0
- package/dist/{chunk-MN2DIK4K.js → chunk-NCTUXIN5.js} +149 -2
- package/dist/chunk-NCTUXIN5.js.map +1 -0
- package/dist/index.all.cjs +156 -1
- package/dist/index.all.cjs.map +1 -1
- package/dist/index.all.d.ts +3 -3
- package/dist/index.all.js +19 -3
- package/dist/index.browser.cjs +156 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +18 -2
- package/dist/index.node.cjs +156 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +18 -2
- package/dist/{log-colors-8f1ba30e.d.ts → log-colors-57db0f26.d.ts} +1 -1
- package/dist/{log-util-baebadc8.d.ts → log-util-05114da8.d.ts} +1 -1
- package/dist/{uuid-7c205442.d.ts → uuid-b2924ac6.d.ts} +29 -1
- package/package.json +13 -12
- package/dist/chunk-MN2DIK4K.js.map +0 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
cloneObject,
|
|
3
3
|
renderMessages,
|
|
4
4
|
toValidFilename
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NCTUXIN5.js";
|
|
6
6
|
import {
|
|
7
7
|
Logger,
|
|
8
8
|
__name,
|
|
@@ -530,4 +530,4 @@ export {
|
|
|
530
530
|
loggerStackTraceDebug,
|
|
531
531
|
LoggerNodeHandler
|
|
532
532
|
};
|
|
533
|
-
//# sourceMappingURL=chunk-
|
|
533
|
+
//# sourceMappingURL=chunk-6JKKBAK5.js.map
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-MYUIYPZU.js";
|
|
7
7
|
import {
|
|
8
8
|
isBrowser
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NCTUXIN5.js";
|
|
10
10
|
import {
|
|
11
11
|
Logger,
|
|
12
12
|
__name,
|
|
@@ -330,4 +330,4 @@ export {
|
|
|
330
330
|
LocalStorage,
|
|
331
331
|
LoggerBrowserClassicHandler
|
|
332
332
|
};
|
|
333
|
-
//# sourceMappingURL=chunk-
|
|
333
|
+
//# sourceMappingURL=chunk-E33OKTED.js.map
|
|
File without changes
|
|
@@ -272,6 +272,14 @@ function between(min, value, max) {
|
|
|
272
272
|
return Math.max(min, Math.min(max, value));
|
|
273
273
|
}
|
|
274
274
|
__name(between, "between");
|
|
275
|
+
function sum(array) {
|
|
276
|
+
return array.reduce((acc, value) => acc + value, 0);
|
|
277
|
+
}
|
|
278
|
+
__name(sum, "sum");
|
|
279
|
+
function avg(array) {
|
|
280
|
+
return sum(array) / array.length;
|
|
281
|
+
}
|
|
282
|
+
__name(avg, "avg");
|
|
275
283
|
|
|
276
284
|
// src/common/data/orderby.ts
|
|
277
285
|
function parseOrderby(value = "") {
|
|
@@ -417,6 +425,15 @@ function arrayMin(...array) {
|
|
|
417
425
|
return arrayFlatten(array).reduce((acc, value) => acc != null ? value < acc ? value : acc : value, void 0);
|
|
418
426
|
}
|
|
419
427
|
__name(arrayMin, "arrayMin");
|
|
428
|
+
function arraySum(...array) {
|
|
429
|
+
return arrayFlatten(array).reduce((acc, value) => acc + value, 0);
|
|
430
|
+
}
|
|
431
|
+
__name(arraySum, "arraySum");
|
|
432
|
+
function arrayAvg(...array) {
|
|
433
|
+
let flatArray = arrayFlatten(array);
|
|
434
|
+
return flatArray.reduce((acc, value) => acc + value, 0) / flatArray.length;
|
|
435
|
+
}
|
|
436
|
+
__name(arrayAvg, "arrayAvg");
|
|
420
437
|
function createArray(size2 = 0, item) {
|
|
421
438
|
if (size2 <= 0)
|
|
422
439
|
return [];
|
|
@@ -808,6 +825,7 @@ var Currency = _Currency;
|
|
|
808
825
|
__name(Currency, "Currency");
|
|
809
826
|
Currency.zero = new _Currency(0);
|
|
810
827
|
Currency.one = new _Currency(1);
|
|
828
|
+
Currency.hundred = new _Currency(100);
|
|
811
829
|
function parse(value, opts, useRounding = true) {
|
|
812
830
|
let v = 0, { decimal, errorOnInvalid, precision: decimals, fromCents } = opts, precision = pow(decimals), isNumber = typeof value === "number";
|
|
813
831
|
if (value instanceof Currency && fromCents) {
|
|
@@ -1046,7 +1064,6 @@ var Day = class {
|
|
|
1046
1064
|
if (mm === 0)
|
|
1047
1065
|
mm = 12;
|
|
1048
1066
|
let yy = Math.floor((m - 1) / 12);
|
|
1049
|
-
console.log("calc", m, mm, yy, [this.year + yy, mm, this.day]);
|
|
1050
1067
|
return Day.from([this.year + yy, mm, this.day]);
|
|
1051
1068
|
}
|
|
1052
1069
|
daysUntil(otherDay) {
|
|
@@ -1282,6 +1299,128 @@ function cloneJsonObject(obj) {
|
|
|
1282
1299
|
return JSON.parse(JSON.stringify(obj));
|
|
1283
1300
|
}
|
|
1284
1301
|
__name(cloneJsonObject, "cloneJsonObject");
|
|
1302
|
+
function memoize(fn) {
|
|
1303
|
+
let cache = /* @__PURE__ */ new Map();
|
|
1304
|
+
return (n) => {
|
|
1305
|
+
if (cache.has(n)) {
|
|
1306
|
+
return cache.get(n);
|
|
1307
|
+
}
|
|
1308
|
+
let result = fn(n);
|
|
1309
|
+
cache.set(n, result);
|
|
1310
|
+
return result;
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
__name(memoize, "memoize");
|
|
1314
|
+
|
|
1315
|
+
// src/common/data/xrx.ts
|
|
1316
|
+
var RX_WHITESPACE = /\\\s|\s+|#[^\n]*\n?/gm;
|
|
1317
|
+
var RX_REAL_GROUPS = /\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm;
|
|
1318
|
+
var RX_LOOK_BEHIND = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;
|
|
1319
|
+
function regExpString(rx) {
|
|
1320
|
+
return typeof rx === "string" ? rx : rx.source || "";
|
|
1321
|
+
}
|
|
1322
|
+
__name(regExpString, "regExpString");
|
|
1323
|
+
function regExpEscape(str) {
|
|
1324
|
+
return str.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1325
|
+
}
|
|
1326
|
+
__name(regExpEscape, "regExpEscape");
|
|
1327
|
+
var XRX = class {
|
|
1328
|
+
constructor(pattern2, flags) {
|
|
1329
|
+
this.namedGroups = {};
|
|
1330
|
+
this.names = [];
|
|
1331
|
+
let _flags = flags != null ? flags : "";
|
|
1332
|
+
let _rx;
|
|
1333
|
+
if (pattern2 instanceof RegExp) {
|
|
1334
|
+
if (flags == null) {
|
|
1335
|
+
_flags = pattern2.flags;
|
|
1336
|
+
}
|
|
1337
|
+
_rx = pattern2.source;
|
|
1338
|
+
} else {
|
|
1339
|
+
_rx = pattern2;
|
|
1340
|
+
}
|
|
1341
|
+
const extended = _flags && _flags.indexOf("x") !== -1;
|
|
1342
|
+
if (extended) {
|
|
1343
|
+
_flags = _flags.replace("x", "");
|
|
1344
|
+
_rx = _rx.replace(RX_WHITESPACE, (r) => {
|
|
1345
|
+
return r[0] === "\\" ? r : "";
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
if (!(pattern2 instanceof RegExp)) {
|
|
1349
|
+
let index = 0;
|
|
1350
|
+
_rx = _rx.replace(RX_REAL_GROUPS, (str, name) => {
|
|
1351
|
+
index += 1;
|
|
1352
|
+
if (name) {
|
|
1353
|
+
if (name !== "index" && name !== "length" && !this.namedGroups[name]) {
|
|
1354
|
+
this.namedGroups[name] = index;
|
|
1355
|
+
} else {
|
|
1356
|
+
console.error(`Unallowed or duplicate group name: ${name}`);
|
|
1357
|
+
}
|
|
1358
|
+
return "(";
|
|
1359
|
+
}
|
|
1360
|
+
return str;
|
|
1361
|
+
});
|
|
1362
|
+
this.names = Object.keys(this.namedGroups);
|
|
1363
|
+
}
|
|
1364
|
+
_rx = regExpString(_rx);
|
|
1365
|
+
RX_LOOK_BEHIND.lastIndex = 0;
|
|
1366
|
+
let parts = RX_LOOK_BEHIND.exec(_rx);
|
|
1367
|
+
if (parts) {
|
|
1368
|
+
this.lookBehind = {
|
|
1369
|
+
rx: new RegExp(`${parts[3]}$(?!\\s)`),
|
|
1370
|
+
expect: parts ? parts[2] === "=" : !parts
|
|
1371
|
+
};
|
|
1372
|
+
_rx = _rx.substr(parts[0].length);
|
|
1373
|
+
}
|
|
1374
|
+
this.rx = new RegExp(_rx, _flags);
|
|
1375
|
+
}
|
|
1376
|
+
get lastIndex() {
|
|
1377
|
+
return this.rx.lastIndex;
|
|
1378
|
+
}
|
|
1379
|
+
set lastIndex(index) {
|
|
1380
|
+
this.rx.lastIndex = index;
|
|
1381
|
+
}
|
|
1382
|
+
_handleMatch(m) {
|
|
1383
|
+
if (this.lookBehind) {
|
|
1384
|
+
let leftContext = m.input.slice(0, m.index);
|
|
1385
|
+
if (this.lookBehind.expect !== this.lookBehind.rx.test(leftContext)) {
|
|
1386
|
+
return null;
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
for (let name of this.names) {
|
|
1390
|
+
m[name] = m[this.namedGroups[name]];
|
|
1391
|
+
}
|
|
1392
|
+
return m;
|
|
1393
|
+
}
|
|
1394
|
+
exec(str) {
|
|
1395
|
+
let m;
|
|
1396
|
+
while (m = this.rx.exec(str)) {
|
|
1397
|
+
if (this.rx.lastIndex === m.index) {
|
|
1398
|
+
this.rx.lastIndex++;
|
|
1399
|
+
}
|
|
1400
|
+
m = this._handleMatch(m);
|
|
1401
|
+
if (m != null) {
|
|
1402
|
+
return m;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
execAll(str) {
|
|
1407
|
+
let matches = [];
|
|
1408
|
+
let m;
|
|
1409
|
+
this.rx.lastIndex = 0;
|
|
1410
|
+
while (m = this.exec(str)) {
|
|
1411
|
+
matches.push(m);
|
|
1412
|
+
}
|
|
1413
|
+
this.rx.lastIndex = 0;
|
|
1414
|
+
return matches;
|
|
1415
|
+
}
|
|
1416
|
+
replace(str, replacement) {
|
|
1417
|
+
let fn = typeof replacement === "function" ? replacement : () => replacement;
|
|
1418
|
+
return str.replace(this.rx, (m) => {
|
|
1419
|
+
return fn(m);
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
__name(XRX, "XRX");
|
|
1285
1424
|
|
|
1286
1425
|
// src/common/dispose-defer.ts
|
|
1287
1426
|
var log3 = Logger("dispose");
|
|
@@ -2451,6 +2590,8 @@ export {
|
|
|
2451
2590
|
randomInt,
|
|
2452
2591
|
randomFloat,
|
|
2453
2592
|
between,
|
|
2593
|
+
sum,
|
|
2594
|
+
avg,
|
|
2454
2595
|
parseOrderby,
|
|
2455
2596
|
composeOrderby,
|
|
2456
2597
|
cmp,
|
|
@@ -2475,6 +2616,8 @@ export {
|
|
|
2475
2616
|
arrayRandomElement,
|
|
2476
2617
|
arrayMax,
|
|
2477
2618
|
arrayMin,
|
|
2619
|
+
arraySum,
|
|
2620
|
+
arrayAvg,
|
|
2478
2621
|
createArray,
|
|
2479
2622
|
useBase,
|
|
2480
2623
|
encodeBase16,
|
|
@@ -2552,6 +2695,10 @@ export {
|
|
|
2552
2695
|
empty,
|
|
2553
2696
|
cloneObject,
|
|
2554
2697
|
cloneJsonObject,
|
|
2698
|
+
memoize,
|
|
2699
|
+
regExpString,
|
|
2700
|
+
regExpEscape,
|
|
2701
|
+
XRX,
|
|
2555
2702
|
useDispose,
|
|
2556
2703
|
useDisposer,
|
|
2557
2704
|
useDefer,
|
|
@@ -2607,4 +2754,4 @@ export {
|
|
|
2607
2754
|
throttle,
|
|
2608
2755
|
debounce
|
|
2609
2756
|
};
|
|
2610
|
-
//# sourceMappingURL=chunk-
|
|
2757
|
+
//# sourceMappingURL=chunk-NCTUXIN5.js.map
|