@jscrpt/common 6.0.0 → 6.1.0-beta.20240529033427

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.
Files changed (47) hide show
  1. package/numeral/package.json +8 -0
  2. package/numeral/src/formats/bps.js +34 -0
  3. package/numeral/src/formats/bytes.js +79 -0
  4. package/numeral/src/formats/currency.js +62 -0
  5. package/numeral/src/formats/exponential.js +34 -0
  6. package/numeral/src/formats/ordinal.js +21 -0
  7. package/numeral/src/formats/percentage.js +40 -0
  8. package/numeral/src/formats/time.js +35 -0
  9. package/numeral/src/index.js +89 -0
  10. package/numeral/src/locales/bg.js +28 -0
  11. package/numeral/src/locales/chs.js +20 -0
  12. package/numeral/src/locales/cs.js +20 -0
  13. package/numeral/src/locales/da-dk.js +20 -0
  14. package/numeral/src/locales/de-ch.js +20 -0
  15. package/numeral/src/locales/de.js +20 -0
  16. package/numeral/src/locales/en-au.js +24 -0
  17. package/numeral/src/locales/en-gb.js +24 -0
  18. package/numeral/src/locales/en-za.js +24 -0
  19. package/numeral/src/locales/es-es.js +25 -0
  20. package/numeral/src/locales/es.js +25 -0
  21. package/numeral/src/locales/et.js +20 -0
  22. package/numeral/src/locales/fi.js +20 -0
  23. package/numeral/src/locales/fr-ca.js +20 -0
  24. package/numeral/src/locales/fr-ch.js +20 -0
  25. package/numeral/src/locales/fr.js +20 -0
  26. package/numeral/src/locales/hu.js +20 -0
  27. package/numeral/src/locales/it.js +20 -0
  28. package/numeral/src/locales/ja.js +20 -0
  29. package/numeral/src/locales/lv.js +20 -0
  30. package/numeral/src/locales/nl-be.js +22 -0
  31. package/numeral/src/locales/nl-nl.js +21 -0
  32. package/numeral/src/locales/no.js +20 -0
  33. package/numeral/src/locales/pl.js +20 -0
  34. package/numeral/src/locales/pt-br.js +20 -0
  35. package/numeral/src/locales/pt-pt.js +20 -0
  36. package/numeral/src/locales/ru-ua.js +23 -0
  37. package/numeral/src/locales/ru.js +23 -0
  38. package/numeral/src/locales/sk.js +20 -0
  39. package/numeral/src/locales/sl.js +20 -0
  40. package/numeral/src/locales/th.js +20 -0
  41. package/numeral/src/locales/tr.js +54 -0
  42. package/numeral/src/locales/uk-ua.js +23 -0
  43. package/numeral/src/locales/vi.js +21 -0
  44. package/numeral/src/numeral.js +677 -0
  45. package/package.json +11 -2
  46. package/typings/numeral/index.d.ts +141 -0
  47. package/version.bak +1 -1
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'et', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: ' tuh',
9
+ million: ' mln',
10
+ billion: ' mld',
11
+ trillion: ' trl'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'fi', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'M',
10
+ billion: 'G',
11
+ trillion: 'T'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'fr-ca', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'M',
10
+ billion: 'G',
11
+ trillion: 'T'
12
+ },
13
+ ordinal : function (number) {
14
+ return number === 1 ? 'er' : 'e';
15
+ },
16
+ currency: {
17
+ symbol: '$'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'fr-ch', {
3
+ delimiters: {
4
+ thousands: '\'',
5
+ decimal: '.'
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'm',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal : function (number) {
14
+ return number === 1 ? 'er' : 'e';
15
+ },
16
+ currency: {
17
+ symbol: 'CHF'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'fr', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'm',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal : function (number) {
14
+ return number === 1 ? 'er' : 'e';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'hu', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'E', // ezer
9
+ million: 'M', // millió
10
+ billion: 'Mrd', // milliárd
11
+ trillion: 'T' // trillió
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: ' Ft'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'it', {
3
+ delimiters: {
4
+ thousands: '.',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'mila',
9
+ million: 'mil',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal: function (number) {
14
+ return 'º';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'ja', {
3
+ delimiters: {
4
+ thousands: ',',
5
+ decimal: '.'
6
+ },
7
+ abbreviations: {
8
+ thousand: '千',
9
+ million: '百万',
10
+ billion: '十億',
11
+ trillion: '兆'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '¥'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'lv', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: ' tūkst.',
9
+ million: ' milj.',
10
+ billion: ' mljrd.',
11
+ trillion: ' trilj.'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,22 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'nl-be', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal : ','
6
+ },
7
+ abbreviations: {
8
+ thousand : 'k',
9
+ million : ' mln',
10
+ billion : ' mld',
11
+ trillion : ' bln'
12
+ },
13
+ ordinal : function (number) {
14
+ var remainder = number % 100;
15
+
16
+ return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
17
+ },
18
+ currency: {
19
+ symbol: '€ '
20
+ }
21
+ });
22
+ };
@@ -0,0 +1,21 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'nl-nl', {
3
+ delimiters: {
4
+ thousands: '.',
5
+ decimal : ','
6
+ },
7
+ abbreviations: {
8
+ thousand : 'k',
9
+ million : 'mln',
10
+ billion : 'mrd',
11
+ trillion : 'bln'
12
+ },
13
+ ordinal : function (number) {
14
+ var remainder = number % 100;
15
+ return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
16
+ },
17
+ currency: {
18
+ symbol: '€ '
19
+ }
20
+ });
21
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'no', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'm',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: 'kr'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'pl', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'tys.',
9
+ million: 'mln',
10
+ billion: 'mld',
11
+ trillion: 'bln'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: 'PLN'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'pt-br', {
3
+ delimiters: {
4
+ thousands: '.',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'mil',
9
+ million: 'milhões',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal: function (number) {
14
+ return 'º';
15
+ },
16
+ currency: {
17
+ symbol: 'R$'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'pt-pt', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'm',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal : function (number) {
14
+ return 'º';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,23 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'ru-ua', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'тыс.',
9
+ million: 'млн',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal: function () {
14
+ // not ideal, but since in Russian it can taken on
15
+ // different forms (masculine, feminine, neuter)
16
+ // this is all we can do
17
+ return '.';
18
+ },
19
+ currency: {
20
+ symbol: '\u20B4'
21
+ }
22
+ });
23
+ };
@@ -0,0 +1,23 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'ru', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'тыс.',
9
+ million: 'млн.',
10
+ billion: 'млрд.',
11
+ trillion: 'трлн.'
12
+ },
13
+ ordinal: function () {
14
+ // not ideal, but since in Russian it can taken on
15
+ // different forms (masculine, feminine, neuter)
16
+ // this is all we can do
17
+ return '.';
18
+ },
19
+ currency: {
20
+ symbol: 'руб.'
21
+ }
22
+ });
23
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'sk', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'tis.',
9
+ million: 'mil.',
10
+ billion: 'b',
11
+ trillion: 't'
12
+ },
13
+ ordinal: function () {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'sl', {
3
+ delimiters: {
4
+ thousands: '.',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'k',
9
+ million: 'mio',
10
+ billion: 'mrd',
11
+ trillion: 'trilijon'
12
+ },
13
+ ordinal: function () {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '€'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,20 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'th', {
3
+ delimiters: {
4
+ thousands: ',',
5
+ decimal: '.'
6
+ },
7
+ abbreviations: {
8
+ thousand: 'พัน',
9
+ million: 'ล้าน',
10
+ billion: 'พันล้าน',
11
+ trillion: 'ล้านล้าน'
12
+ },
13
+ ordinal: function (number) {
14
+ return '.';
15
+ },
16
+ currency: {
17
+ symbol: '฿'
18
+ }
19
+ });
20
+ };
@@ -0,0 +1,54 @@
1
+ export default function localeFactory(numeral) {
2
+ var suffixes = {
3
+ 1: '\'inci',
4
+ 5: '\'inci',
5
+ 8: '\'inci',
6
+ 70: '\'inci',
7
+ 80: '\'inci',
8
+
9
+ 2: '\'nci',
10
+ 7: '\'nci',
11
+ 20: '\'nci',
12
+ 50: '\'nci',
13
+
14
+ 3: '\'üncü',
15
+ 4: '\'üncü',
16
+ 100: '\'üncü',
17
+
18
+ 6: '\'ncı',
19
+
20
+ 9: '\'uncu',
21
+ 10: '\'uncu',
22
+ 30: '\'uncu',
23
+
24
+ 60: '\'ıncı',
25
+ 90: '\'ıncı'
26
+ };
27
+
28
+ numeral.register('locale', 'tr', {
29
+ delimiters: {
30
+ thousands: '.',
31
+ decimal: ','
32
+ },
33
+ abbreviations: {
34
+ thousand: 'bin',
35
+ million: 'milyon',
36
+ billion: 'milyar',
37
+ trillion: 'trilyon'
38
+ },
39
+ ordinal: function (number) {
40
+ if (number === 0) { // special case for zero
41
+ return '\'ıncı';
42
+ }
43
+
44
+ var a = number % 10,
45
+ b = number % 100 - a,
46
+ c = number >= 100 ? 100 : null;
47
+
48
+ return suffixes[a] || suffixes[b] || suffixes[c];
49
+ },
50
+ currency: {
51
+ symbol: '\u20BA'
52
+ }
53
+ });
54
+ };
@@ -0,0 +1,23 @@
1
+ export default function localeFactory(numeral) {
2
+ numeral.register('locale', 'uk-ua', {
3
+ delimiters: {
4
+ thousands: ' ',
5
+ decimal: ','
6
+ },
7
+ abbreviations: {
8
+ thousand: 'тис.',
9
+ million: 'млн',
10
+ billion: 'млрд',
11
+ trillion: 'блн'
12
+ },
13
+ ordinal: function () {
14
+ // not ideal, but since in Ukrainian it can taken on
15
+ // different forms (masculine, feminine, neuter)
16
+ // this is all we can do
17
+ return '';
18
+ },
19
+ currency: {
20
+ symbol: '\u20B4'
21
+ }
22
+ });
23
+ };
@@ -0,0 +1,21 @@
1
+ export default function localeFactory(numeral) {
2
+
3
+ numeral.register('locale', 'vi', {
4
+ delimiters: {
5
+ thousands: '.',
6
+ decimal: ','
7
+ },
8
+ abbreviations: {
9
+ thousand: ' nghìn',
10
+ million: ' triệu',
11
+ billion: ' tỷ',
12
+ trillion: ' nghìn tỷ'
13
+ },
14
+ ordinal: function () {
15
+ return '.';
16
+ },
17
+ currency: {
18
+ symbol: '₫'
19
+ }
20
+ });
21
+ };