@zelgadis87/utils-core 4.4.4 → 4.6.0

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.
Files changed (68) hide show
  1. package/esbuild/index.cjs +207 -270
  2. package/esbuild/{index.mjs → index.js} +197 -282
  3. package/esbuild/package.json +39 -0
  4. package/package.json +14 -102
  5. package/src/async/Semaphore.ts +8 -6
  6. package/src/time/TimeDuration.ts +22 -11
  7. package/src/time/TimeInstant.ts +38 -21
  8. package/src/utils/arrays/groupBy.ts +11 -11
  9. package/src/utils/arrays.ts +9 -3
  10. package/src/utils/functions/constant.ts +2 -0
  11. package/src/utils/functions.ts +23 -0
  12. package/src/utils/random.ts +9 -3
  13. package/src/utils/records.ts +12 -0
  14. package/dist/Logger.d.ts +0 -21
  15. package/dist/Optional.d.ts +0 -70
  16. package/dist/async/CancelableDeferred.d.ts +0 -17
  17. package/dist/async/Deferred.d.ts +0 -34
  18. package/dist/async/RateThrottler.d.ts +0 -13
  19. package/dist/async/Semaphore.d.ts +0 -14
  20. package/dist/async/index.d.ts +0 -4
  21. package/dist/index.d.ts +0 -8
  22. package/dist/lazy/Lazy.d.ts +0 -22
  23. package/dist/lazy/LazyAsync.d.ts +0 -24
  24. package/dist/lazy/index.d.ts +0 -2
  25. package/dist/sorting/ComparisonChain.d.ts +0 -57
  26. package/dist/sorting/Sorter.d.ts +0 -100
  27. package/dist/sorting/index.d.ts +0 -4
  28. package/dist/sorting/types.d.ts +0 -5
  29. package/dist/time/RandomTimeDuration.d.ts +0 -9
  30. package/dist/time/TimeBase.d.ts +0 -38
  31. package/dist/time/TimeDuration.d.ts +0 -79
  32. package/dist/time/TimeFrequency.d.ts +0 -10
  33. package/dist/time/TimeInstant.d.ts +0 -171
  34. package/dist/time/TimeInstantBuilder.d.ts +0 -77
  35. package/dist/time/TimeRange.d.ts +0 -11
  36. package/dist/time/TimeUnit.d.ts +0 -17
  37. package/dist/time/index.d.ts +0 -7
  38. package/dist/time/types.d.ts +0 -26
  39. package/dist/tsconfig.tsbuildinfo +0 -1
  40. package/dist/upgrade/DataUpgrader.d.ts +0 -22
  41. package/dist/upgrade/errors.d.ts +0 -12
  42. package/dist/upgrade/getTransitionsPath.d.ts +0 -3
  43. package/dist/upgrade/index.d.ts +0 -2
  44. package/dist/upgrade/types.d.ts +0 -31
  45. package/dist/utils/arrays/groupBy.d.ts +0 -9
  46. package/dist/utils/arrays/indexBy.d.ts +0 -7
  47. package/dist/utils/arrays/statistics.d.ts +0 -8
  48. package/dist/utils/arrays/uniqBy.d.ts +0 -4
  49. package/dist/utils/arrays.d.ts +0 -56
  50. package/dist/utils/booleans.d.ts +0 -2
  51. package/dist/utils/empties.d.ts +0 -17
  52. package/dist/utils/errors/withTryCatch.d.ts +0 -3
  53. package/dist/utils/errors.d.ts +0 -3
  54. package/dist/utils/functions/constant.d.ts +0 -8
  55. package/dist/utils/functions/iff.d.ts +0 -8
  56. package/dist/utils/functions.d.ts +0 -27
  57. package/dist/utils/index.d.ts +0 -13
  58. package/dist/utils/json.d.ts +0 -11
  59. package/dist/utils/nulls.d.ts +0 -8
  60. package/dist/utils/numbers/round.d.ts +0 -8
  61. package/dist/utils/numbers.d.ts +0 -34
  62. package/dist/utils/primitives.d.ts +0 -3
  63. package/dist/utils/promises.d.ts +0 -6
  64. package/dist/utils/random.d.ts +0 -2
  65. package/dist/utils/records/entries.d.ts +0 -4
  66. package/dist/utils/records.d.ts +0 -21
  67. package/dist/utils/strings/StringParts.d.ts +0 -32
  68. package/dist/utils/strings.d.ts +0 -17
package/esbuild/index.cjs CHANGED
@@ -1,13 +1,8 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
6
  var __export = (target, all) => {
12
7
  for (var name in all)
13
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,155 +15,9 @@ var __copyProps = (to, from, except, desc) => {
20
15
  }
21
16
  return to;
22
17
  };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
19
 
