@wikicasa-dev/utilities 1.1.11 → 1.1.13
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/CurrencyUtils.cjs +1 -1
- package/dist/CurrencyUtils.js +20 -5
- package/dist/DeviceDetectionUtils.cjs +1 -1
- package/dist/DeviceDetectionUtils.js +1 -1
- package/dist/ObjectUtils.cjs +1 -1
- package/dist/ObjectUtils.js +18 -17
- package/dist/RESB_UrlBuilder.cjs +1 -1
- package/dist/RESB_UrlBuilder.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +94 -92
- package/dist/types-BWBYhYYs.cjs +1 -0
- package/dist/types-Cjj_nH6d.js +6259 -0
- package/dist/utils/CurrencyUtils.d.ts +9 -0
- package/dist/utils/ObjectUtils.d.ts +8 -0
- package/package.json +2 -2
- package/dist/types-CBzIj03u.js +0 -3255
- package/dist/types-CNKgxMk_.cjs +0 -1
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export declare const formatCurrency: (numberToFormat: number | undefined, options?: Intl.NumberFormatOptions, locale?: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Formats a number to a shortened currency string with euros,
|
|
4
|
+
* using K for thousands and M for millions.
|
|
5
|
+
* @param numberToFormat - The number to be formatted
|
|
6
|
+
* @param [options] - Optional configuration for number formatting
|
|
7
|
+
* @param [locale='it-IT'] - The locale to use for formatting
|
|
8
|
+
* @returns The formatted shortened currency string
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatCurrencyShort: (numberToFormat?: number, options?: Intl.NumberFormatOptions, locale?: string) => string;
|
|
@@ -40,3 +40,11 @@ export declare const invertKeyToValue: <T extends Record<PropertyKey, unknown>>(
|
|
|
40
40
|
* @returns The value if it is not null or undefined, otherwise returns null.
|
|
41
41
|
*/
|
|
42
42
|
export declare const getOrNull: <T>(v: T) => NonNullable<T> | null;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the value if it is not null or undefined, otherwise returns the default value.
|
|
45
|
+
* @typeParam T - The type of the value.
|
|
46
|
+
* @param value - The value to check.
|
|
47
|
+
* @param defaultValue - The default value to return if value is null or undefined.
|
|
48
|
+
* @returns The value if it is not null or undefined, otherwise returns the default value.
|
|
49
|
+
*/
|
|
50
|
+
export declare const getOrDefault: <T>(value: T, defaultValue: NonNullable<T>) => NonNullable<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/utilities",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "Wikicasa frontend utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/leaflet.markercluster": "^1.5.1",
|
|
36
36
|
"@types/node": "^20.5.0",
|
|
37
37
|
"@types/uuid": "^9.0.2",
|
|
38
|
-
"@wikicasa-dev/types": "^1.
|
|
38
|
+
"@wikicasa-dev/types": "^1.14.6",
|
|
39
39
|
"glob": "^10.3.10",
|
|
40
40
|
"jest-environment-jsdom": "^29.7.0",
|
|
41
41
|
"ts-jest": "^29.2.1",
|