@visulima/humanizer 3.0.0-alpha.11 → 3.0.0-alpha.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.
Files changed (150) hide show
  1. package/dist/index.d.ts +140 -4
  2. package/dist/index.js +1 -3
  3. package/dist/language/af.d.ts +3 -2
  4. package/dist/language/af.js +1 -41
  5. package/dist/language/am.d.ts +3 -2
  6. package/dist/language/am.js +1 -33
  7. package/dist/language/ar.d.ts +3 -2
  8. package/dist/language/ar.js +1 -53
  9. package/dist/language/bg.d.ts +3 -2
  10. package/dist/language/bg.js +1 -42
  11. package/dist/language/bn.d.ts +3 -2
  12. package/dist/language/bn.js +1 -33
  13. package/dist/language/ca.d.ts +3 -2
  14. package/dist/language/ca.js +1 -41
  15. package/dist/language/ckb.d.ts +3 -2
  16. package/dist/language/ckb.js +1 -33
  17. package/dist/language/cs.d.ts +3 -2
  18. package/dist/language/cs.js +1 -53
  19. package/dist/language/cy.d.ts +3 -2
  20. package/dist/language/cy.js +1 -53
  21. package/dist/language/da.d.ts +3 -2
  22. package/dist/language/da.js +1 -45
  23. package/dist/language/de.d.ts +3 -2
  24. package/dist/language/de.js +1 -47
  25. package/dist/language/el.d.ts +3 -2
  26. package/dist/language/el.js +1 -53
  27. package/dist/language/en.d.ts +4 -3
  28. package/dist/language/en.js +1 -57
  29. package/dist/language/eo.d.ts +3 -2
  30. package/dist/language/eo.js +1 -47
  31. package/dist/language/es.d.ts +3 -2
  32. package/dist/language/es.js +1 -46
  33. package/dist/language/et.d.ts +3 -2
  34. package/dist/language/et.js +1 -47
  35. package/dist/language/eu.d.ts +3 -2
  36. package/dist/language/eu.js +1 -41
  37. package/dist/language/fa.d.ts +3 -2
  38. package/dist/language/fa.js +1 -38
  39. package/dist/language/fi.d.ts +3 -2
  40. package/dist/language/fi.js +1 -55
  41. package/dist/language/fo.d.ts +3 -2
  42. package/dist/language/fo.js +1 -48
  43. package/dist/language/fr.d.ts +3 -2
  44. package/dist/language/fr.js +1 -52
  45. package/dist/language/he.d.ts +3 -2
  46. package/dist/language/he.js +1 -52
  47. package/dist/language/hi.d.ts +3 -2
  48. package/dist/language/hi.js +1 -55
  49. package/dist/language/hr.d.ts +3 -2
  50. package/dist/language/hr.js +1 -110
  51. package/dist/language/hu.d.ts +3 -2
  52. package/dist/language/hu.js +1 -51
  53. package/dist/language/id.d.ts +3 -2
  54. package/dist/language/id.js +1 -50
  55. package/dist/language/is.d.ts +3 -2
  56. package/dist/language/is.js +1 -52
  57. package/dist/language/it.d.ts +3 -2
  58. package/dist/language/it.js +1 -51
  59. package/dist/language/ja.d.ts +3 -2
  60. package/dist/language/ja.js +1 -47
  61. package/dist/language/km.d.ts +3 -2
  62. package/dist/language/km.js +1 -57
  63. package/dist/language/kn.d.ts +3 -2
  64. package/dist/language/kn.js +1 -50
  65. package/dist/language/ko.d.ts +3 -2
  66. package/dist/language/ko.js +1 -42
  67. package/dist/language/ku.d.ts +3 -2
  68. package/dist/language/ku.js +1 -54
  69. package/dist/language/lo.d.ts +3 -2
  70. package/dist/language/lo.js +1 -58
  71. package/dist/language/lt.d.ts +3 -2
  72. package/dist/language/lt.js +1 -69
  73. package/dist/language/lv.d.ts +3 -2
  74. package/dist/language/lv.js +1 -55
  75. package/dist/language/mk.d.ts +3 -2
  76. package/dist/language/mk.js +1 -55
  77. package/dist/language/mn.d.ts +3 -2
  78. package/dist/language/mn.js +1 -46
  79. package/dist/language/mr.d.ts +3 -2
  80. package/dist/language/mr.js +1 -43
  81. package/dist/language/ms.d.ts +3 -2
  82. package/dist/language/ms.js +1 -49
  83. package/dist/language/nl.d.ts +3 -2
  84. package/dist/language/nl.js +1 -50
  85. package/dist/language/no.d.ts +3 -2
  86. package/dist/language/no.js +1 -47
  87. package/dist/language/pl.d.ts +3 -2
  88. package/dist/language/pl.js +1 -73
  89. package/dist/language/pt.d.ts +3 -2
  90. package/dist/language/pt.js +1 -50
  91. package/dist/language/ro.d.ts +3 -2
  92. package/dist/language/ro.js +1 -66
  93. package/dist/language/ru.d.ts +3 -2
  94. package/dist/language/ru.js +1 -59
  95. package/dist/language/sk.d.ts +3 -2
  96. package/dist/language/sk.js +1 -64
  97. package/dist/language/sl.d.ts +3 -2
  98. package/dist/language/sl.js +1 -138
  99. package/dist/language/sq.d.ts +3 -2
  100. package/dist/language/sq.js +1 -51
  101. package/dist/language/sr.d.ts +3 -2
  102. package/dist/language/sr.js +1 -83
  103. package/dist/language/sr_Latn.d.ts +3 -2
  104. package/dist/language/sr_Latn.js +1 -21
  105. package/dist/language/sv.d.ts +3 -2
  106. package/dist/language/sv.js +1 -49
  107. package/dist/language/sw.d.ts +3 -2
  108. package/dist/language/sw.js +1 -51
  109. package/dist/language/ta.d.ts +3 -2
  110. package/dist/language/ta.js +1 -54
  111. package/dist/language/te.d.ts +3 -2
  112. package/dist/language/te.js +1 -50
  113. package/dist/language/th.d.ts +3 -2
  114. package/dist/language/th.js +1 -44
  115. package/dist/language/tr.d.ts +3 -2
  116. package/dist/language/tr.js +1 -42
  117. package/dist/language/uk.d.ts +3 -2
  118. package/dist/language/uk.js +1 -61
  119. package/dist/language/ur.d.ts +3 -2
  120. package/dist/language/ur.js +1 -57
  121. package/dist/language/util/create-duration-language.d.ts +2 -2
  122. package/dist/language/util/create-duration-language.js +1 -33
  123. package/dist/language/util/duration/get-czech-or-slovak-form.d.ts +1 -1
  124. package/dist/language/util/duration/get-czech-or-slovak-form.js +1 -14
  125. package/dist/language/util/duration/get-slavic-form.d.ts +1 -1
  126. package/dist/language/util/duration/get-slavic-form.js +1 -17
  127. package/dist/language/util/validate-duration-language.d.ts +2 -2
  128. package/dist/language/util/validate-duration-language.js +1 -37
  129. package/dist/language/uz.d.ts +3 -2
  130. package/dist/language/uz.js +1 -43
  131. package/dist/language/uz_CYR.d.ts +3 -2
  132. package/dist/language/uz_CYR.js +1 -43
  133. package/dist/language/vi.d.ts +3 -2
  134. package/dist/language/vi.js +1 -34
  135. package/dist/language/zh_CN.d.ts +3 -2
  136. package/dist/language/zh_CN.js +1 -39
  137. package/dist/language/zh_TW.d.ts +3 -2
  138. package/dist/language/zh_TW.js +1 -39
  139. package/dist/packem_shared/duration-LS6hKnI1.js +1 -0
  140. package/dist/packem_shared/parseBytes-CxhY-u8u.js +1 -0
  141. package/dist/packem_shared/parseDuration-CfrrX3_c.js +1 -0
  142. package/dist/packem_shared/types.d-DEgTgpjz.d.ts +130 -0
  143. package/package.json +19 -21
  144. package/dist/bytes.d.ts +0 -131
  145. package/dist/duration.d.ts +0 -3
  146. package/dist/packem_shared/duration-Br8Mr-Lj.js +0 -210
  147. package/dist/packem_shared/parseBytes-BkjYV2ut.js +0 -250
  148. package/dist/packem_shared/parseDuration-qO1Y4eiu.js +0 -111
  149. package/dist/parse-duration.d.ts +0 -9
  150. package/dist/types.d.ts +0 -130
