@mll-lab/js-utils 2.24.0 → 2.26.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,6 +4,7 @@ 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
9
  export * from './pick';
9
10
  export * from './pluralize';
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
  *
@@ -15364,6 +15375,12 @@ function isArrayOfStrings(value) {
15364
15375
  return (value instanceof Array &&
15365
15376
  value.every((record) => typeof record === 'string'));
15366
15377
  }
15378
+ function isEmptyObject(value) {
15379
+ return Boolean(value &&
15380
+ typeof value === 'object' &&
15381
+ !(value instanceof Array) &&
15382
+ Object.keys(value).length === 0);
15383
+ }
15367
15384
 
15368
15385
  const isAlphanumeric = function isAlphanumeric(value) {
15369
15386
  return isString(value) && /^[A-Za-z0-9]+$/.test(value);
@@ -15485,6 +15502,7 @@ exports.ISO_DATE_FORMAT = ISO_DATE_FORMAT;
15485
15502
  exports.ISO_DATE_TIME_FORMAT = ISO_DATE_TIME_FORMAT;
15486
15503
  exports.SECONDLESS_DATE_TIME_FORMAT = SECONDLESS_DATE_TIME_FORMAT;
15487
15504
  exports.callSequentially = callSequentially;
15505
+ exports.ceil = ceil;
15488
15506
  exports.containSameValues = containSameValues;
15489
15507
  exports.downloadBlob = downloadBlob;
15490
15508
  exports.errorMessage = errorMessage;
@@ -15507,6 +15525,7 @@ exports.isArrayOfStrings = isArrayOfStrings;
15507
15525
  exports.isBSNR = isBSNR;
15508
15526
  exports.isEmail = isEmail;
15509
15527
  exports.isEmptyArray = isEmptyArray;
15528
+ exports.isEmptyObject = isEmptyObject;
15510
15529
  exports.isFuture = isFuture;
15511
15530
  exports.isLabID = isLabID;
15512
15531
  exports.isLabId = isLabId;
@@ -15520,6 +15539,7 @@ exports.isString = isString;
15520
15539
  exports.isToday = isToday;
15521
15540
  exports.isURL = isURL;
15522
15541
  exports.isWord = isWord;
15542
+ exports.isZeroish = isZeroish;
15523
15543
  exports.joinNonEmpty = joinNonEmpty;
15524
15544
  exports.last = last;
15525
15545
  exports.makeStringCompareFn = makeStringCompareFn;