@cfasim-ui/shared 0.7.8 → 0.8.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/package.json +6 -6
- package/src/formatNumber.ts +2 -9
- package/src/useUrlParams.ts +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfasim-ui/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared utilities for cfasim-ui",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"vue": "^3.5.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@vue/test-utils": "
|
|
27
|
-
"happy-dom": "
|
|
28
|
-
"vitest": "
|
|
26
|
+
"@vue/test-utils": "2.4.11",
|
|
27
|
+
"happy-dom": "20.10.6",
|
|
28
|
+
"vitest": "4.1.10"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@types/sprintf-js": "
|
|
32
|
-
"sprintf-js": "
|
|
31
|
+
"@types/sprintf-js": "1.1.4",
|
|
32
|
+
"sprintf-js": "1.1.3"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/formatNumber.ts
CHANGED
|
@@ -14,12 +14,7 @@ import { sprintf } from "sprintf-js";
|
|
|
14
14
|
* `"percent:1"` → `"12.3%"`, `"localized:2"` → `"1,234.50"`.
|
|
15
15
|
*/
|
|
16
16
|
export type NumberFormatPreset =
|
|
17
|
-
| "
|
|
18
|
-
| "localized"
|
|
19
|
-
| "percent"
|
|
20
|
-
| "compact"
|
|
21
|
-
| "scientific"
|
|
22
|
-
| "engineering";
|
|
17
|
+
"plain" | "localized" | "percent" | "compact" | "scientific" | "engineering";
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* A number format specifier:
|
|
@@ -33,9 +28,7 @@ export type NumberFormatPreset =
|
|
|
33
28
|
* time, so typos surface immediately instead of silently rendering wrong.
|
|
34
29
|
*/
|
|
35
30
|
export type NumberFormat =
|
|
36
|
-
|
|
|
37
|
-
| string
|
|
38
|
-
| ((value: number) => string);
|
|
31
|
+
NumberFormatPreset | string | ((value: number) => string);
|
|
39
32
|
|
|
40
33
|
const PRESET_NAMES = new Set<NumberFormatPreset>([
|
|
41
34
|
"plain",
|
package/src/useUrlParams.ts
CHANGED
|
@@ -221,8 +221,7 @@ function setAtSegments(
|
|
|
221
221
|
(cur as Record<string, unknown>)[p] = Array.isArray(defNext) ? [] : {};
|
|
222
222
|
}
|
|
223
223
|
cur = (cur as Record<string, unknown>)[p] as
|
|
224
|
-
|
|
225
|
-
| unknown[];
|
|
224
|
+
Record<string, unknown> | unknown[];
|
|
226
225
|
defCur = defNext;
|
|
227
226
|
}
|
|
228
227
|
(cur as Record<string, unknown>)[segments[segments.length - 1]] = value;
|