@@ -1,57 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const urUnitMap = {
4
- ms: "ms",
5
- ث: "s",
6
- // Alternative Abbreviation
7
- د: "d",
8
- // Abbreviation
9
- دن: "d",
10
- س: "y",
11
- // Abbreviation
12
- سال: "y",
13
- سیک: "s",
14
- // Abbreviation
15
- سیکنڈ: "s",
16
- گھ: "h",
17
- // Abbreviation
18
- گھنٹہ: "h",
19
- گھنٹے: "h",
20
- م: "m",
21
- // Abbreviation
22
- ماہ: "mo",
23
- // Alternative word
24
- مل: "ms",
25
- // Abbreviation
26
- ملی_سیکنڈ: "ms",
27
- منٹ: "m",
28
- مہ: "mo",
29
- // Abbreviation
30
- مہینہ: "mo",
31
- مہینے: "mo",
32
- ہ: "w",
33
- // Abbreviation
34
- ہفتہ: "w",
35
- ہفتے: "w"
36
- };
37
- const durationLanguage = createDurationLanguage(
38
- "سال",
39
- (counter) => counter === 1 ? "مہینہ" : "مہینے",
40
- (counter) => counter === 1 ? "ہفتہ" : "ہفتے",
41
- "دن",
42
- (counter) => counter === 1 ? "گھنٹہ" : "گھنٹے",
43
- "منٹ",
44
- "سیکنڈ",
45
- "ملی سیکنڈ",
46
- "%s بعد",
47
- "%s قبل",
48
- ".",
49
- // decimal separator (Urdu uses .)
50
- urUnitMap,
51
- ",",
52
- // group separator (Urdu uses ,)
53
- "_"
54
- // placeholder separator
55
- );
56
-
57
- export { durationLanguage };
1
+ import s from"./util/create-duration-language.js";const o={ms:"ms",ث:"s",د:"d",دن:"d",س:"y",سال:"y",سیک:"s",سیکنڈ:"s",گھ:"h",گھنٹہ:"h",گھنٹے:"h",م:"m",ماہ:"mo",مل:"ms",ملی_سیکنڈ:"ms",منٹ:"m",مہ:"mo",مہینہ:"mo",مہینے:"mo",ہ:"w",ہفتہ:"w",ہفتے:"w"},n=s("سال",m=>m===1?"مہینہ":"مہینے",m=>m===1?"ہفتہ":"ہفتے","دن",m=>m===1?"گھنٹہ":"گھنٹے","منٹ","سیکنڈ","ملی سیکنڈ","%s بعد","%s قبل",".",o,",","_");export{n as durationLanguage};
@@ -1,3 +1,3 @@
1
- import type { DurationLanguage, DurationUnit, DurationUnitMeasures } from "../../types.d.ts";
1
+ import { b as DurationUnit, a as DurationUnitMeasures, D as DurationLanguage } from "../../packem_shared/types.d-DEgTgpjz.js";
2
2
  declare const createDurationLanguage: (y: DurationUnit, mo: DurationUnit, w: DurationUnit, d: DurationUnit, h: DurationUnit, m: DurationUnit, s: DurationUnit, ms: DurationUnit, future?: string, past?: string, decimal?: string, unitMap?: Record<string, keyof DurationUnitMeasures>, groupSeparator?: string, placeholderSeparator?: string) => DurationLanguage;
3
- export default createDurationLanguage;
3
+ export { createDurationLanguage as default };
@@ -1,33 +1 @@
1
- const createDurationLanguage = (y, mo, w, d, h, m, s, ms, future, past, decimal, unitMap, groupSeparator, placeholderSeparator) => {
2
- const result = {
3
- d,
4
- h,
5
- m,
6
- mo,
7
- ms,
8
- s,
9
- w,
10
- y
11
- };
12
- if (future !== void 0) {
13
- result.future = future;
14
- }
15
- if (past !== void 0) {
16
- result.past = past;
17
- }
18
- if (decimal !== void 0) {
19
- result.decimal = decimal;
20
- }
21
- if (unitMap !== void 0) {
22
- result.unitMap = unitMap;
23
- }
24
- if (groupSeparator !== void 0) {
25
- result.groupSeparator = groupSeparator;
26
- }
27
- if (placeholderSeparator !== void 0) {
28
- result.placeholderSeparator = placeholderSeparator;
29
- }
30
- return result;
31
- };
32
-
33
- export { createDurationLanguage as default };
1
+ var f=Object.defineProperty;var v=(a,r)=>f(a,"name",{value:r,configurable:!0});var y=Object.defineProperty,b=v((a,r)=>y(a,"name",{value:r,configurable:!0}),"D");const D=b((a,r,p,c,l,s,m,g,o,t,d,i,n,u)=>{const e={d:c,h:l,m:s,mo:r,ms:g,s:m,w:p,y:a};return o!==void 0&&(e.future=o),t!==void 0&&(e.past=t),d!==void 0&&(e.decimal=d),i!==void 0&&(e.unitMap=i),n!==void 0&&(e.groupSeparator=n),u!==void 0&&(e.placeholderSeparator=u),e},"createDurationLanguage");export{D as default};
@@ -1,2 +1,2 @@
1
1
  declare const getCzechOrSlovakForm: (counter: number) => number;