33
- // ../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/lib/format.js
34
- var require_format = __commonJS({
35
- "../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/lib/format.js"(exports2) {
36
- "use strict";
37
- Object.defineProperty(exports2, "__esModule", {
38
- value: true
39
- });
40
- exports2["default"] = format2;
41
- function ownKeys(object, enumerableOnly) {
42
- var keys = Object.keys(object);
43
- if (Object.getOwnPropertySymbols) {
44
- var symbols = Object.getOwnPropertySymbols(object);
45
- if (enumerableOnly) {
46
- symbols = symbols.filter(function(sym) {
47
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
48
- });
49
- }
50
- keys.push.apply(keys, symbols);
51
- }
52
- return keys;
53
- }
54
- function _objectSpread(target) {
55
- for (var i = 1; i < arguments.length; i++) {
56
- var source = arguments[i] != null ? arguments[i] : {};
57
- if (i % 2) {
58
- ownKeys(Object(source), true).forEach(function(key) {
59
- _defineProperty(target, key, source[key]);
60
- });
61
- } else if (Object.getOwnPropertyDescriptors) {
62
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
63
- } else {
64
- ownKeys(Object(source)).forEach(function(key) {
65
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
66
- });
67
- }
68
- }
69
- return target;
70
- }
71
- function _defineProperty(obj, key, value) {
72
- if (key in obj) {
73
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
74
- } else {
75
- obj[key] = value;
76
- }
77
- return obj;
78
- }
79
- var PATTERN_REGEX = /(M|y|d|D|h|H|m|s|S|G|Z|P|a)+/g;
80
- var ESCAPE_REGEX = /\\"|"((?:\\"|[^"])*)"|(\+)/g;
81
- var optionNames = {
82
- y: "year",
83
- M: "month",
84
- d: "day",
85
- D: "weekday",
86
- S: "fractionalSecondDigits",
87
- G: "era",
88
- Z: "timeZoneName",
89
- P: "dayPeriod",
90
- a: "hour12",
91
- h: "hour",
92
- H: "hour",
93
- m: "minute",
94
- s: "second"
95
- };
96
- var values = {
97
- y: ["numeric", "2-digit", void 0, "numeric"],
98
- M: ["narrow", "2-digit", "short", "long"],
99
- d: ["numeric", "2-digit"],
100
- D: ["narrow", "short", "long"],
101
- S: [1, 2, 3],
102
- G: ["narrow", "short", "long"],
103
- Z: ["short", "long"],
104
- P: ["narrow", "short", "long"],
105
- a: [true],
106
- h: ["numeric", "2-digit"],
107
- H: ["numeric", "2-digit"],
108
- m: ["numeric", "2-digit"],
109
- s: ["numeric", "2-digit"]
110
- };
111
- function padIf(condition, value, length) {
112
- return condition && length === 2 && value / 10 < 1 ? "0" + value : value;
113
- }
114
- function formatType(date, type, length) {
115
- var _options;
116
- var _ref = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, locale = _ref.locale, timeZone = _ref.timeZone;
117
- var option = optionNames[type];
118
- var value = values[type][length - 1];
119
- if (!value) {
120
- return;
121
- }
122
- var options = (_options = {}, _defineProperty(_options, option, value), _defineProperty(_options, "timeZone", timeZone), _options);
123
- if (type === "a") {
124
- return Intl.DateTimeFormat(locale, _objectSpread(_objectSpread({}, options), {}, {
125
- hour: "numeric"
126
- })).formatToParts(date).pop().value;
127
- }
128
- if (type === "G" || type === "Z") {
129
- return Intl.DateTimeFormat(locale, options).formatToParts(date).pop().value;
130
- }
131
- if (type === "H" || type === "h") {
132
- return Intl.DateTimeFormat("en-GB", _objectSpread(_objectSpread({}, options), {}, {
133
- hourCycle: type === "H" ? "h23" : "h11"
134
- })).format(date).toLocaleLowerCase().replace(" am", "").replace(" pm", "");
135
- }
136
- return padIf(["m", "s"].includes(type) && value === "2-digit", Intl.DateTimeFormat(locale, options).format(date), 2);
137
- }
138
- function format2(date, pattern, config) {
139
- return pattern.split(ESCAPE_REGEX).filter(function(sub) {
140
- return sub !== void 0;
141
- }).map(function(sub, index) {
142
- if (index % 2 !== 0) {
143
- return sub;
144
- }
145
- return sub.replace(PATTERN_REGEX, function(match) {
146
- var type = match.charAt(0);
147
- return formatType(date, type, match.length, config) || match;
148
- });
149
- }).join("");
150
- }
151
- }
152
- });
153
-
154
- // ../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/lib/index.js
155
- var require_lib = __commonJS({
156
- "../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/lib/index.js"(exports2) {
157
- "use strict";
158
- Object.defineProperty(exports2, "__esModule", {
159
- value: true
160
- });
161
- exports2.format = void 0;
162
- var _format = require_format();
163
- var _format2 = _interopRequireDefault(_format);
164
- function _interopRequireDefault(obj) {
165
- return obj && obj.__esModule ? obj : { "default": obj };
166
- }
167
- exports2.format = _format2["default"];
168
- }
169
- });
170
-
171
- // src/index.ts
20
+ // packages/core/src/index.ts
172
21
  var src_exports = {};
