@genesislcap/foundation-utils 14.423.0 → 14.424.1-alpha-0195bdc.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.
|
@@ -568,6 +568,29 @@
|
|
|
568
568
|
}
|
|
569
569
|
]
|
|
570
570
|
},
|
|
571
|
+
{
|
|
572
|
+
"kind": "javascript-module",
|
|
573
|
+
"path": "src/directives/index.ts",
|
|
574
|
+
"declarations": [],
|
|
575
|
+
"exports": [
|
|
576
|
+
{
|
|
577
|
+
"kind": "js",
|
|
578
|
+
"name": "*",
|
|
579
|
+
"declaration": {
|
|
580
|
+
"name": "*",
|
|
581
|
+
"package": "./sync"
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"kind": "js",
|
|
586
|
+
"name": "*",
|
|
587
|
+
"declaration": {
|
|
588
|
+
"name": "*",
|
|
589
|
+
"package": "./when-else"
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
571
594
|
{
|
|
572
595
|
"kind": "javascript-module",
|
|
573
596
|
"path": "src/decorators/index.ts",
|
|
@@ -621,29 +644,6 @@
|
|
|
621
644
|
}
|
|
622
645
|
]
|
|
623
646
|
},
|
|
624
|
-
{
|
|
625
|
-
"kind": "javascript-module",
|
|
626
|
-
"path": "src/directives/index.ts",
|
|
627
|
-
"declarations": [],
|
|
628
|
-
"exports": [
|
|
629
|
-
{
|
|
630
|
-
"kind": "js",
|
|
631
|
-
"name": "*",
|
|
632
|
-
"declaration": {
|
|
633
|
-
"name": "*",
|
|
634
|
-
"package": "./sync"
|
|
635
|
-
}
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
"kind": "js",
|
|
639
|
-
"name": "*",
|
|
640
|
-
"declaration": {
|
|
641
|
-
"name": "*",
|
|
642
|
-
"package": "./when-else"
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
]
|
|
646
|
-
},
|
|
647
647
|
{
|
|
648
648
|
"kind": "javascript-module",
|
|
649
649
|
"path": "src/encoding/index.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeNumberParser.d.ts","sourceRoot":"","sources":["../../../src/formatters/localeNumberParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"localeNumberParser.d.ts","sourceRoot":"","sources":["../../../src/formatters/localeNumberParser.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAM;gBACR,MAAM,EAAE,MAAM;IAc1B,KAAK,CAAC,YAAY,EAAE,MAAM;IAa1B,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;CAG5C"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const FORMAT_PARTS = 12345.6;
|
|
2
2
|
const FORMAT_NUMERALS = 9876543210;
|
|
3
|
+
const SHORTCUT_MULTIPLIERS = {
|
|
4
|
+
k: 1000,
|
|
5
|
+
m: 1000000,
|
|
6
|
+
b: 1000000000,
|
|
7
|
+
};
|
|
8
|
+
const SHORTCUT_REGEX = /^(.*?)([kmb])$/i;
|
|
3
9
|
/**
|
|
4
10
|
* @public
|
|
5
11
|
*/
|
|
@@ -17,12 +23,15 @@ export class NumberParser {
|
|
|
17
23
|
this._index = (d) => index.get(d);
|
|
18
24
|
}
|
|
19
25
|
parse(localeNumber) {
|
|
20
|
-
|
|
26
|
+
const shortcutMatch = localeNumber.trim().match(SHORTCUT_REGEX);
|
|
27
|
+
const multiplier = shortcutMatch ? SHORTCUT_MULTIPLIERS[shortcutMatch[2].toLowerCase()] : 1;
|
|
28
|
+
const normalized = shortcutMatch ? shortcutMatch[1] : localeNumber;
|
|
29
|
+
return (localeNumber = normalized
|
|
21
30
|
.trim()
|
|
22
31
|
.replace(this._group, '')
|
|
23
32
|
.replace(this._decimal, '.')
|
|
24
33
|
.replace(this._numeral, this._index))
|
|
25
|
-
? +localeNumber
|
|
34
|
+
? +localeNumber * multiplier
|
|
26
35
|
: NaN;
|
|
27
36
|
}
|
|
28
37
|
hasSeparator(localeNumber) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.424.1-alpha-0195bdc.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@genesislcap/foundation-testing": "14.
|
|
33
|
-
"@genesislcap/genx": "14.
|
|
34
|
-
"@genesislcap/rollup-builder": "14.
|
|
35
|
-
"@genesislcap/ts-builder": "14.
|
|
36
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
37
|
-
"@genesislcap/vite-builder": "14.
|
|
38
|
-
"@genesislcap/webpack-builder": "14.
|
|
32
|
+
"@genesislcap/foundation-testing": "14.424.1-alpha-0195bdc.0",
|
|
33
|
+
"@genesislcap/genx": "14.424.1-alpha-0195bdc.0",
|
|
34
|
+
"@genesislcap/rollup-builder": "14.424.1-alpha-0195bdc.0",
|
|
35
|
+
"@genesislcap/ts-builder": "14.424.1-alpha-0195bdc.0",
|
|
36
|
+
"@genesislcap/uvu-playwright-builder": "14.424.1-alpha-0195bdc.0",
|
|
37
|
+
"@genesislcap/vite-builder": "14.424.1-alpha-0195bdc.0",
|
|
38
|
+
"@genesislcap/webpack-builder": "14.424.1-alpha-0195bdc.0",
|
|
39
39
|
"@types/json-schema": "^7.0.11"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@genesislcap/expression-builder": "14.
|
|
43
|
-
"@genesislcap/foundation-logger": "14.
|
|
42
|
+
"@genesislcap/expression-builder": "14.424.1-alpha-0195bdc.0",
|
|
43
|
+
"@genesislcap/foundation-logger": "14.424.1-alpha-0195bdc.0",
|
|
44
44
|
"@microsoft/fast-components": "2.30.6",
|
|
45
45
|
"@microsoft/fast-element": "1.14.0",
|
|
46
46
|
"@microsoft/fast-foundation": "2.50.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"customElements": "dist/custom-elements.json",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d6e750401e2852ff773062ffe193c67209f3d17e"
|
|
62
62
|
}
|