2
- export default getCzechOrSlovakForm;
2
+ export { getCzechOrSlovakForm as default };
@@ -1,14 +1 @@
1
- const getCzechOrSlovakForm = (counter) => {
2
- if (counter === 1) {
3
- return 0;
4
- }
5
- if (Math.floor(counter) !== counter) {
6
- return 1;
7
- }
8
- if (counter % 10 >= 2 && counter % 10 <= 4 && counter % 100 < 10) {
9
- return 2;
10
- }
11
- return 3;
12
- };
13
-
14
- export { getCzechOrSlovakForm as default };
1
+ var o=Object.defineProperty;var t=(e,a)=>o(e,"name",{value:a,configurable:!0});var l=Object.defineProperty,r=t((e,a)=>l(e,"name",{value:a,configurable:!0}),"e");const f=r(e=>e===1?0:Math.floor(e)!==e?1:e%10>=2&&e%10<=4&&e%100<10?2:3,"getCzechOrSlovakForm");export{f as default};
@@ -1,2 +1,2 @@
1
1
  declare const getSlavicForm: (counter: number) => number;
2
- export default getSlavicForm;
2
+ export { getSlavicForm as default };
@@ -1,17 +1 @@
1
- const getSlavicForm = (counter) => {
2
- if (Math.floor(counter) !== counter) {
3
- return 2;
4
- }
5
- if (counter % 100 >= 5 && counter % 100 <= 20 || counter % 10 >= 5 && counter % 10 <= 9 || counter % 10 === 0) {
6
- return 0;
7
- }
8
- if (counter % 10 === 1) {
9
- return 1;
10
- }
11
- if (counter > 1) {
12
- return 2;
13
- }
14
- return 0;
15
- };
16
-
17
- export { getSlavicForm as default };
1
+ var o=Object.defineProperty;var t=(e,a)=>o(e,"name",{value:a,configurable:!0});var l=Object.defineProperty,f=t((e,a)=>l(e,"name",{value:a,configurable:!0}),"f");const n=f(e=>Math.floor(e)!==e?2:e%100>=5&&e%100<=20||e%10>=5&&e%10<=9||e%10===0?0:e%10===1?1:e>1?2:0,"getSlavicForm");export{n as default};
@@ -1,3 +1,3 @@
1
- import type { DurationLanguage } from "../../types.d.ts";
1
+ import { D as DurationLanguage } from "../../packem_shared/types.d-DEgTgpjz.js";
2
2
  declare const validateDurationLanguage: (language: DurationLanguage) => void;