173
22
  __export(src_exports, {
174
23
  ComparisonChain: () => ComparisonChain_default,
@@ -193,6 +42,9 @@ __export(src_exports, {
193
42
  TimeInstant: () => TimeInstant,
194
43
  TimeRange: () => TimeRange,
195
44
  TimeUnit: () => TimeUnit,
45
+ alwaysFalse: () => alwaysFalse,
46
+ alwaysTrue: () => alwaysTrue,
47
+ and: () => and,
196
48
  asError: () => asError,
197
49
  asPromise: () => asPromise,
198
50
  average: () => average,
@@ -267,6 +119,7 @@ __export(src_exports, {
267
119
  isZero: () => isZero,
268
120
  jsonCloneDeep: () => jsonCloneDeep,
269
121
  last: () => last,
122
+ makeArrayEmpty: () => makeArrayEmpty,
270
123
  mapDefined: () => mapDefined,
271
124
  mapEntries: () => mapEntries,
272
125
  mapFirstTruthy: () => mapFirstTruthy,
@@ -277,8 +130,10 @@ __export(src_exports, {
277
130
  minBy: () => minBy,
278
131
  multiplyBy: () => multiplyBy,
279
132
  noop: () => noop,
133
+ not: () => not,
280
134
  omit: () => omit,
281
135
  omitFromJsonObject: () => omitFromJsonObject,
136
+ or: () => or,
282
137
  pad: () => pad,
283
138
  padLeft: () => padLeft,
284
139
  padRight: () => padRight,
@@ -286,7 +141,9 @@ __export(src_exports, {
286
141
  pick: () => pick,
287
142
  pluralize: () => pluralize,
288
143
  promiseSequence: () => promiseSequence,
144
+ randomId: () => randomId,
289
145
  randomInterval: () => randomInterval,
146
+ randomNumberInInterval: () => randomNumberInInterval,
290
147
  randomPercentage: () => randomPercentage,
291
148
  range: () => range,
292
149
  repeat: () => repeat,
@@ -313,11 +170,12 @@ __export(src_exports, {
313
170
  withTryCatch: () => withTryCatch,
314
171
  withTryCatchAsync: () => withTryCatchAsync,
315
172
  wrap: () => wrap,
316
- wrapWithString: () => wrapWithString
173
+ wrapWithString: () => wrapWithString,
174
+ xor: () => xor
317
175
  });
318
176
  module.exports = __toCommonJS(src_exports);
319
177
 
320
- // src/async/Deferred.ts
178
+ // packages/core/src/async/Deferred.ts
321
179
  var DeferredCanceledError = class extends Error {
322
180
  constructor() {
323
181
  super("Execution canceled");
@@ -402,7 +260,7 @@ var Deferred = class {
402
260
  };
403
261
  var Deferred_default = Deferred;
404
262
 
405
- // src/async/RateThrottler.ts
263
+ // packages/core/src/async/RateThrottler.ts
406
264
  var RateThrottler = class {
407
265
  constructor(_frequency) {
408
266
  this._frequency = _frequency;
@@ -422,7 +280,8 @@ var RateThrottler = class {
422
280
  return slot.promise().then(() => fn());
423
281
  } finally {
424
282
  this._availableSlots.push(TimeInstant.now().addDuration(this.cooldown));
425
- if (this._waitingRequests.length > 0) this._waitingRequests.shift().resolve();
283
+ if (this._waitingRequests.length > 0)
284
+ this._waitingRequests.shift().resolve();
426
285
  }
427
286
  };
428
287
  if (this._availableSlots.length > 0) {
@@ -441,7 +300,7 @@ function throttle(fn, frequence) {
441
300
  };
442
301
  }
443
302
 
444
- // src/async/Semaphore.ts
303
+ // packages/core/src/async/Semaphore.ts
445
304
  var Semaphore = class {
446
305
  constructor(_availableSlots = 1) {
447
306
  this._availableSlots = _availableSlots;
@@ -470,8 +329,8 @@ var Semaphore = class {
470
329
  }
471
330
  }
472
331
  async execute(fn, cooldown = TimeDuration.ZERO) {
473
- return this._awaitSlot().then(() => fn()).finally(() => {
474
- void cooldown.promise().then(() => this._releaseSlot());
332
+ return this._awaitSlot().then(fn).finally(() => {
333
+ void cooldown.delay(() => this._releaseSlot());
475
334
  });
476
335
  }
477
336
  get availableSlots() {
@@ -485,7 +344,33 @@ var Semaphore = class {
485
344
  }
486
345
  };
487
346
 
488
- // src/utils/arrays/groupBy.ts
347
+ // packages/core/src/utils/nulls.ts
348
+ function ensureDefined(v, name = "value") {
349
+ if (isDefined(v))
350
+ return v;
351
+ throw new Error("Expected " + name + " to be defined, got: " + v);
352
+ }
353
+ function isDefined(x) {
354
+ return x !== null && x !== void 0;
355
+ }
356
+ function isNullOrUndefined(x) {
357
+ return x === null || x === void 0;
358
+ }
359
+ function ifDefined(source, callback) {
360
+ if (isDefined(source))
361
+ callback(source);
362
+ }
363
+ function mapDefined(source, mapper) {
364
+ if (isDefined(source))
365
+ return mapper(source);
366
+ return null;
367
+ }
368
+ function ifNullOrUndefined(source, callback) {
369
+ if (isNullOrUndefined(source))
370
+ callback();
371
+ }
372
+
373
+ // packages/core/src/utils/arrays/groupBy.ts
489
374
  function groupByString(arr, field) {
490
375
  return groupByStringWith(arr, (t) => t[field]);
491
376
  }
@@ -511,7 +396,7 @@ function groupBySymbolWith(arr, getter) {
511
396
  return doGroupByWith(arr, getter);
512
397
  }
513
398
  function doGroupByWith(arr, getter) {
514
- return arr.reduce((dict, cur) => {
399
+ return [...arr].reduce((dict, cur) => {
515
400
  const key = getter(cur);
516
401
  if (key !== null && key !== void 0) {
517
402
  const arr2 = dict[key] ?? [];
@@ -522,7 +407,7 @@ function doGroupByWith(arr, getter) {
522
407
  }, {});
523
408
  }
524
409
 
525
- // src/utils/arrays/indexBy.ts
410
+ // packages/core/src/utils/arrays/indexBy.ts
526
411
  function indexByString(arr, field) {
527
412
  return indexByStringWith(arr, (t) => t[field]);
528
413
  }
@@ -550,7 +435,7 @@ function doIndexByWith(arr, getter) {
550
435
  }, {});
551
436
  }
552
437
 
553
- // src/utils/arrays/statistics.ts
438
+ // packages/core/src/utils/arrays/statistics.ts
554
439
  function average(arr) {
555
440
  const f = 1 / arr.length;
556
441
  return arr.reduce((tot, cur) => tot + cur * f, 0);
@@ -562,21 +447,23 @@ function sumBy(arr, getter) {
562
447
  return sum(arr.map(getter));
563
448
  }
564
449
  function min(arr) {
565
- if (arr.length === 0) throw new Error("Cannot calculate value on empty array");
450
+ if (arr.length === 0)
451
+ throw new Error("Cannot calculate value on empty array");
566
452
  return arr.reduce((min2, cur) => cur < min2 ? cur : min2);
567
453
  }
568
454
  function minBy(arr, getter) {
569
455
  return min(arr.map(getter));
570
456
  }
571
457
  function max(arr) {
572
- if (arr.length === 0) throw new Error("Cannot calculate value on empty array");
458
+ if (arr.length === 0)
459
+ throw new Error("Cannot calculate value on empty array");
573
460
  return arr.reduce((max2, cur) => cur > max2 ? cur : max2);
574
461
  }
575
462
  function maxBy(arr, getter) {
576
463
  return max(arr.map(getter));
577
464
  }
578
465
 
579
- // src/utils/functions/constant.ts
466
+ // packages/core/src/utils/functions/constant.ts
580
467
  function constant(v) {
581
468
  return () => v;
582
469
  }
@@ -586,10 +473,12 @@ function identity(t) {
586
473
  var constantNull = constant(null);
587
474
  var constantTrue = constant(true);
588
475
  var constantFalse = constant(false);
476
+ var alwaysTrue = constantTrue;
477
+ var alwaysFalse = constantFalse;
589
478
  var constantZero = constant(0);
590
479
  var constantOne = constant(1);
591
480
 
592
- // src/utils/functions/iff.ts
481
+ // packages/core/src/utils/functions/iff.ts
593
482
  function iff(firstPredicate, valueIfTrue) {
594
483
  if (firstPredicate === true || firstPredicate instanceof Function && firstPredicate() === true) {
595
484
  const ret = {
@@ -606,7 +495,7 @@ function iff(firstPredicate, valueIfTrue) {
606
495
  }
607
496
  }
608
497
 
609
- // src/utils/functions.ts
498
+ // packages/core/src/utils/functions.ts
610
499
  function isFunction(t) {
611
500
  return typeof t === "function";
612
501
  }
@@ -615,8 +504,28 @@ function noop() {
615
504
  function filterWithTypePredicate(filter) {
616
505
  return (t) => filter(t);
617
506
  }
507
+ function not(predicate) {
508
+ return (t) => !predicate(t);
509
+ }
510
+ function and(...predicates) {
511
+ if (predicates.length === 0)
512
+ return constantTrue;
513
+ else if (predicates.length === 1)
514
+ return predicates[0];
515
+ return (t) => predicates.reduce((prev, cur) => prev ? cur(t) : false, true);
516
+ }
517
+ function or(...predicates) {
518
+ if (predicates.length === 0)
519
+ return constantTrue;
520
+ else if (predicates.length === 1)
521
+ return predicates[0];
522
+ return (t) => predicates.reduce((prev, cur) => prev ? true : cur(t), false);
523
+ }
524
+ function xor(a, b) {
525
+ return (t) => a(t) !== b(t);
526
+ }
618
527
 
619
- // src/utils/arrays/uniqBy.ts
528
+ // packages/core/src/utils/arrays/uniqBy.ts
620
529
  function uniq(arr) {
621
530
  return uniqBy(arr, identity);
622
531
  }
@@ -637,11 +546,15 @@ function uniqByKey(arr, key) {
637
546
  return uniqBy(arr, (item) => item[key]);
638
547
  }
639
548
 
640
- // src/utils/arrays.ts
549
+ // packages/core/src/utils/arrays.ts
641
550
  function ensureArray(t) {
551
+ if (isNullOrUndefined(t))
552
+ return [];
642
553
  return t instanceof Array ? t : [t];
643
554
  }
644
555
  function ensureReadableArray(t) {
556
+ if (isNullOrUndefined(t))
557
+ return [];
645
558
  return t instanceof Array ? t : [t];
646
559
  }
647
560
  function isArray(t) {
@@ -660,7 +573,8 @@ function upsert(arr, item, isEqual) {
660
573
  }
661
574
  }
662
575
  function range(start, end) {
663
- if (end < start) throw new Error();
576
+ if (end < start)
577
+ throw new Error();
664
578
  let length = end - start + 1;
665
579
  return new Array(length).fill(1).map((_, i) => start + i);
666
580
  }
@@ -719,12 +633,16 @@ function partition(arr, predicate) {
719
633
  function mapFirstTruthy(arr, mapFn) {
720
634
  for (let i = 0; i < arr.length; i++) {
721
635
  const result = mapFn(arr[i]);
722
- if (result) return result;
636
+ if (result)
637
+ return result;
723
638
  }
724
639
  return null;
725
640
  }
641
+ function makeArrayEmpty(arr) {
642
+ arr.splice(0, arr.length);
643
+ }
726
644
 
727
- // src/utils/booleans.ts
645
+ // packages/core/src/utils/booleans.ts
728
646
  function isTrue(x) {
729
647
  return x === true;
730
648
  }
@@ -732,7 +650,7 @@ function isFalse(x) {
732
650
  return x === false;
733
651
  }
734
652
 
735
- // src/utils/errors/withTryCatch.ts
653
+ // packages/core/src/utils/errors/withTryCatch.ts
736
654
  function withTryCatch(fn, errMapFn) {
737
655
  try {
738
656
  return [fn(), void 0];
@@ -744,7 +662,7 @@ async function withTryCatchAsync(fn, errMapFn) {
744
662
  return fn().then((value) => [value, void 0], (e) => [void 0, (errMapFn ?? identity)(asError(e))]);
745
663
  }
746
664
 
747
- // src/utils/errors.ts
665
+ // packages/core/src/utils/errors.ts
748
666
  function asError(e) {
749
667
  if (e === void 0 || e === null)
750
668
  return new Error("Void message");
@@ -760,12 +678,13 @@ function isError(e) {
760
678
  return e instanceof Error;
761
679
  }
762
680
 
763
- // src/utils/json.ts
681
+ // packages/core/src/utils/json.ts
764
682
  function tryToParseJson(jsonContent) {
765
683
  return withTryCatch(() => JSON.parse(jsonContent));
766
684
  }
767
685
  function jsonCloneDeep(a) {
768
- if (null === a || "object" !== typeof a) return a;
686
+ if (null === a || "object" !== typeof a)
687
+ return a;
769
688
  if (a instanceof Date) {
770
689
  return new Date(a.getTime());
771
690
  } else if (a instanceof Array) {
@@ -792,33 +711,7 @@ function omitFromJsonObject(o, ...keys) {
792
711
  }
793
712
  var omit = omitFromJsonObject;
794
713
 
795
- // src/utils/nulls.ts
796
- function ensureDefined(v, name = "value") {
797
- if (isDefined(v))
798
- return v;
799
- throw new Error("Expected " + name + " to be defined, got: " + v);
800
- }
801
- function isDefined(x) {
802
- return x !== null && x !== void 0;
803
- }
804
- function isNullOrUndefined(x) {
805
- return x === null || x === void 0;
806
- }
807
- function ifDefined(source, callback) {
808
- if (isDefined(source))
809
- callback(source);
810
- }
811
- function mapDefined(source, mapper) {
812
- if (isDefined(source))
813
- return mapper(source);
814
- return null;
815
- }
816
- function ifNullOrUndefined(source, callback) {
817
- if (isNullOrUndefined(source))
818
- callback();
819
- }
820
-
821
- // src/utils/numbers/round.ts
714
+ // packages/core/src/utils/numbers/round.ts
822
715
  var roundModes = {
823
716
  "toNearest": Math.round,
824
717
  "toLower": Math.floor,
@@ -837,7 +730,7 @@ var roundToUpper = (n, precision = 0) => round(n, precision, "toUpper");
837
730
  var roundTowardsZero = (n, precision = 0) => round(n, precision, "towardsZero");
838
731
  var roundAwayFromZero = (n, precision = 0) => round(n, precision, "awayFromZero");
839
732
 
840
- // src/utils/numbers.ts
733
+ // packages/core/src/utils/numbers.ts
841
734
  function ensurePositiveNumber(v, name = "value") {
842
735
  if (v !== void 0 && v !== null && v > 0)
843
736
  return v;
@@ -896,15 +789,18 @@ function clamp(n, min2, max2) {
896
789
  function tryToParseNumber(numberStr) {
897
790
  return withTryCatch(() => {
898
791
  const type = typeof ensureDefined(numberStr);
899
- if (type !== "string") throw new Error("Invalid number given: " + numberStr);
900
- if (numberStr.trim().length === 0) throw new Error("Invalid number given: " + numberStr);
792
+ if (type !== "string")
793
+ throw new Error("Invalid number given: " + numberStr);
794
+ if (numberStr.trim().length === 0)
795
+ throw new Error("Invalid number given: " + numberStr);
901
796
  const num = Number(numberStr);
902
- if (isNaN(num)) throw new Error("Invalid number given: " + numberStr);
797
+ if (isNaN(num))
798
+ throw new Error("Invalid number given: " + numberStr);
903
799
  return num;
904
800
  });
905
801
  }
906
802
 
907
- // src/utils/promises.ts
803
+ // packages/core/src/utils/promises.ts
908
804
  function asPromise(promisable) {
909
805
  return Promise.resolve(promisable);
910
806
  }
@@ -922,15 +818,17 @@ function delayPromise(duration) {
922
818
  return (result) => duration.promise().then(() => result);
923
819
  }
924
820
 
925
- // src/utils/random.ts
926
- function randomInterval(min2, max2) {
821
+ // packages/core/src/utils/random.ts
822
+ var randomInterval = (min2, max2) => randomNumberInInterval(min2, max2);
823
+ var randomPercentage = (min2, max2) => randomNumberInInterval(min2, max2) / 100;
824
+ function randomNumberInInterval(min2, max2) {
927
825
  return Math.floor(Math.random() * (max2 - min2 + 1) + min2);
928
826
  }
929
- function randomPercentage(min2, max2) {
930
- return randomInterval(min2, max2) / 100;
931
- }
827
+ var randomId = (length) => {
828
+ return Math.random().toString(36).substring(2, length + 2);
829
+ };
932
830
 
933
- // src/utils/records/entries.ts
831
+ // packages/core/src/utils/records/entries.ts
934
832
  function dictToEntries(obj) {
935
833
  return Object.entries(obj);
936
834
  }
@@ -941,7 +839,7 @@ function mapEntries(dict, mapper) {
941
839
  return entriesToDict(dictToEntries(dict).map((entry) => mapper(entry)));
942
840
  }
943
841
 
944
- // src/utils/records.ts
842
+ // packages/core/src/utils/records.ts
945
843
  function dictToList(obj) {
946
844
  return Object.keys(obj).map((key) => obj[key]);
947
845
  }
@@ -952,7 +850,7 @@ function pick(o, keys) {
952
850
  }, {});
953
851
  }
954
852
 
955
- // src/utils/strings/StringParts.ts
853
+ // packages/core/src/utils/strings/StringParts.ts
956
854
  var StringParts = class _StringParts {
957
855
  _parts;
958
856
  constructor(...parts) {
@@ -965,7 +863,8 @@ var StringParts = class _StringParts {
965
863
  return new _StringParts(...this.parts.map((part) => part.toLowerCase()));
966
864
  }
967
865
  capitalizeFirst() {
968
- if (!this.length) return this;
866
+ if (!this.length)
867
+ return this;
969
868
  return new _StringParts(capitalizeWord(this.first), ...this.tail.map((part) => part.toLowerCase()));
970
869
  }
971
870
  capitalizeEach() {
@@ -994,7 +893,8 @@ var StringParts = class _StringParts {
994
893
  return this.toLowerCase().join("_");
995
894
  }
996
895
  toCamelCase() {
997
- if (!this.length) return "";
896
+ if (!this.length)
897
+ return "";
998
898
  return [this.first.toLowerCase(), ...this.tail.map(capitalizeWord)].join("");
999
899
  }
1000
900
  toKebabCase() {
@@ -1037,7 +937,7 @@ var StringParts = class _StringParts {
1037
937
  };
1038
938
  };
1039
939
 
1040
- // src/utils/strings.ts
940
+ // packages/core/src/utils/strings.ts
1041
941
  function hashCode(str) {
1042
942
  let hash = 0;
1043
943
  for (let i = 0; i < str.length; ++i)
@@ -1060,7 +960,8 @@ function stringToNumber(s) {
1060
960
  }
1061
961
  function pad(str, n, char, where = "left") {
1062
962
  const length = ensureDefined(str).length;
1063
- if (length >= ensureDefined(n)) return str;
963
+ if (length >= ensureDefined(n))
964
+ return str;
1064
965
  if (ensureDefined(char).length !== 1)
1065
966
  throw new Error("Illegal pad character");
1066
967
  const padding = repeat(char, n - length);
@@ -1100,7 +1001,7 @@ function wrapWithString(str, delimiter) {
1100
1001
  }
1101
1002
  var wrap = wrapWithString;
1102
1003
 
1103
- // src/lazy/Lazy.ts
1004
+ // packages/core/src/lazy/Lazy.ts
1104
1005
  var Lazy = class _Lazy {
1105
1006
  _value = void 0;
1106
1007
  _initialized = false;
@@ -1158,7 +1059,7 @@ var Lazy = class _Lazy {
1158
1059
  }
1159
1060
  };
1160
1061
 
1161
- // src/lazy/LazyAsync.ts
1062
+ // packages/core/src/lazy/LazyAsync.ts
1162
1063
  var LazyAsync = class _LazyAsync {
1163
1064
  _promise = void 0;
1164
1065
  _pending = false;
@@ -1240,10 +1141,10 @@ var LazyAsync = class _LazyAsync {
1240
1141
  }
1241
1142
  };
1242
1143
 
1243
- // src/time/TimeInstant.ts
1244
- var import_small_date = __toESM(require_lib());
1144
+ // packages/core/src/time/TimeInstant.ts
1145
+ var import_small_date = require("small-date");
1245
1146
 
1246
- // src/time/TimeUnit.ts
1147
+ // packages/core/src/time/TimeUnit.ts
1247
1148
  var TimeUnit = class _TimeUnit {
1248
1149
  constructor(multiplier) {
1249
1150
  this.multiplier = multiplier;
@@ -1277,7 +1178,7 @@ var TimeUnit = class _TimeUnit {
1277
1178
  static WEEKS = new _TimeUnit(7 * _TimeUnit.DAYS.multiplier);
1278
1179
  };
1279
1180
 
1280
- // src/time/TimeBase.ts
1181
+ // packages/core/src/time/TimeBase.ts
1281
1182
  var TimeBase = class {
1282
1183
  _ms;
1283
1184
  constructor(value, unit) {
@@ -1361,7 +1262,7 @@ var TimeBase = class {
1361
1262
  }
1362
1263
  };
1363
1264
 
1364
- // src/time/TimeDuration.ts
1265
+ // packages/core/src/time/TimeDuration.ts
1365
1266
  var TimeDuration = class _TimeDuration extends TimeBase {
1366
1267
  constructor(value, unit) {
1367
1268
  super(value, unit);
@@ -1394,11 +1295,11 @@ var TimeDuration = class _TimeDuration extends TimeBase {
1394
1295
  return _TimeDuration.ms(this.ms / times);
1395
1296
  }
1396
1297
  /**
1397
- * Returns the current duration in a human readable format, prioritizing the most significant unit of time and excluding the rest.
1398
- * @todo[2023-06] Should allow more customization options
1399
- * @todo[2023-06] By default should show the secondary unit only when actually needed (eg, 1h 20m & 3h, instead of 1h 20m & 3h 28m)
1400
- * @todo[2023-06] Should not allow negative durations, as this is a duration and not an instant.
1401
- * @returns the duration, with only the most significant units displayed as a human readable string, eg: 1d 20h, 10m 30s.
1298
+ * Returns the current duration in a human readable format, prioritizing the most significant unit of time and excluding the rest.
1299
+ * @todo[2023-06] Should allow more customization options
1300
+ * @todo[2023-06] By default should show the secondary unit only when actually needed (eg, 1h 20m & 3h, instead of 1h 20m & 3h 28m)
1301
+ * @todo[2023-06] Should not allow negative durations, as this is a duration and not an instant.
1302
+ * @returns the duration, with only the most significant units displayed as a human readable string, eg: 1d 20h, 10m 30s.
1402
1303
  */
1403
1304
  get formatted() {
1404
1305
  const format2 = (x, u1, y, u2) => `${x}${u1} ${pad(y.toString(), 2, "0")}${u2}`;
@@ -1428,7 +1329,7 @@ var TimeDuration = class _TimeDuration extends TimeBase {
1428
1329
  timeout(cb) {
1429
1330
  return setTimeout(cb, this.ms);
1430
1331
  }
1431
- promise() {
1332
+ cancelablePromise() {
1432
1333
  const deferred = new Deferred_default();
1433
1334
  if (this.ms > 0) {
1434
1335
  this.timeout(() => deferred.resolve());
@@ -1437,8 +1338,18 @@ var TimeDuration = class _TimeDuration extends TimeBase {
1437
1338
  }
1438
1339
  return deferred.asCancelablePromise();
1439
1340
  }
1341
+ promise() {
1342
+ if (this.isEmpty())
1343
+ return Promise.resolve();
1344
+ const deferred = new Deferred_default();
1345
+ this.timeout(() => deferred.resolve());
1346
+ return deferred.asPromise();
1347
+ }
1440
1348
  delay(cb) {
1441
- const deferred = this.promise();
1349
+ void this.promise().then(() => cb());
1350
+ }
1351
+ cancelableDelay(cb) {
1352
+ const deferred = this.cancelablePromise();
1442
1353
  void deferred.then(() => {
1443
1354
  cb();
1444
1355
  }, (err) => {
@@ -1593,7 +1504,7 @@ function isAllowedTimeDuration(t) {
1593
1504
  }
1594
1505
  var TimeDuration_default = TimeDuration;
1595
1506
 
1596
- // src/time/TimeInstantBuilder.ts
1507
+ // packages/core/src/time/TimeInstantBuilder.ts
1597
1508
  var isRelativeNumber = (x) => x !== void 0 && x.length > 0 && (x[0] === "+" || x[0] === "-");
1598
1509
  var defaultTimeInstantCreationParameters = {
1599
1510
  year: { relative: 0, relativeTo: "now" },
@@ -1662,7 +1573,8 @@ var getFromDate = {
1662
1573
  };
1663
1574
  var toReferenceDate = (x) => {
1664
1575
  ensureDefined(x);
1665
- if (isTimeInstant(x)) return x.toDate();
1576
+ if (isTimeInstant(x))
1577
+ return x.toDate();
1666
1578
  return x;
1667
1579
  };
1668
1580
  function createTimeInstantFromParameters(aParameters, aReferenceDate = TimeInstant.now()) {
@@ -1726,7 +1638,7 @@ function timeInstantBuilder() {
1726
1638
  return ret;
1727
1639
  }
1728
1640
 
1729
- // src/time/TimeInstant.ts
1641
+ // packages/core/src/time/TimeInstant.ts
1730
1642
  var TimeInstant = class _TimeInstant extends TimeBase {
1731
1643
  constructor(number, unit) {
1732
1644
  super(number, unit);
@@ -1746,6 +1658,14 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1746
1658
  distanceFromNow() {
1747
1659
  return TimeDuration_default.fromMs(Math.abs(this.ms - Date.now()));
1748
1660
  }
1661
+ timeLeftFrom(instant) {
1662
+ const distance = this.ms - instant.ms;
1663
+ return TimeDuration_default.fromMs(Math.max(distance, 0));
1664
+ }
1665
+ timeLeftFromNow() {
1666
+ const distance = this.ms - Date.now();
1667
+ return TimeDuration_default.fromMs(Math.max(distance, 0));
1668
+ }
1749
1669
  distanceFromStartOfDay() {
1750
1670
  return this.distanceFrom(this.atStartOfDay());
1751
1671
  }
@@ -1759,14 +1679,16 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1759
1679
  return this.atTime({ hours: 23, minutes: 59, seconds: 59, milliseconds: 999 });
1760
1680
  }
1761
1681
  promise() {
1762
- const ms = this.ms - Date.now();
1763
- const duration = TimeDuration_default.fromMs(Math.max(ms, 0));
1764
- return duration.promise();
1682
+ return this.timeLeftFromNow().promise();
1683
+ }
1684
+ cancelablePromise() {
1685
+ return this.timeLeftFromNow().cancelablePromise();
1765
1686
  }
1766
1687
  delay(cb) {
1767
- const ms = this.ms - Date.now();
1768
- const duration = TimeDuration_default.fromMs(Math.max(ms, 0));
1769
- return duration.delay(cb);
1688
+ return this.timeLeftFromNow().delay(cb);
1689
+ }
1690
+ cancelableDelay(cb) {
1691
+ return this.timeLeftFromNow().cancelableDelay(cb);
1770
1692
  }
1771
1693
  ensureInTheFuture() {
1772
1694
  if (!this.isInTheFuture)
@@ -1881,20 +1803,23 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1881
1803
  }
1882
1804
  }
1883
1805
  /**
1884
- * @deprecated[04/07/2023]: Use distanceFromNow instead
1885
- */
1806
+ * @deprecated: Use {@link distanceFromNow} instead
1807
+ */
1808
+ // TODO[2023-07-04, Deprecated]: Remove this method in a future version
1886
1809
  fromNow() {
1887
1810
  return TimeDuration_default.ms(this.ms - Date.now());
1888
1811
  }
1889
1812
  /**
1890
- * @deprecated[04/07/2023]: Use distanceFrom instead
1891
- */
1813
+ * @deprecated: Use {@link distanceFrom} instead
1814
+ */
1815
+ // TODO[2023-07-04, Deprecated]: Remove this method in a future version
1892
1816
  from(instant) {
1893
1817
  return TimeDuration_default.ms(this.ms - instant.ms);
1894
1818
  }
1895
1819
  /**
1896
- * @deprecated[04/07/2023]: Use distanceFromUnixTimestamp instead
1897
- */
1820
+ * @deprecated: Use {@link distanceFromUnixTimestamp} instead
1821
+ */
1822
+ // TODO[2023-07-04, Deprecated]: Remove this method in a future version
1898
1823
  fromTimestamp(timestamp2) {
1899
1824
  return TimeDuration_default.ms(this.ms - timestamp2);
1900
1825
  }
@@ -1935,8 +1860,8 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1935
1860
  return timeInstantBuilder();
1936
1861
  }
1937
1862
  /**
1938
- * @deprecated[19/07/2023] Use {@link fromParameters} instead.
1939
- */
1863
+ * @deprecated[19/07/2023] Use {@link fromParameters} instead.
1864
+ */
1940
1865
  static fromUnits({ date, month, year, hours, minutes, seconds }) {
1941
1866
  const dt = Date.UTC(year, month - 1, date, hours ?? 0, minutes ?? 0, seconds ?? 0);
1942
1867
  if (isNaN(dt))
@@ -1994,9 +1919,9 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1994
1919
  return this.toDate().getFullYear();
1995
1920
  }
1996
1921
  /**
1997
- * Returns the week number represented by this instant, according to the ISO 8601 standard.
1922
+ * Returns the week number represented by this instant, according to the ISO 8601 standard.
1998
1923
  * Please note that the instant and the week number could be of two different years, eg the friday 1st january is actually part of week 52 of the previous year.
1999
- */
1924
+ */
2000
1925
  get weekNumber() {
2001
1926
  const date = this.toDate();
2002
1927
  const oneDay = 1e3 * 60 * 60 * 24;
@@ -2007,8 +1932,8 @@ var TimeInstant = class _TimeInstant extends TimeBase {
2007
1932
  return { weekNumber, year: thursdayOfThisWeek.getFullYear() };
2008
1933
  }
2009
1934
  /**
2010
- * This method is used to provide a better DX when inspecting a TimeInstant object in DevTools.
2011
- */
1935
+ * This method is used to provide a better DX when inspecting a TimeInstant object in DevTools.
1936
+ */
2012
1937
  get _time() {
2013
1938
  return this.asHumanTimestamp();
2014
1939
  }
@@ -2025,7 +1950,7 @@ function isTimeInstant(x) {
2025
1950
  }
2026
1951
  var TimeInstant_default = TimeInstant;
2027
1952
 
2028
- // src/Logger.ts
1953
+ // packages/core/src/Logger.ts
2029
1954
  var LEVELS = ["log", "debug", "info", "warn", "error"];
2030
1955
  var timestamp = () => TimeInstant_default.now().asTimeString();
2031
1956
  var Logger = class {
@@ -2062,7 +1987,7 @@ var Logger = class {
2062
1987
  }
2063
1988
  };
2064
1989
 
2065
- // src/Optional.ts
1990
+ // packages/core/src/Optional.ts
2066
1991
  var Optional = class _Optional {
2067
1992
  _present;
2068
1993
  _value;
@@ -2176,7 +2101,7 @@ var ErrorCannotInstantiatePresentOptionalWithEmptyValue = class extends Error {
2176
2101
  }
2177
2102
  };
2178
2103
 
2179
- // src/sorting/ComparisonChain.ts
2104
+ // packages/core/src/sorting/ComparisonChain.ts
2180
2105
  var defaultCompareValueOptions = {
2181
2106
  nullsFirst: false,
2182
2107
  direction: "ASC"
@@ -2218,8 +2143,10 @@ function compareBooleans(options) {
2218
2143
  const fn = (a, b) => {
2219
2144
  if (a === b)
2220
2145
  return 0;
2221
- if (isNullOrUndefined(a)) return opts.nullsFirst ? -1 : 1;
2222
- if (isNullOrUndefined(b)) return opts.nullsFirst ? 1 : -1;
2146
+ if (isNullOrUndefined(a))
2147
+ return opts.nullsFirst ? -1 : 1;
2148
+ if (isNullOrUndefined(b))
2149
+ return opts.nullsFirst ? 1 : -1;
2223
2150
  return a === true && opts.truesFirst || a === false && !opts.truesFirst ? -1 : 1;
2224
2151
  };
2225
2152
  return (a, b) => applyDirection(fn(a, b), opts.direction);
@@ -2334,7 +2261,7 @@ function getComparisonFunction(arg) {
2334
2261
  return arg instanceof ComparisonChain ? arg.compare : arg;
2335
2262
  }
2336
2263
 
2337
- // src/sorting/Sorter.ts
2264
+ // packages/core/src/sorting/Sorter.ts
2338
2265
  var defaultCompareValuesOptions = {
2339
2266
  nullsFirst: false
2340
2267
  };
@@ -2400,7 +2327,8 @@ var prioritizeSet = (fns, transform, set, reversed = false) => {
2400
2327
  var prioritizeArray = (fns, transform, arr, reversed = false) => {
2401
2328
  return compareNumbers(fns, (t) => {
2402
2329
  const r = transform(t);
2403
- if (!isDefined(r)) return Number.MAX_VALUE;
2330
+ if (!isDefined(r))
2331
+ return Number.MAX_VALUE;
2404
2332
  const indexOf = arr.indexOf(r);
2405
2333
  return indexOf === -1 ? Number.MAX_VALUE : indexOf;
2406
2334
  }, { direction: reversed ? "DESC" : "ASC", nullsFirst: false });
@@ -2566,7 +2494,7 @@ var Sorter = {
2566
2494
  };
2567
2495
  var Sorting = Sorter;
2568
2496
 
2569
- // src/time/RandomTimeDuration.ts
2497
+ // packages/core/src/time/RandomTimeDuration.ts
2570
2498
  function randomize(unit) {
2571
2499
  return (a, b) => {
2572
2500
  return TimeDuration_default.fromMs(randomInterval(unit.toMs(a), unit.toMs(b)));
@@ -2582,7 +2510,7 @@ var RandomTimeDuration = class {
2582
2510
  static days = randomize(TimeUnit.DAYS);
2583
2511
  };
2584
2512
 
2585
- // src/time/TimeFrequency.ts
2513
+ // packages/core/src/time/TimeFrequency.ts
2586
2514
  var TimeFrequency = class _TimeFrequency {
2587
2515
  constructor(times, period) {
2588
2516
  this.times = times;
@@ -2603,7 +2531,7 @@ var TimeFrequency = class _TimeFrequency {
2603
2531
  }
2604
2532
  };
2605
2533
 
2606
- // src/time/TimeRange.ts
2534
+ // packages/core/src/time/TimeRange.ts
2607
2535
  var TimeRange = class _TimeRange {
2608
2536
  constructor(start, duration) {
2609
2537
  this.start = start;
@@ -2624,7 +2552,7 @@ var TimeRange = class _TimeRange {
2624
2552
  }
2625
2553
  };
2626
2554
 
2627
- // src/upgrade/errors.ts
2555
+ // packages/core/src/upgrade/errors.ts
2628
2556
  var UnavailableUpgradeError = class extends Error {
2629
2557
  constructor(data, from, to) {
2630
2558
  super(`No transition found to upgrade data from version ${from} to version ${to}.`);
@@ -2642,7 +2570,7 @@ var EmptyUpgradeError = class extends Error {
2642
2570
  }
2643
2571
  };
2644
2572
 
2645
- // src/upgrade/getTransitionsPath.ts
2573
+ // packages/core/src/upgrade/getTransitionsPath.ts
2646
2574
  var DEBUG_ENABLED = false;
2647
2575
  function getTransitionsPath(matrix, from, to) {
2648
2576
  return internalGetTransitionsPath(matrix, from, to, 0, DEBUG_ENABLED);
@@ -2691,7 +2619,7 @@ function printTransitions(transitions) {
2691
2619
  }, "" + transitions[0].from);
2692
2620
  }
2693
2621
 
2694
- // src/upgrade/DataUpgrader.ts
2622
+ // packages/core/src/upgrade/DataUpgrader.ts
2695
2623
  var VERSION_FIELD = "$version";
2696
2624
  var DataUpgrader = class _DataUpgrader {
2697
2625
  constructor(latestVersion) {
@@ -2775,6 +2703,9 @@ function isUpgradable(obj) {
2775
2703
  TimeInstant,
2776
2704
  TimeRange,
2777
2705
  TimeUnit,
2706
+ alwaysFalse,
2707
+ alwaysTrue,
2708
+ and,
2778
2709
  asError,
2779
2710
  asPromise,
2780
2711
  average,
@@ -2849,6 +2780,7 @@ function isUpgradable(obj) {
2849
2780
  isZero,
2850
2781
  jsonCloneDeep,
2851
2782
  last,
2783
+ makeArrayEmpty,
2852
2784
  mapDefined,
2853
2785
  mapEntries,
2854
2786
  mapFirstTruthy,
@@ -2859,8 +2791,10 @@ function isUpgradable(obj) {
2859
2791
  minBy,
2860
2792
  multiplyBy,
2861
2793
  noop,
2794
+ not,
2862
2795
  omit,
2863
2796
  omitFromJsonObject,
2797
+ or,
2864
2798
  pad,
2865
2799
  padLeft,
2866
2800
  padRight,
@@ -2868,7 +2802,9 @@ function isUpgradable(obj) {
2868
2802
  pick,
2869
2803
  pluralize,
2870
2804
  promiseSequence,
2805
+ randomId,
2871
2806
  randomInterval,
2807
+ randomNumberInInterval,
2872
2808
  randomPercentage,
2873
2809
  range,
2874
2810
  repeat,
@@ -2895,5 +2831,6 @@ function isUpgradable(obj) {
2895
2831
  withTryCatch,
2896
2832
  withTryCatchAsync,
2897
2833
  wrap,
2898
- wrapWithString
2834
+ wrapWithString,
2835
+ xor
2899
2836
  });