@mll-lab/js-utils 2.25.0 → 2.27.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.
package/dist/index.d.ts CHANGED
@@ -4,8 +4,9 @@ export * from './device';
4
4
  export * from './error';
5
5
  export * from './file';
6
6
  export * from './germanNumber';
7
+ export * from './math';
7
8
  export * from './number';
8
- export * from './pick';
9
+ export * from './object';
9
10
  export * from './pluralize';
10
11
  export * from './predicates';
11
12
  export * from './promise';
package/dist/index.js CHANGED
@@ -15316,6 +15316,17 @@ function isPartialGermanNumber(value) {
15316
15316
  return /^-?\d*[.\d]*,?\d*$/.test(value);
15317
15317
  }
15318
15318
 
15319
+ /**
15320
+ * Round up to the nearest step.
15321
+ */
15322
+ function ceil(value, step) {
15323
+ const inverse = 1.0 / step;
15324
+ return Math.ceil(value * inverse) / inverse;
15325
+ }
15326
+ function isZeroish(value, precision = 0.001) {
15327
+ return Math.abs(value) < precision;
15328
+ }
15329
+
15319
15330
  /**
15320
15331
  * Round a number to a given number of decimal places.
15321
15332
  *
@@ -15346,6 +15357,13 @@ function firstDecimalDigit(number) {
15346
15357
  function pick(object, ...props) {
15347
15358
  return lodash.pick(object, props);
15348
15359
  }
15360
+ /**
15361
+ * A singleton empty object.
15362
+ *
15363
+ * Can be used as a default or fallback while maintaining referential equality.
15364
+ */
15365
+ const EMPTY_OBJECT = {};
15366
+ Object.freeze(EMPTY_OBJECT);
15349
15367
 
15350
15368
  function pluralize(amount, singular, plural) {
15351
15369
  if (amount === 1) {
@@ -15480,6 +15498,7 @@ function pxToNumber(pixels) {
15480
15498
  exports.DOTLESS_DATE_FORMAT = DOTLESS_DATE_FORMAT;
15481
15499
  exports.EMAIL_REGEX = EMAIL_REGEX;
15482
15500
  exports.EMPTY_ARRAY = EMPTY_ARRAY;
15501
+ exports.EMPTY_OBJECT = EMPTY_OBJECT;
15483
15502
  exports.ENGLISH_DECIMAL_SEPARATOR = ENGLISH_DECIMAL_SEPARATOR;
15484
15503
  exports.ENGLISH_THOUSAND_SEPARATOR = ENGLISH_THOUSAND_SEPARATOR;
15485
15504
  exports.GERMAN_DATE_FORMAT = GERMAN_DATE_FORMAT;
@@ -15491,6 +15510,7 @@ exports.ISO_DATE_FORMAT = ISO_DATE_FORMAT;
15491
15510
  exports.ISO_DATE_TIME_FORMAT = ISO_DATE_TIME_FORMAT;
15492
15511
  exports.SECONDLESS_DATE_TIME_FORMAT = SECONDLESS_DATE_TIME_FORMAT;
15493
15512
  exports.callSequentially = callSequentially;
15513
+ exports.ceil = ceil;
15494
15514
  exports.containSameValues = containSameValues;
15495
15515
  exports.downloadBlob = downloadBlob;
15496
15516
  exports.errorMessage = errorMessage;
@@ -15527,6 +15547,7 @@ exports.isString = isString;
15527
15547
  exports.isToday = isToday;
15528
15548
  exports.isURL = isURL;
15529
15549
  exports.isWord = isWord;
15550
+ exports.isZeroish = isZeroish;
15530
15551
  exports.joinNonEmpty = joinNonEmpty;
15531
15552
  exports.last = last;
15532
15553
  exports.makeStringCompareFn = makeStringCompareFn;