3
- export default validateDurationLanguage;
3
+ export { validateDurationLanguage as default };
@@ -1,37 +1 @@
1
- const validateDurationLanguage = (language) => {
2
- const requiredProperties = ["y", "mo", "w", "d", "h", "m", "s", "ms", "future", "past"];
3
- for (const property of requiredProperties) {
4
- if (!Object.hasOwn(language, property)) {
5
- throw new TypeError(`Missing required property: ${property}`);
6
- }
7
- }
8
- if (typeof language.future !== "string" || typeof language.past !== "string") {
9
- throw new TypeError("Properties future and past must be of type string");
10
- }
11
- const unitProperties = ["y", "mo", "w", "d", "h", "m", "s", "ms"];
12
- for (const property of unitProperties) {
13
- if (typeof language[property] !== "string" && typeof language[property] !== "function") {
14
- throw new TypeError(`Property ${property} must be of type string or function`);
15
- }
16
- }
17
- if (language.decimal && typeof language.decimal !== "string") {
18
- throw new TypeError("Property decimal must be of type string");
19
- }
20
- if (language.delimiter && typeof language.delimiter !== "string") {
21
- throw new TypeError("Property delimiter must be of type string");
22
- }
23
- if (language._digitReplacements && !Array.isArray(language._digitReplacements)) {
24
- throw new TypeError("Property _digitReplacements must be an array");
25
- }
26
- if (language._numberFirst && typeof language._numberFirst !== "boolean") {
27
- throw new TypeError("Property _numberFirst must be of type boolean");
28
- }
29
- if (language.unitMap && typeof language.unitMap !== "object") {
30
- throw new TypeError("Property unitMap must be an object");
31
- }
32
- if (language.unitMap && Object.values(language.unitMap).some((value) => typeof value !== "string")) {
33
- throw new TypeError("All values in unitMap must be of type string");
34
- }
35
- };
36
-
37
- export { validateDurationLanguage as default };
1
+ var n=Object.defineProperty;var o=(e,r)=>n(e,"name",{value:r,configurable:!0});var p=Object.defineProperty,s=o((e,r)=>p(e,"name",{value:r,configurable:!0}),"o");const y=s(e=>{const r=["y","mo","w","d","h","m","s","ms","future","past"];for(const t of r)if(!Object.hasOwn(e,t))throw new TypeError(`Missing required property: ${t}`);if(typeof e.future!="string"||typeof e.past!="string")throw new TypeError("Properties future and past must be of type string");const i=["y","mo","w","d","h","m","s","ms"];for(const t of i)if(typeof e[t]!="string"&&typeof e[t]!="function")throw new TypeError(`Property ${t} must be of type string or function`);if(e.decimal&&typeof e.decimal!="string")throw new TypeError("Property decimal must be of type string");if(e.delimiter&&typeof e.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(e._digitReplacements&&!Array.isArray(e._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(e._numberFirst&&typeof e._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(e.unitMap&&typeof e.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(e.unitMap&&Object.values(e.unitMap).some(t=>typeof t!="string"))throw new TypeError("All values in unitMap must be of type string")},"validateDurationLanguage");export{y as default};
@@ -1,2 +1,3 @@
1
- import type { DurationLanguage } from "../types.d.ts";
2
- export declare const durationLanguage: DurationLanguage;
1
+ import { D as DurationLanguage } from "../packem_shared/types.d-DEgTgpjz.js";
2
+ declare const durationLanguage: DurationLanguage;
3
+ export { durationLanguage };
@@ -1,43 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const uzUnitMap = {
4
- h: "w",
5
- hafta: "w",
6
- k: "d",
7
- kun: "d",
8
- m: "m",
9
- millisekund: "ms",
10
- min: "m",
11
- minut: "m",
12
- ms: "ms",
13
- o: "mo",
14
- oy: "mo",
15
- s: "h",
16
- sek: "s",
17
- sekund: "s",
18
- soat: "h",
19
- y: "y",
20
- yil: "y"
21
- };
22
- const durationLanguage = createDurationLanguage(
23
- "yil",
24
- "oy",
25
- "hafta",
26
- "kun",
27
- "soat",
28
- "minut",
29
- "sekund",
30
- "millisekund",
31
- "%s da",
32
- "%s avval",
33
- // "%s ago"
34
- ",",
35
- // decimal separator in Uzbek
36
- uzUnitMap,
37
- " ",
38
- // group separator in Uzbek
39
- "_"
40
- // placeholder separator
41
- );
42
-
43
- export { durationLanguage };
1
+ import s from"./util/create-duration-language.js";const m={h:"w",hafta:"w",k:"d",kun:"d",m:"m",millisekund:"ms",min:"m",minut:"m",ms:"ms",o:"mo",oy:"mo",s:"h",sek:"s",sekund:"s",soat:"h",y:"y",yil:"y"},o=s("yil","oy","hafta","kun","soat","minut","sekund","millisekund","%s da","%s avval",",",m," ","_");export{o as durationLanguage};
@@ -1,2 +1,3 @@
1
- import type { DurationLanguage } from "../types.d.ts";
2
- export declare const durationLanguage: DurationLanguage;
1
+ import { D as DurationLanguage } from "../packem_shared/types.d-DEgTgpjz.js";
2
+ declare const durationLanguage: DurationLanguage;
3
+ export { durationLanguage };
@@ -1,43 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const uzCyrUnitMap = {
4
- й: "y",
5
- йил: "y",
6
- к: "d",
7
- кун: "d",
8
- м: "m",
9
- миллисекунд: "ms",
10
- мин: "m",
11
- минут: "m",
12
- мс: "ms",
13
- о: "mo",
14
- ой: "mo",
15
- с: "h",
16
- сек: "s",
17
- секунд: "s",
18
- соат: "h",
19
- ҳ: "w",
20
- ҳафта: "w"
21
- };
22
- const durationLanguage = createDurationLanguage(
23
- "йил",
24
- "ой",
25
- "ҳафта",
26
- "кун",
27
- "соат",
28
- "минут",
29
- "секунд",
30
- "миллисекунд",
31
- "%s да",
32
- "%s аввал",
33
- // "%s ago"
34
- ",",
35
- // decimal separator in Uzbek Cyrillic
36
- uzCyrUnitMap,
37
- " ",
38
- // group separator in Uzbek Cyrillic
39
- "_"
40
- // placeholder separator
41
- );
42
-
43
- export { durationLanguage };
1
+ import m from"./util/create-duration-language.js";const o={й:"y",йил:"y",к:"d",кун:"d",м:"m",миллисекунд:"ms",мин:"m",минут:"m",мс:"ms",о:"mo",ой:"mo",с:"h",сек:"s",секунд:"s",соат:"h",ҳ:"w",ҳафта:"w"},t=m("йил","ой","ҳафта","кун","соат","минут","секунд","миллисекунд","%s да","%s аввал",",",o," ","_");export{t as durationLanguage};
@@ -1,2 +1,3 @@
1
- import type { DurationLanguage } from "../types.d.ts";
2
- export declare const durationLanguage: DurationLanguage;
1
+ import { D as DurationLanguage } from "../packem_shared/types.d-DEgTgpjz.js";
2
+ declare const durationLanguage: DurationLanguage;
3
+ export { durationLanguage };
@@ -1,34 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const viUnitMap = {
4
- giây: "s",
5
- giờ: "h",
6
- mili: "ms",
7
- miligiây: "ms",
8
- năm: "y",
9
- ngày: "d",
10
- phút: "m",
11
- tháng: "mo",
12
- tuần: "w"
13
- };
14
- const durationLanguage = createDurationLanguage(
15
- "năm",
16
- "tháng",
17
- "tuần",
18
- "ngày",
19
- "giờ",
20
- "phút",
21
- "giây",
22
- "mili giây",
23
- "%s tới",
24
- "%s trước",
25
- ",",
26
- // decimal
27
- viUnitMap,
28
- ".",
29
- // groupSeparator
30
- "_"
31
- // placeholderSeparator
32
- );
33
-
34
- export { durationLanguage };
1
+ import i from"./util/create-duration-language.js";const t={giây:"s",giờ:"h",mili:"ms",miligiây:"ms",năm:"y",ngày:"d",phút:"m",tháng:"mo",tuần:"w"},n=i("năm","tháng","tuần","ngày","giờ","phút","giây","mili giây","%s tới","%s trước",",",t,".","_");export{n as durationLanguage};
@@ -1,2 +1,3 @@
1
- import type { DurationLanguage } from "../types.d.ts";
2
- export declare const durationLanguage: DurationLanguage;
1
+ import { D as DurationLanguage } from "../packem_shared/types.d-DEgTgpjz.js";
2
+ declare const durationLanguage: DurationLanguage;
3
+ export { durationLanguage };
@@ -1,39 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const zhCNUnitMap = {
4
- 个月: "mo",
5
- 分: "m",
6
- 分钟: "m",
7
- 周: "w",
8
- 天: "d",
9
- 小时: "h",
10
- 年: "y",
11
- 日: "d",
12
- 时: "h",
13
- 星期: "w",
14
- 月: "mo",
15
- 毫秒: "ms",
16
- 秒: "s",
17
- 秒钟: "s"
18
- };
19
- const durationLanguage = createDurationLanguage(
20
- "年",
21
- "个月",
22
- "周",
23
- "天",
24
- "小时",
25
- "分",
26
- "秒",
27
- "毫秒",
28
- "%s后",
29
- "%s前",
30
- ".",
31
- // decimal
32
- zhCNUnitMap,
33
- ",",
34
- // groupSeparator
35
- "_"
36
- // placeholderSeparator
37
- );
38
-
39
- export { durationLanguage };
1
+ import o from"./util/create-duration-language.js";const m={个月:"mo",分:"m",分钟:"m",周:"w",天:"d",小时:"h",年:"y",日:"d",时:"h",星期:"w",月:"mo",毫秒:"ms",秒:"s",秒钟:"s"},t=o("年","个月","周","天","小时","分","秒","毫秒","%s后","%s前",".",m,",","_");export{t as durationLanguage};
@@ -1,2 +1,3 @@
1
- import type { DurationLanguage } from "../types.d.ts";
2
- export declare const durationLanguage: DurationLanguage;
1
+ import { D as DurationLanguage } from "../packem_shared/types.d-DEgTgpjz.js";
2
+ declare const durationLanguage: DurationLanguage;
3
+ export { durationLanguage };
@@ -1,39 +1 @@
1
- import createDurationLanguage from './util/create-duration-language.js';
2
-
3
- const zhTWUnitMap = {
4
- 個月: "mo",
5
- 分: "m",
6
- 分鐘: "m",
7
- 天: "d",
8
- 小時: "h",
9
- 年: "y",
10
- 日: "d",
11
- 星期: "w",
12
- 時: "h",
13
- 月: "mo",
14
- 毫秒: "ms",
15
- 秒: "s",
16
- 秒鐘: "s",
17
- 週: "w"
18
- };
19
- const durationLanguage = createDurationLanguage(
20
- "年",
21
- "個月",
22
- "周",
23
- "天",
24
- "小時",
25
- "分鐘",
26
- "秒",
27
- "毫秒",
28
- "%s後",
29
- "%s前",
30
- ".",
31
- // decimal
32
- zhTWUnitMap,
33
- ",",
34
- // groupSeparator
35
- "_"
36
- // placeholderSeparator
37
- );
38
-
39
- export { durationLanguage };
1
+ import o from"./util/create-duration-language.js";const m={個月:"mo",分:"m",分鐘:"m",天:"d",小時:"h",年:"y",日:"d",星期:"w",時:"h",月:"mo",毫秒:"ms",秒:"s",秒鐘:"s",週:"w"},t=o("年","個月","周","天","小時","分鐘","秒","毫秒","%s後","%s前",".",m,",","_");export{t as durationLanguage};
@@ -0,0 +1 @@
1
+ var x=Object.defineProperty;var b=(r,n)=>x(r,"name",{value:n,configurable:!0});import{durationLanguage as M}from"../language/en.js";import P from"../language/util/validate-duration-language.js";var w=Object.defineProperty,g=b((r,n)=>w(r,"name",{value:n,configurable:!0}),"g");const N=g((r,n)=>{n=n||-1;const e=new RegExp(String.raw`^-?\d+(?:\.\d{0,${String(n)}})?`).exec(r.toString());return e===null?r:Number.parseFloat(e[0])},"toFixed"),v=g(({unitCount:r,unitName:n},e,l)=>{let{spacer:d}=l;const{maxDecimalPoints:s}=l;let o=".";l.decimal!==void 0?o=l.decimal:e.decimal!==void 0&&(o=e.decimal);let t;"digitReplacements"in l?t=l.digitReplacements:"_digitReplacements"in e&&(t=e._digitReplacements);let i,f=r;s!==void 0&&(f=N(r,s));const a=f.toString();if(!e._hideCountIf2||r!==2)if(t){i="";for(const m of a)i+=m==="."?o:t[m]}else i=a.replace(".",o);else i="";const u=e[n];let c=u;return typeof u=="function"&&(c=u(r)),e._hideCountIf2&&r===2&&(d=""),e._numberFirst?c+d+i:i+d+c},"renderPiece"),C=g((r,n)=>{const{units:e}=n;if(e.length===0)return[];const{unitMeasures:l}=n,d=n.largest??Number.POSITIVE_INFINITY,s={};let o,t,i,f=r;for(t=0;t<e.length;t++){o=e[t];const u=l[o];i=t===e.length-1?f/u:Math.floor(f/u),s[o]=i,f-=i*u}if(n.round){let u=d;for(t=0;t<e.length;t++)if(o=e[t],i=s[o],i!==0&&(u--,u===0)){for(let c=t+1;c<e.length;c++){const m=e[c],h=s[m];s[o]=(s[o]??0)+h*l[m]/l[o],s[m]=0}break}for(t=e.length-1;t>=0;t--){if(o=e[t],i=s[o],i===0)continue;const c=Math.round(i);if(s[o]=c,t===0)break;const m=e[t-1],h=l[m],p=Math.floor(c*l[o]/h);if(p)s[m]=(s[m]??0)+p,s[o]=0;else break}}const a=[];for(t=0;t<e.length&&a.length<d;t++){if(o=e[t],i=s[o],i&&!n.round&&a.length===d-1){let u,c=0;for(u=t+1,e.length;u<e.length;u++){const m=e[u];c+=s[m]*(n.unitMeasures[m]/n.unitMeasures[o])}i+=c,n.maxDecimalPoints!==void 0&&(i=N(i,n.maxDecimalPoints))}i&&a.push({unitCount:i,unitName:o})}return a},"getPieces"),I=g((r,n,e)=>{const{language:l,units:d}=n;if(r.length===0){const u=d.at(-1);return v({unitCount:0,unitName:u},l,n)}const{conjunction:s,serialComma:o}=n;let t=", ";n.delimiter!==void 0?t=n.delimiter:l.delimiter!==void 0&&(t=l.delimiter);let i="";n.timeAdverb&&e!==0&&(i=l.future??"",e<0&&(i=l.past??""));const f=r.map(u=>v(u,l,n));let a;return!s||r.length===1?a=f.join(t):r.length===2?a=f.join(s):a=f.slice(0,-1).join(t)+(o?",":"")+s+(f.at(-1)??""),i&&(a=i.replace("%s",a)),a},"formatPieces"),R=g((r,n)=>{if(Number.isNaN(r))throw new TypeError("Expected a valid number");if(typeof r!="number")throw new TypeError("Expected a number for milliseconds input");const e={conjunction:"",language:M,round:!1,serialComma:!0,spacer:" ",timeAdverb:!1,unitMeasures:{d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},units:["w","d","h","m","s"],...n};P(e.language);const l=Math.abs(r),d=C(l,e);return I(d,e,r)},"duration");export{R as default};
@@ -0,0 +1 @@
1
+ var M=Object.defineProperty;var y=(e,t)=>M(e,"name",{value:t,configurable:!0});var x=Object.defineProperty,c=y((e,t)=>x(e,"name",{value:t,configurable:!0}),"a");const d=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,N=/^KIBI/,G=/^MIBI/,P=/^GIBI/,Y=/^TEBI/,Z=/^PEBI/,A=/^EXBI/,K=/^ZEBI/,F=/^YIBI/,v=/^(.)IB$/,E={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},R=c((e,t)=>{const r=new Intl.NumberFormat(t).format(11111).replaceAll(new RegExp("\\p{Number}","gu"),""),o=new Intl.NumberFormat(t).format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),"");return Number.parseFloat(e.replaceAll(new RegExp(`\\${r}`,"g"),"").replace(new RegExp(`\\${o}`),"."))},"parseLocalizedNumber"),f=c(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase"),O=c((e,t)=>{const r={base:2,locale:"en-US",units:"metric",...t};if(typeof e!="string"||e.length===0)throw new TypeError("Value is not a string or is empty.");if(e.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const o=d.exec(e)?.groups;if(!o)return Number.NaN;const g=R(o.value,r.locale),s=(o.type??"Bytes").toUpperCase().replace(N,"KILO").replace(G,"MEGA").replace(P,"GIGA").replace(Y,"TERA").replace(Z,"PETA").replace(A,"EXA").replace(K,"ZETTA").replace(F,"YOTTA").replace(v,"$1B"),l=E[r.units].findIndex(a=>a.short.toUpperCase()===s||a.long.toUpperCase()===s);if(l===-1)return Number.NaN;const h=f(r.base);return g*h**l},"parseBytes"),$=c((e,t)=>{if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Bytesize is not a number.");const{base:r,decimals:o,locale:g,long:s,unit:l,units:h,...a}={base:2,decimals:0,locale:"en-US",long:!1,units:"metric",...t},p=f(r),I=Math.abs(e),u=t?.space??!0?" ":"",n=E[h],i=n.findIndex(b=>b.short===l);if(e===0){const b=i===-1?0:Math.min(i,n.length-1);return"0"+u+n[b][s?"long":"short"]}const m=i===-1?Math.min(Math.floor(Math.log(I)/Math.log(p)),n.length-1):i,T=n[m][s?"long":"short"],w=e/p**m,B=o<0?void 0:o;return new Intl.NumberFormat(g,{maximumFractionDigits:B,minimumFractionDigits:B,...a}).format(w)+u+T},"formatBytes");export{$ as formatBytes,O as parseBytes};
@@ -0,0 +1 @@
1
+ var U=Object.defineProperty;var v=(r,l)=>U(r,"name",{value:l,configurable:!0});import{durationLanguage as D,englishUnitMap as F}from"../language/en.js";import P from"../language/util/validate-duration-language.js";var T=Object.defineProperty,W=v((r,l)=>T(r,"name",{value:l,configurable:!0}),"h");const S={d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},m=/[-/\\^$*+?.()|[\]{}]/g,h=new WeakMap,_=/^PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?$/i,C=/^(?:(\d+):)?(?:(\d+):)?(\d+)$/,G=/^[+-]?\d+(?:\.\d+)?$/,H=/^[-+]/,z=W((r,l)=>{if(typeof r!="string"||r.length===0)return;const{defaultUnit:x="ms",language:c=D}=l??{};P(c);const g=c.decimal??".",I=c.groupSeparator??",",A=c.placeholderSeparator??"_",y=g.replaceAll(m,String.raw`\$&`),M=I.replaceAll(m,String.raw`\$&`),j=A.replaceAll(m,String.raw`\$&`),u=c.unitMap??F;let o=r.replaceAll(new RegExp(String.raw`(\d)[${j}${M}](\d)`,"g"),"$1$2");if(g!=="."&&(o=o.replace(y,".")),G.test(r)){const t=Number.parseFloat(o.trim());if(!Number.isNaN(t)){const e=u[x];if(e!==void 0)return t*S[e]}return}const n=_.exec(r);if(n&&(n[1]!==void 0||n[2]!==void 0||n[3]!==void 0)){const t=Number.parseInt(n[1]??"0",10),e=Number.parseInt(n[2]??"0",10),a=Number.parseInt(n[3]??"0",10);return t*36e5+e*6e4+a*1e3}const i=C.exec(r);if(i){let t=0,e=0;i[2]!==void 0?(t=Number.parseInt(i[1]??"0",10),e=Number.parseInt(i[2],10)):i[1]!==void 0&&(e=Number.parseInt(i[1],10));const a=Number.parseInt(i[3]??"0",10);return t*36e5+e*6e4+a*1e3}let s=h.get(u);if(s===void 0){const t=Object.keys(u).toSorted((e,a)=>a.length-e.length).map(e=>e.replaceAll(m,String.raw`\$&`)).join("|");s=new RegExp(String.raw`(-?\d*\.?\d+)\s*(${t})`,"gi"),h.set(u,s)}let f=0,p,d=!1,N=-1,b=0;for(s.lastIndex=0;(p=s.exec(o))!==null;){d||(N=p.index),d=!0;const t=p[1],e=p[2];if(!t||!e)continue;const a=t.trim(),L=a.startsWith("-")?-1:1,O=a.replace(H,""),$=Number.parseFloat(O),w=u[e.toLowerCase()];if(w===void 0)continue;const R=S[w];if(Number.isNaN($))return;f+=L*$*R,b=s.lastIndex}const k=o.slice(0,N).trim(),E=o.slice(b).trim();if(!(d&&(k.length>0||E.length>0))&&d)return f},"parseDuration");export{z as default};
@@ -0,0 +1,130 @@
1
+ interface BytesOptions {
2
+ /**
3
+ * The base to use for the conversion.
4
+ * @default 2
5
+ */
6
+ base?: 2 | 10;
7
+ /**
8
+ * The default locale to use for parsing/formatting the output.
9
+ * @default 'en-US'
10
+ */
11
+ locale?: IntlLocale;
12
+ /**
13
+ * The unit to use for the output.
14
+ * @default "metric"
15
+ */
16
+ units?: "iec_octet" | "iec" | "metric_octet" | "metric";
17
+ }
18
+ type IntlLocale = "af-NA" | "af" | "agq" | "ak" | "am" | "ar-AE" | "ar-BH" | "ar-DJ" | "ar-DZ" | "ar-EG" | "ar-EH" | "ar-ER" | "ar-IL" | "ar-IQ" | "ar-JO" | "ar-KM" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-MR" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SD" | "ar-SO" | "ar-SS" | "ar-SY" | "ar-TD" | "ar-TN" | "ar-YE" | "ar" | "as" | "asa" | "ast" | "az-Cyrl" | "az-Latn" | "az" | "bas" | "be-tarask" | "be" | "bem" | "bez" | "bg" | "bm" | "bn-IN" | "bn" | "bo-IN" | "bo" | "br" | "brx" | "bs-Cyrl" | "bs-Latn" | "bs" | "ca-AD" | "ca-ES-valencia" | "ca-FR" | "ca-IT" | "ca" | "ccp-IN" | "ccp" | "ce" | "ceb" | "cgg" | "chr" | "ckb-IR" | "ckb" | "cs" | "cy" | "da-GL" | "da" | "dav" | "de-AT" | "de-BE" | "de-CH" | "de-IT" | "de-LI" | "de-LU" | "de" | "dje" | "doi" | "dsb" | "dua" | "dyo" | "dz" | "ebu" | "ee-TG" | "ee" | "el-CY" | "el" | "en-001" | "en-150" | "en-AE" | "en-AG" | "en-AI" | "en-AS" | "en-AT" | "en-AU" | "en-BB" | "en-BE" | "en-BI" | "en-BM" | "en-BS" | "en-BW" | "en-BZ" | "en-CA" | "en-CC" | "en-CH" | "en-CK" | "en-CM" | "en-CX" | "en-CY" | "en-DE" | "en-DG" | "en-DK" | "en-DM" | "en-ER" | "en-FI" | "en-FJ" | "en-FK" | "en-FM" | "en-GB" | "en-GD" | "en-GG" | "en-GH" | "en-GI" | "en-GM" | "en-GU" | "en-GY" | "en-HK" | "en-IE" | "en-IL" | "en-IM" | "en-IN" | "en-IO" | "en-JE" | "en-JM" | "en-KE" | "en-KI" | "en-KN" | "en-KY" | "en-LC" | "en-LR" | "en-LS" | "en-MG" | "en-MH" | "en-MO" | "en-MP" | "en-MS" | "en-MT" | "en-MU" | "en-MW" | "en-MY" | "en-NA" | "en-NF" | "en-NG" | "en-NL" | "en-NR" | "en-NU" | "en-NZ" | "en-PG" | "en-PH" | "en-PK" | "en-PN" | "en-PR" | "en-PW" | "en-RW" | "en-SB" | "en-SC" | "en-SD" | "en-SE" | "en-SG" | "en-SH" | "en-SI" | "en-SL" | "en-SS" | "en-SX" | "en-SZ" | "en-TC" | "en-TK" | "en-TO" | "en-TT" | "en-TV" | "en-TZ" | "en-UG" | "en-UM" | "en-VC" | "en-VG" | "en-VI" | "en-VU" | "en-WS" | "en-ZA" | "en-ZM" | "en-ZW" | "en" | "eo" | "es-419" | "es-AR" | "es-BO" | "es-BR" | "es-BZ" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EA" | "es-EC" | "es-GQ" | "es-GT" | "es-HN" | "es-IC" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PH" | "es-PR" | "es-PY" | "es-SV" | "es-US" | "es-UY" | "es-VE" | "es" | "et" | "eu" | "ewo" | "fa-AF" | "fa" | "ff-Adlm-BF" | "ff-Adlm-CM" | "ff-Adlm-GH" | "ff-Adlm-GM" | "ff-Adlm-GW" | "ff-Adlm-LR" | "ff-Adlm-MR" | "ff-Adlm-NE" | "ff-Adlm-NG" | "ff-Adlm-SL" | "ff-Adlm-SN" | "ff-Adlm" | "ff-Latn-BF" | "ff-Latn-CM" | "ff-Latn-GH" | "ff-Latn-GM" | "ff-Latn-GN" | "ff-Latn-GW" | "ff-Latn-LR" | "ff-Latn-MR" | "ff-Latn-NE" | "ff-Latn-NG" | "ff-Latn-SL" | "ff-Latn" | "ff" | "fi" | "fil" | "fo-DK" | "fo" | "fr-BE" | "fr-BF" | "fr-BI" | "fr-BJ" | "fr-BL" | "fr-CA" | "fr-CD" | "fr-CF" | "fr-CG" | "fr-CH" | "fr-CI" | "fr-CM" | "fr-DJ" | "fr-DZ" | "fr-GA" | "fr-GF" | "fr-GN" | "fr-GP" | "fr-GQ" | "fr-HT" | "fr-KM" | "fr-LU" | "fr-MA" | "fr-MC" | "fr-MF" | "fr-MG" | "fr-ML" | "fr-MQ" | "fr-MR" | "fr-MU" | "fr-NC" | "fr-NE" | "fr-PF" | "fr-PM" | "fr-RE" | "fr-RW" | "fr-SC" | "fr-SN" | "fr-SY" | "fr-TD" | "fr-TG" | "fr-TN" | "fr-VU" | "fr-WF" | "fr-YT" | "fr" | "fur" | "fy" | "ga-GB" | "ga" | "gd" | "gl" | "gsw-FR" | "gsw-LI" | "gsw" | "gu" | "guz" | "gv" | "ha-GH" | "ha-NE" | "ha" | "haw" | "he" | "hi" | "hr-BA" | "hr" | "hsb" | "hu" | "hy" | "ia" | "id" | "ig" | "ii" | "is" | "it-CH" | "it-SM" | "it-VA" | "it" | "ja" | "jgo" | "jmc" | "jv" | "ka" | "kab" | "kam" | "kde" | "kea" | "kgp" | "khq" | "ki" | "kk" | "kkj" | "kl" | "kln" | "km" | "kn" | "ko-KP" | "ko" | "kok" | "ks-Arab" | "ks" | "ksb" | "ksf" | "ksh" | "ku" | "kw" | "ky" | "lag" | "lb" | "lg" | "lkt" | "ln-AO" | "ln-CF" | "ln-CG" | "ln" | "lo" | "lrc-IQ" | "lrc" | "lt" | "lu" | "luo" | "luy" | "lv" | "mai" | "mas-TZ" | "mas" | "mer" | "mfe" | "mg" | "mgh" | "mgo" | "mi" | "mk" | "ml" | "mn" | "mni-Beng" | "mni" | "mr" | "ms-BN" | "ms-ID" | "ms-SG" | "ms" | "mt" | "mua" | "my" | "mzn" | "naq" | "nb-SJ" | "nb" | "nd" | "nds-NL" | "nds" | "ne-IN" | "ne" | "nl-AW" | "nl-BE" | "nl-BQ" | "nl-CW" | "nl-SR" | "nl-SX" | "nl" | "nmg" | "nn" | "nnh" | "no" | "nus" | "nyn" | "om-KE" | "om" | "or" | "os-RU" | "os" | "pa-Arab" | "pa-Guru" | "pa" | "pcm" | "pl" | "ps-PK" | "ps" | "pt-AO" | "pt-CH" | "pt-CV" | "pt-GQ" | "pt-GW" | "pt-LU" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pt" | "qu-BO" | "qu-EC" | "qu" | "rm" | "rn" | "ro-MD" | "ro" | "rof" | "ru-BY" | "ru-KG" | "ru-KZ" | "ru-MD" | "ru-UA" | "ru" | "rw" | "rwk" | "sa" | "sah" | "saq" | "sat-Olck" | "sat" | "sbp" | "sc" | "sd-Arab" | "sd-Deva" | "sd" | "se-FI" | "se-SE" | "se" | "seh" | "ses" | "sg" | "shi-Latn" | "shi-Tfng" | "shi" | "si" | "sk" | "sl" | "smn" | "sn" | "so-DJ" | "so-ET" | "so-KE" | "so" | "sq-MK" | "sq-XK" | "sq" | "sr-Cyrl-BA" | "sr-Cyrl-ME" | "sr-Cyrl-XK" | "sr-Cyrl" | "sr-Latn-BA" | "sr-Latn-ME" | "sr-Latn-XK" | "sr-Latn" | "sr" | "su-Latn" | "su" | "sv-AX" | "sv-FI" | "sv" | "sw-CD" | "sw-KE" | "sw-UG" | "sw" | "ta-LK" | "ta-MY" | "ta-SG" | "ta" | "te" | "teo-KE" | "teo" | "tg" | "th" | "ti-ER" | "ti" | "tk" | "to" | "tr-CY" | "tr" | "tt" | "twq" | "tzm" | "ug" | "uk" | "und" | "ur-IN" | "ur" | "uz-Arab" | "uz-Cyrl" | "uz-Latn" | "uz" | "vai-Latn" | "vai-Vaii" | "vai" | "vi" | "vun" | "wae" | "wo" | "xh" | "xog" | "yav" | "yi" | "yo-BJ" | "yo" | "yrl-CO" | "yrl-VE" | "yrl" | "yue-Hans" | "yue-Hant" | "yue" | "zgh" | "zh-Hans-HK" | "zh-Hans-MO" | "zh-Hans-SG" | "zh-Hans" | "zh-Hant-HK" | "zh-Hant-MO" | "zh-Hant" | "zh" | "zu";
19
+ type DurationUnit = string | ((unitCount: number) => string);
20
+ type DurationUnitName = "d" | "h" | "m" | "mo" | "ms" | "s" | "w" | "y";
21
+ interface DurationUnitMeasures {
22
+ d: number;
23
+ h: number;
24
+ m: number;
25
+ mo: number;
26
+ ms: number;
27
+ s: number;
28
+ w: number;
29
+ y: number;
30
+ }
31
+ type DurationDigitReplacements = [string, string, string, string, string, string, string, string, string, string];
32
+ interface DurationLanguage {
33
+ _digitReplacements?: DurationDigitReplacements;
34
+ _hideCountIf2?: boolean;
35
+ _numberFirst?: boolean;
36
+ d: DurationUnit;
37
+ /**
38
+ * Optional character used as the decimal separator for number parsing.
39
+ * Defaults to ".".
40
+ */
41
+ decimal?: string;
42
+ delimiter?: string;
43
+ future?: string;
44
+ /**
45
+ * Optional character used as the grouping separator (e.g., thousands) for number parsing.
46
+ * Defaults to ",".
47
+ */
48
+ groupSeparator?: string;
49
+ h: DurationUnit;
50
+ m: DurationUnit;
51
+ mo: DurationUnit;
52
+ ms: DurationUnit;
53
+ past?: string;
54
+ /**
55
+ * Optional placeholder character within numbers used during parsing.
56
+ * Defaults to "_".
57
+ */
58
+ placeholderSeparator?: string;
59
+ s: DurationUnit;
60
+ /**
61
+ * Optional mapping of localized unit names/aliases (e.g., "saniye", "sec")
62
+ * to the standard unit keys (e.g., "s"). Used for parsing.
63
+ */
64
+ unitMap?: Record<string, keyof DurationUnitMeasures>;
65
+ w: DurationUnit;
66
+ y: DurationUnit;
67
+ }
68
+ interface DurationOptions {
69
+ conjunction?: string;
70
+ decimal?: string;
71
+ delimiter?: string;
72
+ digitReplacements?: DurationDigitReplacements;
73
+ fallbacks?: string[];
74
+ language?: DurationLanguage;
75
+ largest?: number;
76
+ maxDecimalPoints?: number;
77
+ round?: boolean;
78
+ serialComma?: boolean;
79
+ spacer?: string;
80
+ timeAdverb?: boolean;
81
+ unitMeasures?: DurationUnitMeasures;
82
+ units?: DurationUnitName[];
83
+ }
84
+ interface DurationPiece {
85
+ unitCount: number;
86
+ unitName: DurationUnitName;
87
+ }
88
+ type ParseByteOptions = BytesOptions;
89
+ interface FormateByteOptions<ByteSize> extends BytesOptions, Omit<Intl.NumberFormatOptions, "currency" | "currencyDisplay" | "currencySign" | "style" | "unit" | "unitDisplay"> {
90
+ /**
91
+ * Specify the number of decimals to include in the output.
92
+ *
93
+ * **Note**: If `minFractionDigits` or `maxFractionDigits` are set, this option will be ignored.
94
+ * @default 0
95
+ */
96
+ decimals?: number;
97
+ /**
98
+ * Whether to use the long form of the unit.
99
+ * @default false
100
+ */
101
+ long?: boolean;
102
+ /**
103
+ * Whether to include a space between the number and the unit.
104
+ * @default true
105
+ */
106
+ space?: boolean;
107
+ /**
108
+ * Specify the unit to use for the output.
109
+ *
110
+ * Uses the closest unit to the given value per default.
111
+ */
112
+ unit?: ByteSize;
113
+ }
114
+ /**
115
+ * Options for the parseDuration function.
116
+ */
117
+ interface ParseDurationOptions {
118
+ /**
119
+ * The default unit to use if the input string is just a number.
120
+ * Uses standard unit keys (y, mo, w, d, h, m, s, ms).
121
+ * Defaults to 'ms'.
122
+ */
123
+ defaultUnit?: keyof DurationUnitMeasures;
124
+ /**
125
+ * The language object containing localized unit names for parsing.
126
+ * Defaults to English.
127
+ */
128
+ language?: DurationLanguage;
129
+ }
130
+ export { DurationLanguage as D, FormateByteOptions as F, IntlLocale as I, ParseByteOptions as P, DurationUnitMeasures as a, DurationUnit as b, DurationOptions as c, ParseDurationOptions as d, DurationDigitReplacements as e, DurationPiece as f, DurationUnitName as g };