@maz-ui/utils 4.7.0 → 4.7.3
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/helpers/formatCurrency.js +1 -1
- package/dist/helpers/formatDate.js +1 -1
- package/dist/helpers/formatNumber.js +1 -1
- package/dist/helpers/getBrowserLocale.js +1 -1
- package/dist/helpers/idleTimeout.js +1 -1
- package/dist/helpers/scriptLoader.js +1 -1
- package/dist/index.js +5 -5
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ function formatCurrency(number, locale, options) {
|
|
|
26
26
|
try {
|
|
27
27
|
return getFormattedCurrency(number, locale, options_);
|
|
28
28
|
} catch (error) {
|
|
29
|
-
throw new Error(`[maz-ui](FilterCurrency) ${error}
|
|
29
|
+
throw new Error(`[maz-ui](FilterCurrency) ${error}`, { cause: error });
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
@@ -13,7 +13,7 @@ function formatDate(date, locale, options) {
|
|
|
13
13
|
const usedDate = date instanceof Date ? date : new Date(date);
|
|
14
14
|
return new Intl.DateTimeFormat(locale, opts).format(usedDate);
|
|
15
15
|
} catch (error) {
|
|
16
|
-
throw new Error(`[maz-ui](FilterDate) ${error}
|
|
16
|
+
throw new Error(`[maz-ui](FilterDate) ${error}`, { cause: error });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
@@ -15,7 +15,7 @@ function formatNumber(number, locale, options) {
|
|
|
15
15
|
try {
|
|
16
16
|
return new Intl.NumberFormat(locale, filterOptions).format(Number(number));
|
|
17
17
|
} catch (error) {
|
|
18
|
-
throw new Error(`[maz-ui](FilterNumber) ${error}
|
|
18
|
+
throw new Error(`[maz-ui](FilterNumber) ${error}`, { cause: error });
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
@@ -3,7 +3,7 @@ function getBrowserLocale() {
|
|
|
3
3
|
try {
|
|
4
4
|
return isServer() ? void 0 : globalThis.navigator.language;
|
|
5
5
|
} catch (error) {
|
|
6
|
-
throw new Error(`[MazInputPhoneNumber] (browserLocale) ${error}
|
|
6
|
+
throw new Error(`[MazInputPhoneNumber] (browserLocale) ${error}`, { cause: error });
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -84,7 +84,7 @@ class IdleTimeout {
|
|
|
84
84
|
}
|
|
85
85
|
this.resetTimeout(), this.callback({ isIdle: this.isIdle, eventType: event.type, instance: this });
|
|
86
86
|
} catch (error) {
|
|
87
|
-
throw new Error(`[IdleTimeout](handleEvent) ${error}
|
|
87
|
+
throw new Error(`[IdleTimeout](handleEvent) ${error}`, { cause: error });
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
handleTimeout() {
|
|
@@ -33,7 +33,7 @@ class ScriptLoader {
|
|
|
33
33
|
const script = document.createElement("script");
|
|
34
34
|
script.src = this.src, script.async = this.async, script.defer = this.defer, script.dataset.identifier = this.identifier, script.addEventListener("error", (error) => reject(new Error(`[ScriptLoader](injectScript) ${error.message}`))), script.addEventListener("load", (success) => (this.script = success, windowInstance[this.identifier] = success, resolve(success))), document.head.append(script);
|
|
35
35
|
} catch (error) {
|
|
36
|
-
throw new Error(`[ScriptLoader](init) ${error}
|
|
36
|
+
throw new Error(`[ScriptLoader](init) ${error}`, { cause: error });
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { IdleTimeout } from "./helpers/idleTimeout.js";
|
|
2
|
+
import { ScriptLoader } from "./helpers/scriptLoader.js";
|
|
3
|
+
import { Swipe } from "./helpers/swipeHandler.js";
|
|
4
|
+
import { TextareaAutogrow } from "./helpers/TextareaAutogrow.js";
|
|
5
|
+
import { UserVisibility } from "./helpers/userVisibility.js";
|
|
1
6
|
import { camelCase } from "./helpers/camelCase.js";
|
|
2
7
|
import { capitalize } from "./helpers/capitalize.js";
|
|
3
8
|
import { checkAvailability } from "./helpers/checkAvailability.js";
|
|
@@ -11,7 +16,6 @@ import { formatJson } from "./helpers/formatJson.js";
|
|
|
11
16
|
import { formatNumber } from "./helpers/formatNumber.js";
|
|
12
17
|
import { getCountryFlagUrl } from "./helpers/getCountryFlagUrl.js";
|
|
13
18
|
import { getErrorMessage } from "./helpers/getErrorMessage.js";
|
|
14
|
-
import { IdleTimeout } from "./helpers/idleTimeout.js";
|
|
15
19
|
import { isClient } from "./helpers/isClient.js";
|
|
16
20
|
import { isEqual } from "./helpers/isEqual.js";
|
|
17
21
|
import { isServer } from "./helpers/isServer.js";
|
|
@@ -19,16 +23,12 @@ import { isStandaloneMode } from "./helpers/isStandaloneMode.js";
|
|
|
19
23
|
import { kebabCase } from "./helpers/kebabCase.js";
|
|
20
24
|
import { normalizeString } from "./helpers/normalizeString.js";
|
|
21
25
|
import { pascalCase } from "./helpers/pascalCase.js";
|
|
22
|
-
import { ScriptLoader } from "./helpers/scriptLoader.js";
|
|
23
26
|
import { sleep } from "./helpers/sleep.js";
|
|
24
27
|
import { snakeCase } from "./helpers/snakeCase.js";
|
|
25
|
-
import { Swipe } from "./helpers/swipeHandler.js";
|
|
26
|
-
import { TextareaAutogrow } from "./helpers/TextareaAutogrow.js";
|
|
27
28
|
import { throttle } from "./helpers/throttle.js";
|
|
28
29
|
import { throttleId } from "./helpers/throttleId.js";
|
|
29
30
|
import { truthyFilter } from "./helpers/truthyFilter.js";
|
|
30
31
|
import { upperFirst } from "./helpers/upperFirst.js";
|
|
31
|
-
import { UserVisibility } from "./helpers/userVisibility.js";
|
|
32
32
|
export {
|
|
33
33
|
IdleTimeout,
|
|
34
34
|
ScriptLoader,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.7.
|
|
4
|
+
"version": "4.7.3",
|
|
5
5
|
"description": "Utils of maz-ui for JavaScript/TypeScript users",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"node": ">=18.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"libphonenumber-js": "^1.12.
|
|
56
|
+
"libphonenumber-js": "^1.12.38"
|
|
57
57
|
},
|
|
58
58
|
"lint-staged": {
|
|
59
59
|
"*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [
|