@mll-lab/js-utils 2.13.0 → 2.14.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
@@ -2,6 +2,7 @@ export * from './array';
2
2
  export * from './date';
3
3
  export * from './device';
4
4
  export * from './error';
5
+ export * from './file';
5
6
  export * from './germanNumber';
6
7
  export * from './number';
7
8
  export * from './pluralize';
package/dist/index.js CHANGED
@@ -15187,6 +15187,19 @@ function hasMessage(error) {
15187
15187
  return typeof error === 'object' && error !== null && 'message' in error;
15188
15188
  }
15189
15189
 
15190
+ /**
15191
+ * Triggers a file download in the browser.
15192
+ */
15193
+ function downloadBlob(blob, filename) {
15194
+ const link = document.createElement('a');
15195
+ link.href = URL.createObjectURL(blob);
15196
+ link.download = filename;
15197
+ link.style.display = 'none';
15198
+ document.body.appendChild(link);
15199
+ link.click();
15200
+ document.body.removeChild(link);
15201
+ }
15202
+
15190
15203
  function __rest(s, e) {
15191
15204
  var t = {};
15192
15205
 
@@ -15353,6 +15366,7 @@ exports.ISO_DATE_FORMAT = ISO_DATE_FORMAT;
15353
15366
  exports.ISO_DATE_TIME_FORMAT = ISO_DATE_TIME_FORMAT;
15354
15367
  exports.SECONDLESS_DATE_TIME_FORMAT = SECONDLESS_DATE_TIME_FORMAT;
15355
15368
  exports.containSameValues = containSameValues;
15369
+ exports.downloadBlob = downloadBlob;
15356
15370
  exports.errorMessage = errorMessage;
15357
15371
  exports.firstDecimalDigit = firstDecimalDigit;
15358
15372
  exports.firstLine = firstLine;