javascript-time-ago 2.3.13 → 2.5.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.
Files changed (1394) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +1 -1
  3. package/bin/create-commonjs-package-json.js +11 -0
  4. package/bin/generate-load-all-locales.js +38 -6
  5. package/bin/generate-locale-messages.js +106 -21
  6. package/bundle/javascript-time-ago.js +1 -1
  7. package/bundle/javascript-time-ago.js.map +1 -1
  8. package/bundle/javascript-time-ago.min.js +1 -1
  9. package/bundle/javascript-time-ago.min.js.map +1 -1
  10. package/cache/index.cjs +2 -0
  11. package/cache/index.cjs.js +7 -0
  12. package/cache/index.js +1 -1
  13. package/cache/package.json +9 -3
  14. package/commonjs/LocaleDataStore.js +1 -1
  15. package/commonjs/LocaleDataStore.js.map +1 -1
  16. package/commonjs/PropTypes.js +26 -18
  17. package/commonjs/PropTypes.js.map +1 -1
  18. package/commonjs/TimeAgo.js +41 -48
  19. package/commonjs/TimeAgo.js.map +1 -1
  20. package/commonjs/TimeAgo.test.js +70 -70
  21. package/commonjs/TimeAgo.test.js.map +1 -1
  22. package/commonjs/cache.js +10 -14
  23. package/commonjs/cache.js.map +1 -1
  24. package/commonjs/cache.test.js +3 -3
  25. package/commonjs/cache.test.js.map +1 -1
  26. package/commonjs/isStyleObject.js +2 -2
  27. package/commonjs/isStyleObject.js.map +1 -1
  28. package/commonjs/isStyleObject.test.js +11 -11
  29. package/commonjs/isStyleObject.test.js.map +1 -1
  30. package/commonjs/locale.js +11 -16
  31. package/commonjs/locale.js.map +1 -1
  32. package/commonjs/locale.test.js +8 -4
  33. package/commonjs/locale.test.js.map +1 -1
  34. package/commonjs/package.json +5 -0
  35. package/commonjs/round.js +1 -1
  36. package/commonjs/round.js.map +1 -1
  37. package/commonjs/steps/approximate.js +3 -3
  38. package/commonjs/steps/approximate.js.map +1 -1
  39. package/commonjs/steps/approximate.test.js +5 -5
  40. package/commonjs/steps/approximate.test.js.map +1 -1
  41. package/commonjs/steps/getStep.js +10 -8
  42. package/commonjs/steps/getStep.js.map +1 -1
  43. package/commonjs/steps/getStep.test.js +16 -16
  44. package/commonjs/steps/getStep.test.js.map +1 -1
  45. package/commonjs/steps/getStepDenominator.js +2 -2
  46. package/commonjs/steps/getStepDenominator.js.map +1 -1
  47. package/commonjs/steps/getStepDenominator.test.js +4 -4
  48. package/commonjs/steps/getStepDenominator.test.js.map +1 -1
  49. package/commonjs/steps/getStepMinTime.js +5 -5
  50. package/commonjs/steps/getStepMinTime.js.map +1 -1
  51. package/commonjs/steps/getStepMinTime.test.js +4 -4
  52. package/commonjs/steps/getStepMinTime.test.js.map +1 -1
  53. package/commonjs/steps/getTimeToNextUpdate.js +8 -8
  54. package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
  55. package/commonjs/steps/getTimeToNextUpdate.test.js +18 -14
  56. package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
  57. package/commonjs/steps/getTimeToNextUpdateForUnit.js +3 -3
  58. package/commonjs/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  59. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +8 -8
  60. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  61. package/commonjs/steps/helpers.js.map +1 -1
  62. package/commonjs/steps/helpers.test.js +1 -1
  63. package/commonjs/steps/helpers.test.js.map +1 -1
  64. package/commonjs/steps/index.js +24 -24
  65. package/commonjs/steps/index.js.map +1 -1
  66. package/commonjs/steps/renameLegacyProperties.js +8 -8
  67. package/commonjs/steps/renameLegacyProperties.js.map +1 -1
  68. package/commonjs/steps/renameLegacyProperties.test.js +6 -6
  69. package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
  70. package/commonjs/steps/round.js +2 -2
  71. package/commonjs/steps/round.js.map +1 -1
  72. package/commonjs/steps/round.test.js +6 -6
  73. package/commonjs/steps/round.test.js.map +1 -1
  74. package/commonjs/steps/units.js +2 -1
  75. package/commonjs/steps/units.js.map +1 -1
  76. package/commonjs/style/approximate.js +5 -5
  77. package/commonjs/style/approximate.js.map +1 -1
  78. package/commonjs/style/approximateTime.js +5 -5
  79. package/commonjs/style/approximateTime.js.map +1 -1
  80. package/commonjs/style/approximateTime.test.js +13 -18
  81. package/commonjs/style/approximateTime.test.js.map +1 -1
  82. package/commonjs/style/getStyleByName.js +29 -29
  83. package/commonjs/style/getStyleByName.js.map +1 -1
  84. package/commonjs/style/mini.js +2 -2
  85. package/commonjs/style/mini.js.map +1 -1
  86. package/commonjs/style/mini.test.js +62 -60
  87. package/commonjs/style/mini.test.js.map +1 -1
  88. package/commonjs/style/miniMinute.js +9 -7
  89. package/commonjs/style/miniMinute.js.map +1 -1
  90. package/commonjs/style/miniMinute.test.js +30 -28
  91. package/commonjs/style/miniMinute.test.js.map +1 -1
  92. package/commonjs/style/miniMinuteNow.js +9 -7
  93. package/commonjs/style/miniMinuteNow.js.map +1 -1
  94. package/commonjs/style/miniMinuteNow.test.js +30 -28
  95. package/commonjs/style/miniMinuteNow.test.js.map +1 -1
  96. package/commonjs/style/miniNow.js +9 -7
  97. package/commonjs/style/miniNow.js.map +1 -1
  98. package/commonjs/style/miniNow.test.js +30 -28
  99. package/commonjs/style/miniNow.test.js.map +1 -1
  100. package/commonjs/style/renameLegacyProperties.js +7 -5
  101. package/commonjs/style/renameLegacyProperties.js.map +1 -1
  102. package/commonjs/style/renameLegacyProperties.test.js +5 -5
  103. package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
  104. package/commonjs/style/round.js +5 -5
  105. package/commonjs/style/round.js.map +1 -1
  106. package/commonjs/style/round.test.js +66 -60
  107. package/commonjs/style/round.test.js.map +1 -1
  108. package/commonjs/style/roundMinute.js +9 -7
  109. package/commonjs/style/roundMinute.js.map +1 -1
  110. package/commonjs/style/roundMinute.test.js +33 -31
  111. package/commonjs/style/roundMinute.test.js.map +1 -1
  112. package/commonjs/style/twitter.js +18 -18
  113. package/commonjs/style/twitter.js.map +1 -1
  114. package/commonjs/style/twitter.test.js +76 -74
  115. package/commonjs/style/twitter.test.js.map +1 -1
  116. package/commonjs/style/twitterFirstMinute.js +11 -9
  117. package/commonjs/style/twitterFirstMinute.js.map +1 -1
  118. package/commonjs/style/twitterFirstMinute.test.js +35 -33
  119. package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
  120. package/commonjs/style/twitterMinute.js +9 -7
  121. package/commonjs/style/twitterMinute.js.map +1 -1
  122. package/commonjs/style/twitterMinute.test.js +36 -34
  123. package/commonjs/style/twitterMinute.test.js.map +1 -1
  124. package/commonjs/style/twitterMinuteNow.js +9 -7
  125. package/commonjs/style/twitterMinuteNow.js.map +1 -1
  126. package/commonjs/style/twitterMinuteNow.test.js +36 -34
  127. package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
  128. package/commonjs/style/twitterNow.js +9 -7
  129. package/commonjs/style/twitterNow.js.map +1 -1
  130. package/commonjs/style/twitterNow.test.js +35 -33
  131. package/commonjs/style/twitterNow.test.js.map +1 -1
  132. package/gradation/index.cjs +2 -0
  133. package/gradation/index.cjs.js +7 -0
  134. package/gradation/index.js +1 -1
  135. package/gradation/package.json +9 -3
  136. package/index.cjs +9 -0
  137. package/index.cjs.js +14 -0
  138. package/index.d.ts +6 -0
  139. package/index.js +2 -2
  140. package/load-all-locales/index.cjs +281 -0
  141. package/load-all-locales/index.cjs.js +286 -0
  142. package/load-all-locales/index.js +563 -0
  143. package/load-all-locales/package.json +18 -0
  144. package/locale/af/index.cjs +3 -0
  145. package/locale/af/index.cjs.js +3 -0
  146. package/locale/af/index.js +1 -3
  147. package/locale/af/package.json +14 -0
  148. package/locale/am/index.cjs +3 -0
  149. package/locale/am/index.cjs.js +3 -0
  150. package/locale/am/index.js +1 -3
  151. package/locale/am/package.json +14 -0
  152. package/locale/ar/index.cjs +3 -0
  153. package/locale/ar/index.cjs.js +3 -0
  154. package/locale/ar/index.js +1 -3
  155. package/locale/ar/package.json +14 -0
  156. package/locale/ar-AE/index.cjs +3 -0
  157. package/locale/ar-AE/index.cjs.js +3 -0
  158. package/locale/ar-AE/index.js +1 -3
  159. package/locale/ar-AE/package.json +14 -0
  160. package/locale/as/index.cjs +3 -0
  161. package/locale/as/index.cjs.js +3 -0
  162. package/locale/as/index.js +1 -3
  163. package/locale/as/package.json +14 -0
  164. package/locale/ast/index.cjs +3 -0
  165. package/locale/ast/index.cjs.js +3 -0
  166. package/locale/ast/index.js +1 -3
  167. package/locale/ast/package.json +14 -0
  168. package/locale/az/index.cjs +3 -0
  169. package/locale/az/index.cjs.js +3 -0
  170. package/locale/az/index.js +1 -3
  171. package/locale/az/package.json +14 -0
  172. package/locale/be/index.cjs +3 -0
  173. package/locale/be/index.cjs.js +3 -0
  174. package/locale/be/index.js +1 -3
  175. package/locale/be/package.json +14 -0
  176. package/locale/bg/index.cjs +3 -0
  177. package/locale/bg/index.cjs.js +3 -0
  178. package/locale/bg/index.js +1 -3
  179. package/locale/bg/package.json +14 -0
  180. package/locale/bn/index.cjs +3 -0
  181. package/locale/bn/index.cjs.js +3 -0
  182. package/locale/bn/index.js +1 -3
  183. package/locale/bn/package.json +14 -0
  184. package/locale/br/index.cjs +3 -0
  185. package/locale/br/index.cjs.js +3 -0
  186. package/locale/br/index.js +1 -3
  187. package/locale/br/package.json +14 -0
  188. package/locale/brx/index.cjs +3 -0
  189. package/locale/brx/index.cjs.js +3 -0
  190. package/locale/brx/index.js +1 -0
  191. package/locale/brx/package.json +14 -0
  192. package/locale/brx.json +159 -0
  193. package/locale/bs/index.cjs +3 -0
  194. package/locale/bs/index.cjs.js +3 -0
  195. package/locale/bs/index.js +1 -3
  196. package/locale/bs/package.json +14 -0
  197. package/locale/bs-Cyrl/index.cjs +3 -0
  198. package/locale/bs-Cyrl/index.cjs.js +3 -0
  199. package/locale/bs-Cyrl/index.js +1 -3
  200. package/locale/bs-Cyrl/package.json +14 -0
  201. package/locale/ca/index.cjs +3 -0
  202. package/locale/ca/index.cjs.js +3 -0
  203. package/locale/ca/index.js +1 -3
  204. package/locale/ca/package.json +14 -0
  205. package/locale/ccp/index.cjs +3 -0
  206. package/locale/ccp/index.cjs.js +3 -0
  207. package/locale/ccp/index.js +1 -3
  208. package/locale/ccp/package.json +14 -0
  209. package/locale/ce/index.cjs +3 -0
  210. package/locale/ce/index.cjs.js +3 -0
  211. package/locale/ce/index.js +1 -3
  212. package/locale/ce/package.json +14 -0
  213. package/locale/ceb/index.cjs +3 -0
  214. package/locale/ceb/index.cjs.js +3 -0
  215. package/locale/ceb/index.js +1 -3
  216. package/locale/ceb/package.json +14 -0
  217. package/locale/chr/index.cjs +3 -0
  218. package/locale/chr/index.cjs.js +3 -0
  219. package/locale/chr/index.js +1 -3
  220. package/locale/chr/package.json +14 -0
  221. package/locale/cs/index.cjs +3 -0
  222. package/locale/cs/index.cjs.js +3 -0
  223. package/locale/cs/index.js +1 -3
  224. package/locale/cs/package.json +14 -0
  225. package/locale/cy/index.cjs +3 -0
  226. package/locale/cy/index.cjs.js +3 -0
  227. package/locale/cy/index.js +1 -3
  228. package/locale/cy/package.json +14 -0
  229. package/locale/da/index.cjs +3 -0
  230. package/locale/da/index.cjs.js +3 -0
  231. package/locale/da/index.js +1 -3
  232. package/locale/da/package.json +14 -0
  233. package/locale/de/index.cjs +3 -0
  234. package/locale/de/index.cjs.js +3 -0
  235. package/locale/de/index.js +1 -3
  236. package/locale/de/package.json +14 -0
  237. package/locale/dsb/index.cjs +3 -0
  238. package/locale/dsb/index.cjs.js +3 -0
  239. package/locale/dsb/index.js +1 -3
  240. package/locale/dsb/package.json +14 -0
  241. package/locale/dz/index.cjs +3 -0
  242. package/locale/dz/index.cjs.js +3 -0
  243. package/locale/dz/index.js +1 -3
  244. package/locale/dz/package.json +14 -0
  245. package/locale/ee/index.cjs +3 -0
  246. package/locale/ee/index.cjs.js +3 -0
  247. package/locale/ee/index.js +1 -3
  248. package/locale/ee/package.json +14 -0
  249. package/locale/el/index.cjs +3 -0
  250. package/locale/el/index.cjs.js +3 -0
  251. package/locale/el/index.js +1 -3
  252. package/locale/el/package.json +14 -0
  253. package/locale/en/index.cjs +3 -0
  254. package/locale/en/index.cjs.js +3 -0
  255. package/locale/en/index.js +1 -3
  256. package/locale/en/package.json +14 -0
  257. package/locale/en-001/index.cjs +3 -0
  258. package/locale/en-001/index.cjs.js +3 -0
  259. package/locale/en-001/index.js +1 -3
  260. package/locale/en-001/package.json +14 -0
  261. package/locale/en-150/index.cjs +3 -0
  262. package/locale/en-150/index.cjs.js +3 -0
  263. package/locale/en-150/index.js +1 -3
  264. package/locale/en-150/package.json +14 -0
  265. package/locale/en-AG/index.cjs +3 -0
  266. package/locale/en-AG/index.cjs.js +3 -0
  267. package/locale/en-AG/index.js +1 -3
  268. package/locale/en-AG/package.json +14 -0
  269. package/locale/en-AI/index.cjs +3 -0
  270. package/locale/en-AI/index.cjs.js +3 -0
  271. package/locale/en-AI/index.js +1 -3
  272. package/locale/en-AI/package.json +14 -0
  273. package/locale/en-AT/index.cjs +3 -0
  274. package/locale/en-AT/index.cjs.js +3 -0
  275. package/locale/en-AT/index.js +1 -3
  276. package/locale/en-AT/package.json +14 -0
  277. package/locale/en-AU/index.cjs +3 -0
  278. package/locale/en-AU/index.cjs.js +3 -0
  279. package/locale/en-AU/index.js +1 -3
  280. package/locale/en-AU/package.json +14 -0
  281. package/locale/en-BB/index.cjs +3 -0
  282. package/locale/en-BB/index.cjs.js +3 -0
  283. package/locale/en-BB/index.js +1 -3
  284. package/locale/en-BB/package.json +14 -0
  285. package/locale/en-BE/index.cjs +3 -0
  286. package/locale/en-BE/index.cjs.js +3 -0
  287. package/locale/en-BE/index.js +1 -3
  288. package/locale/en-BE/package.json +14 -0
  289. package/locale/en-BM/index.cjs +3 -0
  290. package/locale/en-BM/index.cjs.js +3 -0
  291. package/locale/en-BM/index.js +1 -3
  292. package/locale/en-BM/package.json +14 -0
  293. package/locale/en-BS/index.cjs +3 -0
  294. package/locale/en-BS/index.cjs.js +3 -0
  295. package/locale/en-BS/index.js +1 -3
  296. package/locale/en-BS/package.json +14 -0
  297. package/locale/en-BW/index.cjs +3 -0
  298. package/locale/en-BW/index.cjs.js +3 -0
  299. package/locale/en-BW/index.js +1 -3
  300. package/locale/en-BW/package.json +14 -0
  301. package/locale/en-BZ/index.cjs +3 -0
  302. package/locale/en-BZ/index.cjs.js +3 -0
  303. package/locale/en-BZ/index.js +1 -3
  304. package/locale/en-BZ/package.json +14 -0
  305. package/locale/en-CA/index.cjs +3 -0
  306. package/locale/en-CA/index.cjs.js +3 -0
  307. package/locale/en-CA/index.js +1 -3
  308. package/locale/en-CA/package.json +14 -0
  309. package/locale/en-CC/index.cjs +3 -0
  310. package/locale/en-CC/index.cjs.js +3 -0
  311. package/locale/en-CC/index.js +1 -3
  312. package/locale/en-CC/package.json +14 -0
  313. package/locale/en-CH/index.cjs +3 -0
  314. package/locale/en-CH/index.cjs.js +3 -0
  315. package/locale/en-CH/index.js +1 -3
  316. package/locale/en-CH/package.json +14 -0
  317. package/locale/en-CK/index.cjs +3 -0
  318. package/locale/en-CK/index.cjs.js +3 -0
  319. package/locale/en-CK/index.js +1 -3
  320. package/locale/en-CK/package.json +14 -0
  321. package/locale/en-CM/index.cjs +3 -0
  322. package/locale/en-CM/index.cjs.js +3 -0
  323. package/locale/en-CM/index.js +1 -3
  324. package/locale/en-CM/package.json +14 -0
  325. package/locale/en-CX/index.cjs +3 -0
  326. package/locale/en-CX/index.cjs.js +3 -0
  327. package/locale/en-CX/index.js +1 -3
  328. package/locale/en-CX/package.json +14 -0
  329. package/locale/en-CY/index.cjs +3 -0
  330. package/locale/en-CY/index.cjs.js +3 -0
  331. package/locale/en-CY/index.js +1 -3
  332. package/locale/en-CY/package.json +14 -0
  333. package/locale/en-DE/index.cjs +3 -0
  334. package/locale/en-DE/index.cjs.js +3 -0
  335. package/locale/en-DE/index.js +1 -3
  336. package/locale/en-DE/package.json +14 -0
  337. package/locale/en-DG/index.cjs +3 -0
  338. package/locale/en-DG/index.cjs.js +3 -0
  339. package/locale/en-DG/index.js +1 -3
  340. package/locale/en-DG/package.json +14 -0
  341. package/locale/en-DK/index.cjs +3 -0
  342. package/locale/en-DK/index.cjs.js +3 -0
  343. package/locale/en-DK/index.js +1 -3
  344. package/locale/en-DK/package.json +14 -0
  345. package/locale/en-DM/index.cjs +3 -0
  346. package/locale/en-DM/index.cjs.js +3 -0
  347. package/locale/en-DM/index.js +1 -3
  348. package/locale/en-DM/package.json +14 -0
  349. package/locale/en-ER/index.cjs +3 -0
  350. package/locale/en-ER/index.cjs.js +3 -0
  351. package/locale/en-ER/index.js +1 -3
  352. package/locale/en-ER/package.json +14 -0
  353. package/locale/en-FI/index.cjs +3 -0
  354. package/locale/en-FI/index.cjs.js +3 -0
  355. package/locale/en-FI/index.js +1 -3
  356. package/locale/en-FI/package.json +14 -0
  357. package/locale/en-FJ/index.cjs +3 -0
  358. package/locale/en-FJ/index.cjs.js +3 -0
  359. package/locale/en-FJ/index.js +1 -3
  360. package/locale/en-FJ/package.json +14 -0
  361. package/locale/en-FK/index.cjs +3 -0
  362. package/locale/en-FK/index.cjs.js +3 -0
  363. package/locale/en-FK/index.js +1 -3
  364. package/locale/en-FK/package.json +14 -0
  365. package/locale/en-FM/index.cjs +3 -0
  366. package/locale/en-FM/index.cjs.js +3 -0
  367. package/locale/en-FM/index.js +1 -3
  368. package/locale/en-FM/package.json +14 -0
  369. package/locale/en-GB/index.cjs +3 -0
  370. package/locale/en-GB/index.cjs.js +3 -0
  371. package/locale/en-GB/index.js +1 -3
  372. package/locale/en-GB/package.json +14 -0
  373. package/locale/en-GD/index.cjs +3 -0
  374. package/locale/en-GD/index.cjs.js +3 -0
  375. package/locale/en-GD/index.js +1 -3
  376. package/locale/en-GD/package.json +14 -0
  377. package/locale/en-GG/index.cjs +3 -0
  378. package/locale/en-GG/index.cjs.js +3 -0
  379. package/locale/en-GG/index.js +1 -3
  380. package/locale/en-GG/package.json +14 -0
  381. package/locale/en-GH/index.cjs +3 -0
  382. package/locale/en-GH/index.cjs.js +3 -0
  383. package/locale/en-GH/index.js +1 -3
  384. package/locale/en-GH/package.json +14 -0
  385. package/locale/en-GI/index.cjs +3 -0
  386. package/locale/en-GI/index.cjs.js +3 -0
  387. package/locale/en-GI/index.js +1 -3
  388. package/locale/en-GI/package.json +14 -0
  389. package/locale/en-GM/index.cjs +3 -0
  390. package/locale/en-GM/index.cjs.js +3 -0
  391. package/locale/en-GM/index.js +1 -3
  392. package/locale/en-GM/package.json +14 -0
  393. package/locale/en-GY/index.cjs +3 -0
  394. package/locale/en-GY/index.cjs.js +3 -0
  395. package/locale/en-GY/index.js +1 -3
  396. package/locale/en-GY/package.json +14 -0
  397. package/locale/en-HK/index.cjs +3 -0
  398. package/locale/en-HK/index.cjs.js +3 -0
  399. package/locale/en-HK/index.js +1 -3
  400. package/locale/en-HK/package.json +14 -0
  401. package/locale/en-IE/index.cjs +3 -0
  402. package/locale/en-IE/index.cjs.js +3 -0
  403. package/locale/en-IE/index.js +1 -3
  404. package/locale/en-IE/package.json +14 -0
  405. package/locale/en-IL/index.cjs +3 -0
  406. package/locale/en-IL/index.cjs.js +3 -0
  407. package/locale/en-IL/index.js +1 -3
  408. package/locale/en-IL/package.json +14 -0
  409. package/locale/en-IM/index.cjs +3 -0
  410. package/locale/en-IM/index.cjs.js +3 -0
  411. package/locale/en-IM/index.js +1 -3
  412. package/locale/en-IM/package.json +14 -0
  413. package/locale/en-IN/index.cjs +3 -0
  414. package/locale/en-IN/index.cjs.js +3 -0
  415. package/locale/en-IN/index.js +1 -3
  416. package/locale/en-IN/package.json +14 -0
  417. package/locale/en-IO/index.cjs +3 -0
  418. package/locale/en-IO/index.cjs.js +3 -0
  419. package/locale/en-IO/index.js +1 -3
  420. package/locale/en-IO/package.json +14 -0
  421. package/locale/en-JE/index.cjs +3 -0
  422. package/locale/en-JE/index.cjs.js +3 -0
  423. package/locale/en-JE/index.js +1 -3
  424. package/locale/en-JE/package.json +14 -0
  425. package/locale/en-JM/index.cjs +3 -0
  426. package/locale/en-JM/index.cjs.js +3 -0
  427. package/locale/en-JM/index.js +1 -3
  428. package/locale/en-JM/package.json +14 -0
  429. package/locale/en-KE/index.cjs +3 -0
  430. package/locale/en-KE/index.cjs.js +3 -0
  431. package/locale/en-KE/index.js +1 -3
  432. package/locale/en-KE/package.json +14 -0
  433. package/locale/en-KI/index.cjs +3 -0
  434. package/locale/en-KI/index.cjs.js +3 -0
  435. package/locale/en-KI/index.js +1 -3
  436. package/locale/en-KI/package.json +14 -0
  437. package/locale/en-KN/index.cjs +3 -0
  438. package/locale/en-KN/index.cjs.js +3 -0
  439. package/locale/en-KN/index.js +1 -3
  440. package/locale/en-KN/package.json +14 -0
  441. package/locale/en-KY/index.cjs +3 -0
  442. package/locale/en-KY/index.cjs.js +3 -0
  443. package/locale/en-KY/index.js +1 -3
  444. package/locale/en-KY/package.json +14 -0
  445. package/locale/en-LC/index.cjs +3 -0
  446. package/locale/en-LC/index.cjs.js +3 -0
  447. package/locale/en-LC/index.js +1 -3
  448. package/locale/en-LC/package.json +14 -0
  449. package/locale/en-LR/index.cjs +3 -0
  450. package/locale/en-LR/index.cjs.js +3 -0
  451. package/locale/en-LR/index.js +1 -3
  452. package/locale/en-LR/package.json +14 -0
  453. package/locale/en-LS/index.cjs +3 -0
  454. package/locale/en-LS/index.cjs.js +3 -0
  455. package/locale/en-LS/index.js +1 -3
  456. package/locale/en-LS/package.json +14 -0
  457. package/locale/en-MG/index.cjs +3 -0
  458. package/locale/en-MG/index.cjs.js +3 -0
  459. package/locale/en-MG/index.js +1 -3
  460. package/locale/en-MG/package.json +14 -0
  461. package/locale/en-MO/index.cjs +3 -0
  462. package/locale/en-MO/index.cjs.js +3 -0
  463. package/locale/en-MO/index.js +1 -3
  464. package/locale/en-MO/package.json +14 -0
  465. package/locale/en-MS/index.cjs +3 -0
  466. package/locale/en-MS/index.cjs.js +3 -0
  467. package/locale/en-MS/index.js +1 -3
  468. package/locale/en-MS/package.json +14 -0
  469. package/locale/en-MT/index.cjs +3 -0
  470. package/locale/en-MT/index.cjs.js +3 -0
  471. package/locale/en-MT/index.js +1 -3
  472. package/locale/en-MT/package.json +14 -0
  473. package/locale/en-MU/index.cjs +3 -0
  474. package/locale/en-MU/index.cjs.js +3 -0
  475. package/locale/en-MU/index.js +1 -3
  476. package/locale/en-MU/package.json +14 -0
  477. package/locale/en-MV/index.cjs +3 -0
  478. package/locale/en-MV/index.cjs.js +3 -0
  479. package/locale/en-MV/index.js +1 -0
  480. package/locale/en-MV/package.json +14 -0
  481. package/locale/en-MV.json +219 -0
  482. package/locale/en-MW/index.cjs +3 -0
  483. package/locale/en-MW/index.cjs.js +3 -0
  484. package/locale/en-MW/index.js +1 -3
  485. package/locale/en-MW/package.json +14 -0
  486. package/locale/en-MY/index.cjs +3 -0
  487. package/locale/en-MY/index.cjs.js +3 -0
  488. package/locale/en-MY/index.js +1 -3
  489. package/locale/en-MY/package.json +14 -0
  490. package/locale/en-NA/index.cjs +3 -0
  491. package/locale/en-NA/index.cjs.js +3 -0
  492. package/locale/en-NA/index.js +1 -3
  493. package/locale/en-NA/package.json +14 -0
  494. package/locale/en-NF/index.cjs +3 -0
  495. package/locale/en-NF/index.cjs.js +3 -0
  496. package/locale/en-NF/index.js +1 -3
  497. package/locale/en-NF/package.json +14 -0
  498. package/locale/en-NG/index.cjs +3 -0
  499. package/locale/en-NG/index.cjs.js +3 -0
  500. package/locale/en-NG/index.js +1 -3
  501. package/locale/en-NG/package.json +14 -0
  502. package/locale/en-NL/index.cjs +3 -0
  503. package/locale/en-NL/index.cjs.js +3 -0
  504. package/locale/en-NL/index.js +1 -3
  505. package/locale/en-NL/package.json +14 -0
  506. package/locale/en-NR/index.cjs +3 -0
  507. package/locale/en-NR/index.cjs.js +3 -0
  508. package/locale/en-NR/index.js +1 -3
  509. package/locale/en-NR/package.json +14 -0
  510. package/locale/en-NU/index.cjs +3 -0
  511. package/locale/en-NU/index.cjs.js +3 -0
  512. package/locale/en-NU/index.js +1 -3
  513. package/locale/en-NU/package.json +14 -0
  514. package/locale/en-NZ/index.cjs +3 -0
  515. package/locale/en-NZ/index.cjs.js +3 -0
  516. package/locale/en-NZ/index.js +1 -3
  517. package/locale/en-NZ/package.json +14 -0
  518. package/locale/en-PG/index.cjs +3 -0
  519. package/locale/en-PG/index.cjs.js +3 -0
  520. package/locale/en-PG/index.js +1 -3
  521. package/locale/en-PG/package.json +14 -0
  522. package/locale/en-PK/index.cjs +3 -0
  523. package/locale/en-PK/index.cjs.js +3 -0
  524. package/locale/en-PK/index.js +1 -3
  525. package/locale/en-PK/package.json +14 -0
  526. package/locale/en-PN/index.cjs +3 -0
  527. package/locale/en-PN/index.cjs.js +3 -0
  528. package/locale/en-PN/index.js +1 -3
  529. package/locale/en-PN/package.json +14 -0
  530. package/locale/en-PW/index.cjs +3 -0
  531. package/locale/en-PW/index.cjs.js +3 -0
  532. package/locale/en-PW/index.js +1 -3
  533. package/locale/en-PW/package.json +14 -0
  534. package/locale/en-RW/index.cjs +3 -0
  535. package/locale/en-RW/index.cjs.js +3 -0
  536. package/locale/en-RW/index.js +1 -3
  537. package/locale/en-RW/package.json +14 -0
  538. package/locale/en-SB/index.cjs +3 -0
  539. package/locale/en-SB/index.cjs.js +3 -0
  540. package/locale/en-SB/index.js +1 -3
  541. package/locale/en-SB/package.json +14 -0
  542. package/locale/en-SC/index.cjs +3 -0
  543. package/locale/en-SC/index.cjs.js +3 -0
  544. package/locale/en-SC/index.js +1 -3
  545. package/locale/en-SC/package.json +14 -0
  546. package/locale/en-SD/index.cjs +3 -0
  547. package/locale/en-SD/index.cjs.js +3 -0
  548. package/locale/en-SD/index.js +1 -3
  549. package/locale/en-SD/package.json +14 -0
  550. package/locale/en-SE/index.cjs +3 -0
  551. package/locale/en-SE/index.cjs.js +3 -0
  552. package/locale/en-SE/index.js +1 -3
  553. package/locale/en-SE/package.json +14 -0
  554. package/locale/en-SG/index.cjs +3 -0
  555. package/locale/en-SG/index.cjs.js +3 -0
  556. package/locale/en-SG/index.js +1 -3
  557. package/locale/en-SG/package.json +14 -0
  558. package/locale/en-SH/index.cjs +3 -0
  559. package/locale/en-SH/index.cjs.js +3 -0
  560. package/locale/en-SH/index.js +1 -3
  561. package/locale/en-SH/package.json +14 -0
  562. package/locale/en-SI/index.cjs +3 -0
  563. package/locale/en-SI/index.cjs.js +3 -0
  564. package/locale/en-SI/index.js +1 -3
  565. package/locale/en-SI/package.json +14 -0
  566. package/locale/en-SL/index.cjs +3 -0
  567. package/locale/en-SL/index.cjs.js +3 -0
  568. package/locale/en-SL/index.js +1 -3
  569. package/locale/en-SL/package.json +14 -0
  570. package/locale/en-SS/index.cjs +3 -0
  571. package/locale/en-SS/index.cjs.js +3 -0
  572. package/locale/en-SS/index.js +1 -3
  573. package/locale/en-SS/package.json +14 -0
  574. package/locale/en-SX/index.cjs +3 -0
  575. package/locale/en-SX/index.cjs.js +3 -0
  576. package/locale/en-SX/index.js +1 -3
  577. package/locale/en-SX/package.json +14 -0
  578. package/locale/en-SZ/index.cjs +3 -0
  579. package/locale/en-SZ/index.cjs.js +3 -0
  580. package/locale/en-SZ/index.js +1 -3
  581. package/locale/en-SZ/package.json +14 -0
  582. package/locale/en-TC/index.cjs +3 -0
  583. package/locale/en-TC/index.cjs.js +3 -0
  584. package/locale/en-TC/index.js +1 -3
  585. package/locale/en-TC/package.json +14 -0
  586. package/locale/en-TK/index.cjs +3 -0
  587. package/locale/en-TK/index.cjs.js +3 -0
  588. package/locale/en-TK/index.js +1 -3
  589. package/locale/en-TK/package.json +14 -0
  590. package/locale/en-TO/index.cjs +3 -0
  591. package/locale/en-TO/index.cjs.js +3 -0
  592. package/locale/en-TO/index.js +1 -3
  593. package/locale/en-TO/package.json +14 -0
  594. package/locale/en-TT/index.cjs +3 -0
  595. package/locale/en-TT/index.cjs.js +3 -0
  596. package/locale/en-TT/index.js +1 -3
  597. package/locale/en-TT/package.json +14 -0
  598. package/locale/en-TV/index.cjs +3 -0
  599. package/locale/en-TV/index.cjs.js +3 -0
  600. package/locale/en-TV/index.js +1 -3
  601. package/locale/en-TV/package.json +14 -0
  602. package/locale/en-TZ/index.cjs +3 -0
  603. package/locale/en-TZ/index.cjs.js +3 -0
  604. package/locale/en-TZ/index.js +1 -3
  605. package/locale/en-TZ/package.json +14 -0
  606. package/locale/en-UG/index.cjs +3 -0
  607. package/locale/en-UG/index.cjs.js +3 -0
  608. package/locale/en-UG/index.js +1 -3
  609. package/locale/en-UG/package.json +14 -0
  610. package/locale/en-VC/index.cjs +3 -0
  611. package/locale/en-VC/index.cjs.js +3 -0
  612. package/locale/en-VC/index.js +1 -3
  613. package/locale/en-VC/package.json +14 -0
  614. package/locale/en-VG/index.cjs +3 -0
  615. package/locale/en-VG/index.cjs.js +3 -0
  616. package/locale/en-VG/index.js +1 -3
  617. package/locale/en-VG/package.json +14 -0
  618. package/locale/en-VU/index.cjs +3 -0
  619. package/locale/en-VU/index.cjs.js +3 -0
  620. package/locale/en-VU/index.js +1 -3
  621. package/locale/en-VU/package.json +14 -0
  622. package/locale/en-WS/index.cjs +3 -0
  623. package/locale/en-WS/index.cjs.js +3 -0
  624. package/locale/en-WS/index.js +1 -3
  625. package/locale/en-WS/package.json +14 -0
  626. package/locale/en-ZA/index.cjs +3 -0
  627. package/locale/en-ZA/index.cjs.js +3 -0
  628. package/locale/en-ZA/index.js +1 -3
  629. package/locale/en-ZA/package.json +14 -0
  630. package/locale/en-ZM/index.cjs +3 -0
  631. package/locale/en-ZM/index.cjs.js +3 -0
  632. package/locale/en-ZM/index.js +1 -3
  633. package/locale/en-ZM/package.json +14 -0
  634. package/locale/en-ZW/index.cjs +3 -0
  635. package/locale/en-ZW/index.cjs.js +3 -0
  636. package/locale/en-ZW/index.js +1 -3
  637. package/locale/en-ZW/package.json +14 -0
  638. package/locale/es/index.cjs +3 -0
  639. package/locale/es/index.cjs.js +3 -0
  640. package/locale/es/index.js +1 -3
  641. package/locale/es/package.json +14 -0
  642. package/locale/es-419/index.cjs +3 -0
  643. package/locale/es-419/index.cjs.js +3 -0
  644. package/locale/es-419/index.js +1 -3
  645. package/locale/es-419/package.json +14 -0
  646. package/locale/es-AR/index.cjs +3 -0
  647. package/locale/es-AR/index.cjs.js +3 -0
  648. package/locale/es-AR/index.js +1 -3
  649. package/locale/es-AR/package.json +14 -0
  650. package/locale/es-BO/index.cjs +3 -0
  651. package/locale/es-BO/index.cjs.js +3 -0
  652. package/locale/es-BO/index.js +1 -3
  653. package/locale/es-BO/package.json +14 -0
  654. package/locale/es-BR/index.cjs +3 -0
  655. package/locale/es-BR/index.cjs.js +3 -0
  656. package/locale/es-BR/index.js +1 -3
  657. package/locale/es-BR/package.json +14 -0
  658. package/locale/es-BZ/index.cjs +3 -0
  659. package/locale/es-BZ/index.cjs.js +3 -0
  660. package/locale/es-BZ/index.js +1 -3
  661. package/locale/es-BZ/package.json +14 -0
  662. package/locale/es-CL/index.cjs +3 -0
  663. package/locale/es-CL/index.cjs.js +3 -0
  664. package/locale/es-CL/index.js +1 -3
  665. package/locale/es-CL/package.json +14 -0
  666. package/locale/es-CO/index.cjs +3 -0
  667. package/locale/es-CO/index.cjs.js +3 -0
  668. package/locale/es-CO/index.js +1 -3
  669. package/locale/es-CO/package.json +14 -0
  670. package/locale/es-CR/index.cjs +3 -0
  671. package/locale/es-CR/index.cjs.js +3 -0
  672. package/locale/es-CR/index.js +1 -3
  673. package/locale/es-CR/package.json +14 -0
  674. package/locale/es-CU/index.cjs +3 -0
  675. package/locale/es-CU/index.cjs.js +3 -0
  676. package/locale/es-CU/index.js +1 -3
  677. package/locale/es-CU/package.json +14 -0
  678. package/locale/es-DO/index.cjs +3 -0
  679. package/locale/es-DO/index.cjs.js +3 -0
  680. package/locale/es-DO/index.js +1 -3
  681. package/locale/es-DO/package.json +14 -0
  682. package/locale/es-EC/index.cjs +3 -0
  683. package/locale/es-EC/index.cjs.js +3 -0
  684. package/locale/es-EC/index.js +1 -3
  685. package/locale/es-EC/package.json +14 -0
  686. package/locale/es-GT/index.cjs +3 -0
  687. package/locale/es-GT/index.cjs.js +3 -0
  688. package/locale/es-GT/index.js +1 -3
  689. package/locale/es-GT/package.json +14 -0
  690. package/locale/es-HN/index.cjs +3 -0
  691. package/locale/es-HN/index.cjs.js +3 -0
  692. package/locale/es-HN/index.js +1 -3
  693. package/locale/es-HN/package.json +14 -0
  694. package/locale/es-MX/index.cjs +3 -0
  695. package/locale/es-MX/index.cjs.js +3 -0
  696. package/locale/es-MX/index.js +1 -3
  697. package/locale/es-MX/package.json +14 -0
  698. package/locale/es-NI/index.cjs +3 -0
  699. package/locale/es-NI/index.cjs.js +3 -0
  700. package/locale/es-NI/index.js +1 -3
  701. package/locale/es-NI/package.json +14 -0
  702. package/locale/es-PA/index.cjs +3 -0
  703. package/locale/es-PA/index.cjs.js +3 -0
  704. package/locale/es-PA/index.js +1 -3
  705. package/locale/es-PA/package.json +14 -0
  706. package/locale/es-PE/index.cjs +3 -0
  707. package/locale/es-PE/index.cjs.js +3 -0
  708. package/locale/es-PE/index.js +1 -3
  709. package/locale/es-PE/package.json +14 -0
  710. package/locale/es-PR/index.cjs +3 -0
  711. package/locale/es-PR/index.cjs.js +3 -0
  712. package/locale/es-PR/index.js +1 -3
  713. package/locale/es-PR/package.json +14 -0
  714. package/locale/es-PY/index.cjs +3 -0
  715. package/locale/es-PY/index.cjs.js +3 -0
  716. package/locale/es-PY/index.js +1 -3
  717. package/locale/es-PY/package.json +14 -0
  718. package/locale/es-SV/index.cjs +3 -0
  719. package/locale/es-SV/index.cjs.js +3 -0
  720. package/locale/es-SV/index.js +1 -3
  721. package/locale/es-SV/package.json +14 -0
  722. package/locale/es-US/index.cjs +3 -0
  723. package/locale/es-US/index.cjs.js +3 -0
  724. package/locale/es-US/index.js +1 -3
  725. package/locale/es-US/package.json +14 -0
  726. package/locale/es-UY/index.cjs +3 -0
  727. package/locale/es-UY/index.cjs.js +3 -0
  728. package/locale/es-UY/index.js +1 -3
  729. package/locale/es-UY/package.json +14 -0
  730. package/locale/es-VE/index.cjs +3 -0
  731. package/locale/es-VE/index.cjs.js +3 -0
  732. package/locale/es-VE/index.js +1 -3
  733. package/locale/es-VE/package.json +14 -0
  734. package/locale/et/index.cjs +3 -0
  735. package/locale/et/index.cjs.js +3 -0
  736. package/locale/et/index.js +1 -3
  737. package/locale/et/package.json +14 -0
  738. package/locale/eu/index.cjs +3 -0
  739. package/locale/eu/index.cjs.js +3 -0
  740. package/locale/eu/index.js +1 -3
  741. package/locale/eu/package.json +14 -0
  742. package/locale/fa/index.cjs +3 -0
  743. package/locale/fa/index.cjs.js +3 -0
  744. package/locale/fa/index.js +1 -3
  745. package/locale/fa/package.json +14 -0
  746. package/locale/ff-Adlm/index.cjs +3 -0
  747. package/locale/ff-Adlm/index.cjs.js +3 -0
  748. package/locale/ff-Adlm/index.js +1 -3
  749. package/locale/ff-Adlm/package.json +14 -0
  750. package/locale/fi/index.cjs +3 -0
  751. package/locale/fi/index.cjs.js +3 -0
  752. package/locale/fi/index.js +1 -3
  753. package/locale/fi/package.json +14 -0
  754. package/locale/fil/index.cjs +3 -0
  755. package/locale/fil/index.cjs.js +3 -0
  756. package/locale/fil/index.js +1 -3
  757. package/locale/fil/package.json +14 -0
  758. package/locale/fo/index.cjs +3 -0
  759. package/locale/fo/index.cjs.js +3 -0
  760. package/locale/fo/index.js +1 -3
  761. package/locale/fo/package.json +14 -0
  762. package/locale/fr/index.cjs +3 -0
  763. package/locale/fr/index.cjs.js +3 -0
  764. package/locale/fr/index.js +1 -3
  765. package/locale/fr/package.json +14 -0
  766. package/locale/fr-CA/index.cjs +3 -0
  767. package/locale/fr-CA/index.cjs.js +3 -0
  768. package/locale/fr-CA/index.js +1 -3
  769. package/locale/fr-CA/package.json +14 -0
  770. package/locale/fur/index.cjs +3 -0
  771. package/locale/fur/index.cjs.js +3 -0
  772. package/locale/fur/index.js +1 -3
  773. package/locale/fur/package.json +14 -0
  774. package/locale/fy/index.cjs +3 -0
  775. package/locale/fy/index.cjs.js +3 -0
  776. package/locale/fy/index.js +1 -3
  777. package/locale/fy/package.json +14 -0
  778. package/locale/ga/index.cjs +3 -0
  779. package/locale/ga/index.cjs.js +3 -0
  780. package/locale/ga/index.js +1 -3
  781. package/locale/ga/package.json +14 -0
  782. package/locale/gd/index.cjs +3 -0
  783. package/locale/gd/index.cjs.js +3 -0
  784. package/locale/gd/index.js +1 -3
  785. package/locale/gd/package.json +14 -0
  786. package/locale/gl/index.cjs +3 -0
  787. package/locale/gl/index.cjs.js +3 -0
  788. package/locale/gl/index.js +1 -3
  789. package/locale/gl/package.json +14 -0
  790. package/locale/gu/index.cjs +3 -0
  791. package/locale/gu/index.cjs.js +3 -0
  792. package/locale/gu/index.js +1 -3
  793. package/locale/gu/package.json +14 -0
  794. package/locale/ha/index.cjs +3 -0
  795. package/locale/ha/index.cjs.js +3 -0
  796. package/locale/ha/index.js +1 -3
  797. package/locale/ha/package.json +14 -0
  798. package/locale/he/index.cjs +3 -0
  799. package/locale/he/index.cjs.js +3 -0
  800. package/locale/he/index.js +1 -3
  801. package/locale/he/package.json +14 -0
  802. package/locale/hi/index.cjs +3 -0
  803. package/locale/hi/index.cjs.js +3 -0
  804. package/locale/hi/index.js +1 -3
  805. package/locale/hi/package.json +14 -0
  806. package/locale/hi-Latn/index.cjs +3 -0
  807. package/locale/hi-Latn/index.cjs.js +3 -0
  808. package/locale/hi-Latn/index.js +1 -0
  809. package/locale/hi-Latn/package.json +14 -0
  810. package/locale/hi-Latn.json +183 -0
  811. package/locale/hr/index.cjs +3 -0
  812. package/locale/hr/index.cjs.js +3 -0
  813. package/locale/hr/index.js +1 -3
  814. package/locale/hr/package.json +14 -0
  815. package/locale/hsb/index.cjs +3 -0
  816. package/locale/hsb/index.cjs.js +3 -0
  817. package/locale/hsb/index.js +1 -3
  818. package/locale/hsb/package.json +14 -0
  819. package/locale/hu/index.cjs +3 -0
  820. package/locale/hu/index.cjs.js +3 -0
  821. package/locale/hu/index.js +1 -3
  822. package/locale/hu/package.json +14 -0
  823. package/locale/hy/index.cjs +3 -0
  824. package/locale/hy/index.cjs.js +3 -0
  825. package/locale/hy/index.js +1 -3
  826. package/locale/hy/package.json +14 -0
  827. package/locale/ia/index.cjs +3 -0
  828. package/locale/ia/index.cjs.js +3 -0
  829. package/locale/ia/index.js +1 -3
  830. package/locale/ia/package.json +14 -0
  831. package/locale/id/index.cjs +3 -0
  832. package/locale/id/index.cjs.js +3 -0
  833. package/locale/id/index.js +1 -3
  834. package/locale/id/package.json +14 -0
  835. package/locale/ig/index.cjs +3 -0
  836. package/locale/ig/index.cjs.js +3 -0
  837. package/locale/ig/index.js +1 -3
  838. package/locale/ig/package.json +14 -0
  839. package/locale/is/index.cjs +3 -0
  840. package/locale/is/index.cjs.js +3 -0
  841. package/locale/is/index.js +1 -3
  842. package/locale/is/package.json +14 -0
  843. package/locale/it/index.cjs +3 -0
  844. package/locale/it/index.cjs.js +3 -0
  845. package/locale/it/index.js +1 -3
  846. package/locale/it/package.json +14 -0
  847. package/locale/ja/index.cjs +3 -0
  848. package/locale/ja/index.cjs.js +3 -0
  849. package/locale/ja/index.js +1 -3
  850. package/locale/ja/package.json +14 -0
  851. package/locale/jgo/index.cjs +3 -0
  852. package/locale/jgo/index.cjs.js +3 -0
  853. package/locale/jgo/index.js +1 -3
  854. package/locale/jgo/package.json +14 -0
  855. package/locale/jv/index.cjs +3 -0
  856. package/locale/jv/index.cjs.js +3 -0
  857. package/locale/jv/index.js +1 -3
  858. package/locale/jv/package.json +14 -0
  859. package/locale/ka/index.cjs +3 -0
  860. package/locale/ka/index.cjs.js +3 -0
  861. package/locale/ka/index.js +1 -3
  862. package/locale/ka/package.json +14 -0
  863. package/locale/kea/index.cjs +3 -0
  864. package/locale/kea/index.cjs.js +3 -0
  865. package/locale/kea/index.js +1 -3
  866. package/locale/kea/package.json +14 -0
  867. package/locale/kgp/index.cjs +3 -0
  868. package/locale/kgp/index.cjs.js +3 -0
  869. package/locale/kgp/index.js +1 -3
  870. package/locale/kgp/package.json +14 -0
  871. package/locale/kk/index.cjs +3 -0
  872. package/locale/kk/index.cjs.js +3 -0
  873. package/locale/kk/index.js +1 -3
  874. package/locale/kk/package.json +14 -0
  875. package/locale/kl/index.cjs +3 -0
  876. package/locale/kl/index.cjs.js +3 -0
  877. package/locale/kl/index.js +1 -3
  878. package/locale/kl/package.json +14 -0
  879. package/locale/km/index.cjs +3 -0
  880. package/locale/km/index.cjs.js +3 -0
  881. package/locale/km/index.js +1 -3
  882. package/locale/km/package.json +14 -0
  883. package/locale/kn/index.cjs +3 -0
  884. package/locale/kn/index.cjs.js +3 -0
  885. package/locale/kn/index.js +1 -3
  886. package/locale/kn/package.json +14 -0
  887. package/locale/ko/index.cjs +3 -0
  888. package/locale/ko/index.cjs.js +3 -0
  889. package/locale/ko/index.js +1 -3
  890. package/locale/ko/package.json +14 -0
  891. package/locale/kok/index.cjs +3 -0
  892. package/locale/kok/index.cjs.js +3 -0
  893. package/locale/kok/index.js +1 -3
  894. package/locale/kok/package.json +14 -0
  895. package/locale/ksh/index.cjs +3 -0
  896. package/locale/ksh/index.cjs.js +3 -0
  897. package/locale/ksh/index.js +1 -3
  898. package/locale/ksh/package.json +14 -0
  899. package/locale/ku/index.cjs +3 -0
  900. package/locale/ku/index.cjs.js +3 -0
  901. package/locale/ku/index.js +1 -3
  902. package/locale/ku/package.json +14 -0
  903. package/locale/ky/index.cjs +3 -0
  904. package/locale/ky/index.cjs.js +3 -0
  905. package/locale/ky/index.js +1 -3
  906. package/locale/ky/package.json +14 -0
  907. package/locale/lb/index.cjs +3 -0
  908. package/locale/lb/index.cjs.js +3 -0
  909. package/locale/lb/index.js +1 -3
  910. package/locale/lb/package.json +14 -0
  911. package/locale/lkt/index.cjs +3 -0
  912. package/locale/lkt/index.cjs.js +3 -0
  913. package/locale/lkt/index.js +1 -3
  914. package/locale/lkt/package.json +14 -0
  915. package/locale/lo/index.cjs +3 -0
  916. package/locale/lo/index.cjs.js +3 -0
  917. package/locale/lo/index.js +1 -3
  918. package/locale/lo/package.json +14 -0
  919. package/locale/lt/index.cjs +3 -0
  920. package/locale/lt/index.cjs.js +3 -0
  921. package/locale/lt/index.js +1 -3
  922. package/locale/lt/package.json +14 -0
  923. package/locale/lv/index.cjs +3 -0
  924. package/locale/lv/index.cjs.js +3 -0
  925. package/locale/lv/index.js +1 -3
  926. package/locale/lv/package.json +14 -0
  927. package/locale/mk/index.cjs +3 -0
  928. package/locale/mk/index.cjs.js +3 -0
  929. package/locale/mk/index.js +1 -3
  930. package/locale/mk/package.json +14 -0
  931. package/locale/ml/index.cjs +3 -0
  932. package/locale/ml/index.cjs.js +3 -0
  933. package/locale/ml/index.js +1 -3
  934. package/locale/ml/package.json +14 -0
  935. package/locale/mn/index.cjs +3 -0
  936. package/locale/mn/index.cjs.js +3 -0
  937. package/locale/mn/index.js +1 -3
  938. package/locale/mn/package.json +14 -0
  939. package/locale/mni/index.cjs +3 -0
  940. package/locale/mni/index.cjs.js +3 -0
  941. package/locale/mni/index.js +1 -3
  942. package/locale/mni/package.json +14 -0
  943. package/locale/mr/index.cjs +3 -0
  944. package/locale/mr/index.cjs.js +3 -0
  945. package/locale/mr/index.js +1 -3
  946. package/locale/mr/package.json +14 -0
  947. package/locale/ms/index.cjs +3 -0
  948. package/locale/ms/index.cjs.js +3 -0
  949. package/locale/ms/index.js +1 -3
  950. package/locale/ms/package.json +14 -0
  951. package/locale/mt/index.cjs +3 -0
  952. package/locale/mt/index.cjs.js +3 -0
  953. package/locale/mt/index.js +1 -3
  954. package/locale/mt/package.json +14 -0
  955. package/locale/my/index.cjs +3 -0
  956. package/locale/my/index.cjs.js +3 -0
  957. package/locale/my/index.js +1 -3
  958. package/locale/my/package.json +14 -0
  959. package/locale/mzn/index.cjs +3 -0
  960. package/locale/mzn/index.cjs.js +3 -0
  961. package/locale/mzn/index.js +1 -3
  962. package/locale/mzn/package.json +14 -0
  963. package/locale/nb/index.cjs +3 -0
  964. package/locale/nb/index.cjs.js +3 -0
  965. package/locale/nb/index.js +1 -3
  966. package/locale/nb/package.json +14 -0
  967. package/locale/ne/index.cjs +3 -0
  968. package/locale/ne/index.cjs.js +3 -0
  969. package/locale/ne/index.js +1 -3
  970. package/locale/ne/package.json +14 -0
  971. package/locale/nl/index.cjs +3 -0
  972. package/locale/nl/index.cjs.js +3 -0
  973. package/locale/nl/index.js +1 -3
  974. package/locale/nl/package.json +14 -0
  975. package/locale/nn/index.cjs +3 -0
  976. package/locale/nn/index.cjs.js +3 -0
  977. package/locale/nn/index.js +1 -3
  978. package/locale/nn/package.json +14 -0
  979. package/locale/no/index.cjs +3 -0
  980. package/locale/no/index.cjs.js +3 -0
  981. package/locale/no/index.js +1 -3
  982. package/locale/no/package.json +14 -0
  983. package/locale/or/index.cjs +3 -0
  984. package/locale/or/index.cjs.js +3 -0
  985. package/locale/or/index.js +1 -3
  986. package/locale/or/package.json +14 -0
  987. package/locale/pa/index.cjs +3 -0
  988. package/locale/pa/index.cjs.js +3 -0
  989. package/locale/pa/index.js +1 -3
  990. package/locale/pa/package.json +14 -0
  991. package/locale/pcm/index.cjs +3 -0
  992. package/locale/pcm/index.cjs.js +3 -0
  993. package/locale/pcm/index.js +1 -3
  994. package/locale/pcm/package.json +14 -0
  995. package/locale/pl/index.cjs +3 -0
  996. package/locale/pl/index.cjs.js +3 -0
  997. package/locale/pl/index.js +1 -3
  998. package/locale/pl/package.json +14 -0
  999. package/locale/ps/index.cjs +3 -0
  1000. package/locale/ps/index.cjs.js +3 -0
  1001. package/locale/ps/index.js +1 -3
  1002. package/locale/ps/package.json +14 -0
  1003. package/locale/ps-PK/index.cjs +3 -0
  1004. package/locale/ps-PK/index.cjs.js +3 -0
  1005. package/locale/ps-PK/index.js +1 -3
  1006. package/locale/ps-PK/package.json +14 -0
  1007. package/locale/pt/index.cjs +3 -0
  1008. package/locale/pt/index.cjs.js +3 -0
  1009. package/locale/pt/index.js +1 -3
  1010. package/locale/pt/package.json +14 -0
  1011. package/locale/pt-AO/index.cjs +3 -0
  1012. package/locale/pt-AO/index.cjs.js +3 -0
  1013. package/locale/pt-AO/index.js +1 -3
  1014. package/locale/pt-AO/package.json +14 -0
  1015. package/locale/pt-CH/index.cjs +3 -0
  1016. package/locale/pt-CH/index.cjs.js +3 -0
  1017. package/locale/pt-CH/index.js +1 -3
  1018. package/locale/pt-CH/package.json +14 -0
  1019. package/locale/pt-CV/index.cjs +3 -0
  1020. package/locale/pt-CV/index.cjs.js +3 -0
  1021. package/locale/pt-CV/index.js +1 -3
  1022. package/locale/pt-CV/package.json +14 -0
  1023. package/locale/pt-GQ/index.cjs +3 -0
  1024. package/locale/pt-GQ/index.cjs.js +3 -0
  1025. package/locale/pt-GQ/index.js +1 -3
  1026. package/locale/pt-GQ/package.json +14 -0
  1027. package/locale/pt-GW/index.cjs +3 -0
  1028. package/locale/pt-GW/index.cjs.js +3 -0
  1029. package/locale/pt-GW/index.js +1 -3
  1030. package/locale/pt-GW/package.json +14 -0
  1031. package/locale/pt-LU/index.cjs +3 -0
  1032. package/locale/pt-LU/index.cjs.js +3 -0
  1033. package/locale/pt-LU/index.js +1 -3
  1034. package/locale/pt-LU/package.json +14 -0
  1035. package/locale/pt-MO/index.cjs +3 -0
  1036. package/locale/pt-MO/index.cjs.js +3 -0
  1037. package/locale/pt-MO/index.js +1 -3
  1038. package/locale/pt-MO/package.json +14 -0
  1039. package/locale/pt-MZ/index.cjs +3 -0
  1040. package/locale/pt-MZ/index.cjs.js +3 -0
  1041. package/locale/pt-MZ/index.js +1 -3
  1042. package/locale/pt-MZ/package.json +14 -0
  1043. package/locale/pt-PT/index.cjs +3 -0
  1044. package/locale/pt-PT/index.cjs.js +3 -0
  1045. package/locale/pt-PT/index.js +1 -3
  1046. package/locale/pt-PT/package.json +14 -0
  1047. package/locale/pt-ST/index.cjs +3 -0
  1048. package/locale/pt-ST/index.cjs.js +3 -0
  1049. package/locale/pt-ST/index.js +1 -3
  1050. package/locale/pt-ST/package.json +14 -0
  1051. package/locale/pt-TL/index.cjs +3 -0
  1052. package/locale/pt-TL/index.cjs.js +3 -0
  1053. package/locale/pt-TL/index.js +1 -3
  1054. package/locale/pt-TL/package.json +14 -0
  1055. package/locale/qu/index.cjs +3 -0
  1056. package/locale/qu/index.cjs.js +3 -0
  1057. package/locale/qu/index.js +1 -3
  1058. package/locale/qu/package.json +14 -0
  1059. package/locale/rm/index.cjs +3 -0
  1060. package/locale/rm/index.cjs.js +3 -0
  1061. package/locale/rm/index.js +1 -3
  1062. package/locale/rm/package.json +14 -0
  1063. package/locale/ro/index.cjs +3 -0
  1064. package/locale/ro/index.cjs.js +3 -0
  1065. package/locale/ro/index.js +1 -3
  1066. package/locale/ro/package.json +14 -0
  1067. package/locale/ru/index.cjs +3 -0
  1068. package/locale/ru/index.cjs.js +3 -0
  1069. package/locale/ru/index.js +1 -3
  1070. package/locale/ru/package.json +14 -0
  1071. package/locale/sah/index.cjs +3 -0
  1072. package/locale/sah/index.cjs.js +3 -0
  1073. package/locale/sah/index.js +1 -3
  1074. package/locale/sah/package.json +14 -0
  1075. package/locale/sc/index.cjs +3 -0
  1076. package/locale/sc/index.cjs.js +3 -0
  1077. package/locale/sc/index.js +1 -3
  1078. package/locale/sc/package.json +14 -0
  1079. package/locale/sd/index.cjs +3 -0
  1080. package/locale/sd/index.cjs.js +3 -0
  1081. package/locale/sd/index.js +1 -3
  1082. package/locale/sd/package.json +14 -0
  1083. package/locale/se/index.cjs +3 -0
  1084. package/locale/se/index.cjs.js +3 -0
  1085. package/locale/se/index.js +1 -3
  1086. package/locale/se/package.json +14 -0
  1087. package/locale/se-FI/index.cjs +3 -0
  1088. package/locale/se-FI/index.cjs.js +3 -0
  1089. package/locale/se-FI/index.js +1 -3
  1090. package/locale/se-FI/package.json +14 -0
  1091. package/locale/si/index.cjs +3 -0
  1092. package/locale/si/index.cjs.js +3 -0
  1093. package/locale/si/index.js +1 -3
  1094. package/locale/si/package.json +14 -0
  1095. package/locale/sk/index.cjs +3 -0
  1096. package/locale/sk/index.cjs.js +3 -0
  1097. package/locale/sk/index.js +1 -3
  1098. package/locale/sk/package.json +14 -0
  1099. package/locale/sl/index.cjs +3 -0
  1100. package/locale/sl/index.cjs.js +3 -0
  1101. package/locale/sl/index.js +1 -3
  1102. package/locale/sl/package.json +14 -0
  1103. package/locale/so/index.cjs +3 -0
  1104. package/locale/so/index.cjs.js +3 -0
  1105. package/locale/so/index.js +1 -3
  1106. package/locale/so/package.json +14 -0
  1107. package/locale/sq/index.cjs +3 -0
  1108. package/locale/sq/index.cjs.js +3 -0
  1109. package/locale/sq/index.js +1 -3
  1110. package/locale/sq/package.json +14 -0
  1111. package/locale/sr/index.cjs +3 -0
  1112. package/locale/sr/index.cjs.js +3 -0
  1113. package/locale/sr/index.js +1 -3
  1114. package/locale/sr/package.json +14 -0
  1115. package/locale/sr-Cyrl-BA/index.cjs +3 -0
  1116. package/locale/sr-Cyrl-BA/index.cjs.js +3 -0
  1117. package/locale/sr-Cyrl-BA/index.js +1 -3
  1118. package/locale/sr-Cyrl-BA/package.json +14 -0
  1119. package/locale/sr-Latn/index.cjs +3 -0
  1120. package/locale/sr-Latn/index.cjs.js +3 -0
  1121. package/locale/sr-Latn/index.js +1 -3
  1122. package/locale/sr-Latn/package.json +14 -0
  1123. package/locale/sr-Latn-BA/index.cjs +3 -0
  1124. package/locale/sr-Latn-BA/index.cjs.js +3 -0
  1125. package/locale/sr-Latn-BA/index.js +1 -3
  1126. package/locale/sr-Latn-BA/package.json +14 -0
  1127. package/locale/su/index.cjs +3 -0
  1128. package/locale/su/index.cjs.js +3 -0
  1129. package/locale/su/index.js +1 -3
  1130. package/locale/su/package.json +14 -0
  1131. package/locale/sv/index.cjs +3 -0
  1132. package/locale/sv/index.cjs.js +3 -0
  1133. package/locale/sv/index.js +1 -3
  1134. package/locale/sv/package.json +14 -0
  1135. package/locale/sw/index.cjs +3 -0
  1136. package/locale/sw/index.cjs.js +3 -0
  1137. package/locale/sw/index.js +1 -3
  1138. package/locale/sw/package.json +14 -0
  1139. package/locale/ta/index.cjs +3 -0
  1140. package/locale/ta/index.cjs.js +3 -0
  1141. package/locale/ta/index.js +1 -3
  1142. package/locale/ta/package.json +14 -0
  1143. package/locale/te/index.cjs +3 -0
  1144. package/locale/te/index.cjs.js +3 -0
  1145. package/locale/te/index.js +1 -3
  1146. package/locale/te/package.json +14 -0
  1147. package/locale/tg/index.cjs +3 -0
  1148. package/locale/tg/index.cjs.js +3 -0
  1149. package/locale/tg/index.js +1 -3
  1150. package/locale/tg/package.json +14 -0
  1151. package/locale/th/index.cjs +3 -0
  1152. package/locale/th/index.cjs.js +3 -0
  1153. package/locale/th/index.js +1 -3
  1154. package/locale/th/package.json +14 -0
  1155. package/locale/ti/index.cjs +3 -0
  1156. package/locale/ti/index.cjs.js +3 -0
  1157. package/locale/ti/index.js +1 -3
  1158. package/locale/ti/package.json +14 -0
  1159. package/locale/tk/index.cjs +3 -0
  1160. package/locale/tk/index.cjs.js +3 -0
  1161. package/locale/tk/index.js +1 -3
  1162. package/locale/tk/package.json +14 -0
  1163. package/locale/to/index.cjs +3 -0
  1164. package/locale/to/index.cjs.js +3 -0
  1165. package/locale/to/index.js +1 -3
  1166. package/locale/to/package.json +14 -0
  1167. package/locale/tr/index.cjs +3 -0
  1168. package/locale/tr/index.cjs.js +3 -0
  1169. package/locale/tr/index.js +1 -3
  1170. package/locale/tr/package.json +14 -0
  1171. package/locale/tt/index.cjs +3 -0
  1172. package/locale/tt/index.cjs.js +3 -0
  1173. package/locale/tt/index.js +1 -3
  1174. package/locale/tt/package.json +14 -0
  1175. package/locale/ug/index.cjs +3 -0
  1176. package/locale/ug/index.cjs.js +3 -0
  1177. package/locale/ug/index.js +1 -3
  1178. package/locale/ug/package.json +14 -0
  1179. package/locale/uk/index.cjs +3 -0
  1180. package/locale/uk/index.cjs.js +3 -0
  1181. package/locale/uk/index.js +1 -3
  1182. package/locale/uk/package.json +14 -0
  1183. package/locale/ur/index.cjs +3 -0
  1184. package/locale/ur/index.cjs.js +3 -0
  1185. package/locale/ur/index.js +1 -3
  1186. package/locale/ur/package.json +14 -0
  1187. package/locale/ur-IN/index.cjs +3 -0
  1188. package/locale/ur-IN/index.cjs.js +3 -0
  1189. package/locale/ur-IN/index.js +1 -3
  1190. package/locale/ur-IN/package.json +14 -0
  1191. package/locale/uz/index.cjs +3 -0
  1192. package/locale/uz/index.cjs.js +3 -0
  1193. package/locale/uz/index.js +1 -3
  1194. package/locale/uz/package.json +14 -0
  1195. package/locale/uz-Cyrl/index.cjs +3 -0
  1196. package/locale/uz-Cyrl/index.cjs.js +3 -0
  1197. package/locale/uz-Cyrl/index.js +1 -3
  1198. package/locale/uz-Cyrl/package.json +14 -0
  1199. package/locale/vi/index.cjs +3 -0
  1200. package/locale/vi/index.cjs.js +3 -0
  1201. package/locale/vi/index.js +1 -3
  1202. package/locale/vi/package.json +14 -0
  1203. package/locale/wae/index.cjs +3 -0
  1204. package/locale/wae/index.cjs.js +3 -0
  1205. package/locale/wae/index.js +1 -3
  1206. package/locale/wae/package.json +14 -0
  1207. package/locale/wo/index.cjs +3 -0
  1208. package/locale/wo/index.cjs.js +3 -0
  1209. package/locale/wo/index.js +1 -3
  1210. package/locale/wo/package.json +14 -0
  1211. package/locale/yi/index.cjs +3 -0
  1212. package/locale/yi/index.cjs.js +3 -0
  1213. package/locale/yi/index.js +1 -3
  1214. package/locale/yi/package.json +14 -0
  1215. package/locale/yo/index.cjs +3 -0
  1216. package/locale/yo/index.cjs.js +3 -0
  1217. package/locale/yo/index.js +1 -3
  1218. package/locale/yo/package.json +14 -0
  1219. package/locale/yo-BJ/index.cjs +3 -0
  1220. package/locale/yo-BJ/index.cjs.js +3 -0
  1221. package/locale/yo-BJ/index.js +1 -3
  1222. package/locale/yo-BJ/package.json +14 -0
  1223. package/locale/yrl/index.cjs +3 -0
  1224. package/locale/yrl/index.cjs.js +3 -0
  1225. package/locale/yrl/index.js +1 -3
  1226. package/locale/yrl/package.json +14 -0
  1227. package/locale/yue/index.cjs +3 -0
  1228. package/locale/yue/index.cjs.js +3 -0
  1229. package/locale/yue/index.js +1 -3
  1230. package/locale/yue/package.json +14 -0
  1231. package/locale/yue-Hans/index.cjs +3 -0
  1232. package/locale/yue-Hans/index.cjs.js +3 -0
  1233. package/locale/yue-Hans/index.js +1 -3
  1234. package/locale/yue-Hans/package.json +14 -0
  1235. package/locale/zh/index.cjs +3 -0
  1236. package/locale/zh/index.cjs.js +3 -0
  1237. package/locale/zh/index.js +1 -3
  1238. package/locale/zh/package.json +14 -0
  1239. package/locale/zh-Hans-HK/index.cjs +3 -0
  1240. package/locale/zh-Hans-HK/index.cjs.js +3 -0
  1241. package/locale/zh-Hans-HK/index.js +1 -3
  1242. package/locale/zh-Hans-HK/package.json +14 -0
  1243. package/locale/zh-Hans-MO/index.cjs +3 -0
  1244. package/locale/zh-Hans-MO/index.cjs.js +3 -0
  1245. package/locale/zh-Hans-MO/index.js +1 -3
  1246. package/locale/zh-Hans-MO/package.json +14 -0
  1247. package/locale/zh-Hans-SG/index.cjs +3 -0
  1248. package/locale/zh-Hans-SG/index.cjs.js +3 -0
  1249. package/locale/zh-Hans-SG/index.js +1 -3
  1250. package/locale/zh-Hans-SG/package.json +14 -0
  1251. package/locale/zh-Hant/index.cjs +3 -0
  1252. package/locale/zh-Hant/index.cjs.js +3 -0
  1253. package/locale/zh-Hant/index.js +1 -3
  1254. package/locale/zh-Hant/package.json +14 -0
  1255. package/locale/zh-Hant-HK/index.cjs +3 -0
  1256. package/locale/zh-Hant-HK/index.cjs.js +3 -0
  1257. package/locale/zh-Hant-HK/index.js +1 -3
  1258. package/locale/zh-Hant-HK/package.json +14 -0
  1259. package/locale/zh-Hant-MO/index.cjs +3 -0
  1260. package/locale/zh-Hant-MO/index.cjs.js +3 -0
  1261. package/locale/zh-Hant-MO/index.js +1 -3
  1262. package/locale/zh-Hant-MO/package.json +14 -0
  1263. package/locale/zu/index.cjs +3 -0
  1264. package/locale/zu/index.cjs.js +3 -0
  1265. package/locale/zu/index.js +1 -3
  1266. package/locale/zu/package.json +14 -0
  1267. package/modules/LocaleDataStore.js.map +1 -1
  1268. package/modules/PropTypes.js +7 -1
  1269. package/modules/PropTypes.js.map +1 -1
  1270. package/modules/TimeAgo.js +25 -32
  1271. package/modules/TimeAgo.js.map +1 -1
  1272. package/modules/TimeAgo.test.js +7 -7
  1273. package/modules/TimeAgo.test.js.map +1 -1
  1274. package/modules/cache.js +8 -12
  1275. package/modules/cache.js.map +1 -1
  1276. package/modules/cache.test.js +1 -1
  1277. package/modules/cache.test.js.map +1 -1
  1278. package/modules/isStyleObject.js +1 -1
  1279. package/modules/isStyleObject.js.map +1 -1
  1280. package/modules/isStyleObject.test.js +1 -1
  1281. package/modules/isStyleObject.test.js.map +1 -1
  1282. package/modules/locale.js +9 -14
  1283. package/modules/locale.js.map +1 -1
  1284. package/modules/locale.test.js +2 -2
  1285. package/modules/locale.test.js.map +1 -1
  1286. package/modules/round.js.map +1 -1
  1287. package/modules/steps/approximate.js +1 -1
  1288. package/modules/steps/approximate.js.map +1 -1
  1289. package/modules/steps/approximate.test.js +2 -2
  1290. package/modules/steps/approximate.test.js.map +1 -1
  1291. package/modules/steps/getStep.js +6 -4
  1292. package/modules/steps/getStep.js.map +1 -1
  1293. package/modules/steps/getStep.test.js +5 -5
  1294. package/modules/steps/getStep.test.js.map +1 -1
  1295. package/modules/steps/getStepDenominator.js +1 -1
  1296. package/modules/steps/getStepDenominator.js.map +1 -1
  1297. package/modules/steps/getStepDenominator.test.js +1 -1
  1298. package/modules/steps/getStepDenominator.test.js.map +1 -1
  1299. package/modules/steps/getStepMinTime.js +4 -4
  1300. package/modules/steps/getStepMinTime.js.map +1 -1
  1301. package/modules/steps/getStepMinTime.test.js +1 -1
  1302. package/modules/steps/getStepMinTime.test.js.map +1 -1
  1303. package/modules/steps/getTimeToNextUpdate.js +3 -3
  1304. package/modules/steps/getTimeToNextUpdate.js.map +1 -1
  1305. package/modules/steps/getTimeToNextUpdate.test.js +1 -1
  1306. package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
  1307. package/modules/steps/getTimeToNextUpdateForUnit.js +2 -2
  1308. package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  1309. package/modules/steps/getTimeToNextUpdateForUnit.test.js +1 -1
  1310. package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  1311. package/modules/steps/helpers.js.map +1 -1
  1312. package/modules/steps/helpers.test.js +1 -1
  1313. package/modules/steps/helpers.test.js.map +1 -1
  1314. package/modules/steps/index.js +4 -4
  1315. package/modules/steps/index.js.map +1 -1
  1316. package/modules/steps/renameLegacyProperties.js +7 -7
  1317. package/modules/steps/renameLegacyProperties.js.map +1 -1
  1318. package/modules/steps/renameLegacyProperties.test.js +2 -2
  1319. package/modules/steps/renameLegacyProperties.test.js.map +1 -1
  1320. package/modules/steps/round.js.map +1 -1
  1321. package/modules/steps/round.test.js +2 -2
  1322. package/modules/steps/round.test.js.map +1 -1
  1323. package/modules/steps/units.js.map +1 -1
  1324. package/modules/style/approximate.js +1 -1
  1325. package/modules/style/approximate.js.map +1 -1
  1326. package/modules/style/approximateTime.js +1 -1
  1327. package/modules/style/approximateTime.js.map +1 -1
  1328. package/modules/style/approximateTime.test.js +11 -16
  1329. package/modules/style/approximateTime.test.js.map +1 -1
  1330. package/modules/style/getStyleByName.js +13 -13
  1331. package/modules/style/getStyleByName.js.map +1 -1
  1332. package/modules/style/mini.js.map +1 -1
  1333. package/modules/style/mini.test.js +8 -6
  1334. package/modules/style/mini.test.js.map +1 -1
  1335. package/modules/style/miniMinute.js +5 -3
  1336. package/modules/style/miniMinute.js.map +1 -1
  1337. package/modules/style/miniMinute.test.js +8 -6
  1338. package/modules/style/miniMinute.test.js.map +1 -1
  1339. package/modules/style/miniMinuteNow.js +5 -3
  1340. package/modules/style/miniMinuteNow.js.map +1 -1
  1341. package/modules/style/miniMinuteNow.test.js +8 -6
  1342. package/modules/style/miniMinuteNow.test.js.map +1 -1
  1343. package/modules/style/miniNow.js +5 -3
  1344. package/modules/style/miniNow.js.map +1 -1
  1345. package/modules/style/miniNow.test.js +8 -6
  1346. package/modules/style/miniNow.test.js.map +1 -1
  1347. package/modules/style/renameLegacyProperties.js +4 -2
  1348. package/modules/style/renameLegacyProperties.js.map +1 -1
  1349. package/modules/style/renameLegacyProperties.test.js +2 -2
  1350. package/modules/style/renameLegacyProperties.test.js.map +1 -1
  1351. package/modules/style/round.js +1 -1
  1352. package/modules/style/round.js.map +1 -1
  1353. package/modules/style/round.test.js +17 -11
  1354. package/modules/style/round.test.js.map +1 -1
  1355. package/modules/style/roundMinute.js +5 -3
  1356. package/modules/style/roundMinute.js.map +1 -1
  1357. package/modules/style/roundMinute.test.js +8 -6
  1358. package/modules/style/roundMinute.test.js.map +1 -1
  1359. package/modules/style/twitter.js +13 -13
  1360. package/modules/style/twitter.js.map +1 -1
  1361. package/modules/style/twitter.test.js +9 -7
  1362. package/modules/style/twitter.test.js.map +1 -1
  1363. package/modules/style/twitterFirstMinute.js +7 -5
  1364. package/modules/style/twitterFirstMinute.js.map +1 -1
  1365. package/modules/style/twitterFirstMinute.test.js +10 -8
  1366. package/modules/style/twitterFirstMinute.test.js.map +1 -1
  1367. package/modules/style/twitterMinute.js +5 -3
  1368. package/modules/style/twitterMinute.js.map +1 -1
  1369. package/modules/style/twitterMinute.test.js +10 -8
  1370. package/modules/style/twitterMinute.test.js.map +1 -1
  1371. package/modules/style/twitterMinuteNow.js +5 -3
  1372. package/modules/style/twitterMinuteNow.js.map +1 -1
  1373. package/modules/style/twitterMinuteNow.test.js +10 -8
  1374. package/modules/style/twitterMinuteNow.test.js.map +1 -1
  1375. package/modules/style/twitterNow.js +5 -3
  1376. package/modules/style/twitterNow.js.map +1 -1
  1377. package/modules/style/twitterNow.test.js +10 -8
  1378. package/modules/style/twitterNow.test.js.map +1 -1
  1379. package/package.json +671 -75
  1380. package/prop-types/index.cjs +2 -0
  1381. package/prop-types/index.cjs.js +7 -0
  1382. package/prop-types/index.js +1 -1
  1383. package/prop-types/package.json +9 -3
  1384. package/{rollup.config.js → rollup.config.mjs} +0 -0
  1385. package/steps/index.cjs +1 -0
  1386. package/steps/index.cjs.js +6 -0
  1387. package/steps/index.js +1 -1
  1388. package/steps/package.json +9 -3
  1389. package/cache/index.commonjs.js +0 -2
  1390. package/gradation/index.commonjs.js +0 -2
  1391. package/index.commonjs.js +0 -9
  1392. package/load-all-locales.js +0 -278
  1393. package/prop-types/index.commonjs.js +0 -2
  1394. package/steps/index.commonjs.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../source/round.js"],"names":["getRoundFunction","round","Math","floor","getDiffRatioToNextRoundedNumber"],"mappings":";;;;;;;;AAAO,SAASA,gBAAT,CAA0BC,KAA1B,EAAiC;AACvC,UAAQA,KAAR;AACC,SAAK,OAAL;AACC,aAAOC,IAAI,CAACC,KAAZ;;AACD;AACC,aAAOD,IAAI,CAACD,KAAZ;AAJF;AAMA,C,CAED;;;AACO,SAASG,+BAAT,CAAyCH,KAAzC,EAAgD;AACtD,UAAQA,KAAR;AACC,SAAK,OAAL;AACC;AACA;AACA,aAAO,CAAP;;AACD;AACC;AACA;AACA,aAAO,GAAP;AARF;AAUA","sourcesContent":["export function getRoundFunction(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\treturn Math.floor\r\n\t\tdefault:\r\n\t\t\treturn Math.round\r\n\t}\r\n}\r\n\r\n// For non-negative numbers.\r\nexport function getDiffRatioToNextRoundedNumber(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\t// Math.floor(x) = x\r\n\t\t\t// Math.floor(x + 1) = x + 1\r\n\t\t\treturn 1\r\n\t\tdefault:\r\n\t\t\t// Math.round(x) = x\r\n\t\t\t// Math.round(x + 0.5) = x + 1\r\n\t\t\treturn 0.5\r\n\t}\r\n}"],"file":"round.js"}
1
+ {"version":3,"file":"round.js","names":["getRoundFunction","round","Math","floor","getDiffRatioToNextRoundedNumber"],"sources":["../source/round.js"],"sourcesContent":["export function getRoundFunction(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\treturn Math.floor\r\n\t\tdefault:\r\n\t\t\treturn Math.round\r\n\t}\r\n}\r\n\r\n// For non-negative numbers.\r\nexport function getDiffRatioToNextRoundedNumber(round) {\r\n\tswitch (round) {\r\n\t\tcase 'floor':\r\n\t\t\t// Math.floor(x) = x\r\n\t\t\t// Math.floor(x + 1) = x + 1\r\n\t\t\treturn 1\r\n\t\tdefault:\r\n\t\t\t// Math.round(x) = x\r\n\t\t\t// Math.round(x + 0.5) = x + 1\r\n\t\t\treturn 0.5\r\n\t}\r\n}"],"mappings":";;;;;;;;AAAO,SAASA,gBAAT,CAA0BC,KAA1B,EAAiC;EACvC,QAAQA,KAAR;IACC,KAAK,OAAL;MACC,OAAOC,IAAI,CAACC,KAAZ;;IACD;MACC,OAAOD,IAAI,CAACD,KAAZ;EAJF;AAMA,C,CAED;;;AACO,SAASG,+BAAT,CAAyCH,KAAzC,EAAgD;EACtD,QAAQA,KAAR;IACC,KAAK,OAAL;MACC;MACA;MACA,OAAO,CAAP;;IACD;MACC;MACA;MACA,OAAO,GAAP;EARF;AAUA"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports["default"] = void 0;
7
7
 
8
- var _units = require("./units");
8
+ var _units = require("./units.js");
9
9
 
10
10
  // "factor" is a legacy property.
11
11
  // Developers shouldn't need to use it in their custom steps.
@@ -129,5 +129,5 @@ var _default = [{
129
129
  // "year" labels are used for formatting the output.
130
130
  unit: 'year'
131
131
  }];
132
- exports.default = _default;
132
+ exports["default"] = _default;
133
133
  //# sourceMappingURL=approximate.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/approximate.js"],"names":["factor","unit","threshold","threshold_for_now","minute","granularity","hour","threshold_for_minute","day","week","month","year"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;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AR,EAAAA,MAAM,EAAES,WALT;AAMC;AACAR,EAAAA,IAAI,EAAE;AAPP,CA1Ec,EAmFd;AACC;AACAC,EAAAA,SAAS,EAAE,MAAMO,WAFlB;AAGC;AACA;AACAT,EAAAA,MAAM,EAAEU,YALT;AAMC;AACAT,EAAAA,IAAI,EAAE;AAPP,CAnFc,EA4Fd;AACC;AACAC,EAAAA,SAAS,EAAE,OAAOQ,YAFnB;AAGC;AACA;AACAV,EAAAA,MAAM,EAAEW,WALT;AAMC;AACAV,EAAAA,IAAI,EAAE;AAPP,CA5Fc,C","sourcesContent":["import { minute, hour, day, week, month, year } from './units'\r\n\r\n// \"factor\" is a legacy property.\r\n// Developers shouldn't need to use it in their custom steps.\r\n\r\n// \"threshold\" is a legacy name of \"min\".\r\n// Developers should use \"min\" property name instead of \"threshold\".\r\n\r\n// \"threshold_for_idOrUnit: value\" is a legacy way of specifying \"min: { id: value }\".\r\n// Developers should use \"min\" property instead of \"threshold\".\r\n\r\n// just now\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// 5 minutes ago\r\n// 10 minutes ago\r\n// 15 minutes ago\r\n// 20 minutes ago\r\n// …\r\n// 50 minutes ago\r\n// an hour ago\r\n// 2 hours ago\r\n// …\r\n// 20 hours ago\r\n// a day ago\r\n// 2 days ago\r\n// 5 days ago\r\n// a week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// a month ago\r\n// 2 months ago\r\n// 4 months ago\r\n// a year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"now\" labels are used for formatting the output.\r\n\t\tunit: 'now'\r\n\t},\r\n\t{\r\n\t\t// When the language doesn't support `now` unit,\r\n\t\t// the first step is ignored, and it uses this `second` unit.\r\n\t\tthreshold: 1,\r\n\t\t// `threshold_for_now` should be the same as `threshold` on minutes.\r\n\t\tthreshold_for_now: 45.5,\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"second\" labels are used for formatting the output.\r\n\t\tunit: 'second'\r\n\t},\r\n\t{\r\n\t\t// `threshold` should be the same as `threshold_for_now` on seconds.\r\n\t\tthreshold: 45.5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n \t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 2.5 minutes.\r\n\t\tthreshold: 2.5 * minute,\r\n\t\t// Allow only 5-minute increments of minutes starting from 2.5 minutes.\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\tgranularity: 5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n\t\t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 22.5 minutes.\r\n\t\tthreshold: 22.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in half-an-hour.\r\n\t\tfactor: 0.5 * hour,\r\n\t\t// \"half-hour\" labels are used for formatting the output.\r\n\t\t// (if available, which is no longer the case)\r\n\t\tunit: 'half-hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 42.5 minutes.\r\n\t\tthreshold: 42.5 * minute,\r\n\t\tthreshold_for_minute: 52.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in an hour.\r\n\t\tfactor: hour,\r\n\t\t// \"hour\" labels are used for formatting the output.\r\n\t\tunit: 'hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 20.5 hours.\r\n\t\tthreshold: (20.5 / 24) * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a day.\r\n\t\tfactor: day,\r\n\t\t// \"day\" labels are used for formatting the output.\r\n\t\tunit: 'day'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 5.5 days.\r\n\t\tthreshold: 5.5 * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a week.\r\n\t\tfactor: week,\r\n\t\t// \"week\" labels are used for formatting the output.\r\n\t\tunit: 'week'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 3.5 weeks.\r\n\t\tthreshold: 3.5 * week,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a month.\r\n\t\tfactor: month,\r\n\t\t// \"month\" labels are used for formatting the output.\r\n\t\tunit: 'month'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 10.5 months.\r\n\t\tthreshold: 10.5 * month,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a year.\r\n\t\tfactor: year,\r\n\t\t// \"year\" labels are used for formatting the output.\r\n\t\tunit: 'year'\r\n\t}\r\n]"],"file":"approximate.js"}
1
+ {"version":3,"file":"approximate.js","names":["factor","unit","threshold","threshold_for_now","minute","granularity","hour","threshold_for_minute","day","week","month","year"],"sources":["../../source/steps/approximate.js"],"sourcesContent":["import { minute, hour, day, week, month, year } from './units.js'\r\n\r\n// \"factor\" is a legacy property.\r\n// Developers shouldn't need to use it in their custom steps.\r\n\r\n// \"threshold\" is a legacy name of \"min\".\r\n// Developers should use \"min\" property name instead of \"threshold\".\r\n\r\n// \"threshold_for_idOrUnit: value\" is a legacy way of specifying \"min: { id: value }\".\r\n// Developers should use \"min\" property instead of \"threshold\".\r\n\r\n// just now\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// 5 minutes ago\r\n// 10 minutes ago\r\n// 15 minutes ago\r\n// 20 minutes ago\r\n// …\r\n// 50 minutes ago\r\n// an hour ago\r\n// 2 hours ago\r\n// …\r\n// 20 hours ago\r\n// a day ago\r\n// 2 days ago\r\n// 5 days ago\r\n// a week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// a month ago\r\n// 2 months ago\r\n// 4 months ago\r\n// a year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"now\" labels are used for formatting the output.\r\n\t\tunit: 'now'\r\n\t},\r\n\t{\r\n\t\t// When the language doesn't support `now` unit,\r\n\t\t// the first step is ignored, and it uses this `second` unit.\r\n\t\tthreshold: 1,\r\n\t\t// `threshold_for_now` should be the same as `threshold` on minutes.\r\n\t\tthreshold_for_now: 45.5,\r\n\t\t// This step returns the amount of seconds\r\n\t\t// by dividing the amount of seconds by `1`.\r\n\t\tfactor: 1,\r\n \t// \"second\" labels are used for formatting the output.\r\n\t\tunit: 'second'\r\n\t},\r\n\t{\r\n\t\t// `threshold` should be the same as `threshold_for_now` on seconds.\r\n\t\tthreshold: 45.5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n \t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 2.5 minutes.\r\n\t\tthreshold: 2.5 * minute,\r\n\t\t// Allow only 5-minute increments of minutes starting from 2.5 minutes.\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\tgranularity: 5,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a minute.\r\n\t\tfactor: minute,\r\n\t\t// \"minute\" labels are used for formatting the output.\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 22.5 minutes.\r\n\t\tthreshold: 22.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in half-an-hour.\r\n\t\tfactor: 0.5 * hour,\r\n\t\t// \"half-hour\" labels are used for formatting the output.\r\n\t\t// (if available, which is no longer the case)\r\n\t\tunit: 'half-hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 42.5 minutes.\r\n\t\tthreshold: 42.5 * minute,\r\n\t\tthreshold_for_minute: 52.5 * minute,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in an hour.\r\n\t\tfactor: hour,\r\n\t\t// \"hour\" labels are used for formatting the output.\r\n\t\tunit: 'hour'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 20.5 hours.\r\n\t\tthreshold: (20.5 / 24) * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a day.\r\n\t\tfactor: day,\r\n\t\t// \"day\" labels are used for formatting the output.\r\n\t\tunit: 'day'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 5.5 days.\r\n\t\tthreshold: 5.5 * day,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a week.\r\n\t\tfactor: week,\r\n\t\t// \"week\" labels are used for formatting the output.\r\n\t\tunit: 'week'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 3.5 weeks.\r\n\t\tthreshold: 3.5 * week,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a month.\r\n\t\tfactor: month,\r\n\t\t// \"month\" labels are used for formatting the output.\r\n\t\tunit: 'month'\r\n\t},\r\n\t{\r\n\t\t// This step is effective starting from 10.5 months.\r\n\t\tthreshold: 10.5 * month,\r\n\t\t// Return the amount of minutes by dividing the amount\r\n\t\t// of seconds by the amount of seconds in a year.\r\n\t\tfactor: year,\r\n\t\t// \"year\" labels are used for formatting the output.\r\n\t\tunit: 'year'\r\n\t}\r\n]"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;eACe,CACd;EACC;EACA;EACAA,MAAM,EAAE,CAHT;EAII;EACHC,IAAI,EAAE;AALP,CADc,EAQd;EACC;EACA;EACAC,SAAS,EAAE,CAHZ;EAIC;EACAC,iBAAiB,EAAE,IALpB;EAMC;EACA;EACAH,MAAM,EAAE,CART;EASI;EACHC,IAAI,EAAE;AAVP,CARc,EAoBd;EACC;EACAC,SAAS,EAAE,IAFZ;EAGC;EACA;EACAF,MAAM,EAAEI,aALT;EAMI;EACHH,IAAI,EAAE;AAPP,CApBc,EA6Bd;EACC;EACAC,SAAS,EAAE,MAAME,aAFlB;EAGC;EACA;EACA;EACA;EACA;EACA;EACAC,WAAW,EAAE,CATd;EAUC;EACA;EACAL,MAAM,EAAEI,aAZT;EAaC;EACAH,IAAI,EAAE;AAdP,CA7Bc,EA6Cd;EACC;EACAC,SAAS,EAAE,OAAOE,aAFnB;EAGC;EACA;EACAJ,MAAM,EAAE,MAAMM,WALf;EAMC;EACA;EACAL,IAAI,EAAE;AARP,CA7Cc,EAuDd;EACC;EACAC,SAAS,EAAE,OAAOE,aAFnB;EAGCG,oBAAoB,EAAE,OAAOH,aAH9B;EAIC;EACA;EACAJ,MAAM,EAAEM,WANT;EAOC;EACAL,IAAI,EAAE;AARP,CAvDc,EAiEd;EACC;EACAC,SAAS,EAAG,OAAO,EAAR,GAAcM,UAF1B;EAGC;EACA;EACAR,MAAM,EAAEQ,UALT;EAMC;EACAP,IAAI,EAAE;AAPP,CAjEc,EA0Ed;EACC;EACAC,SAAS,EAAE,MAAMM,UAFlB;EAGC;EACA;EACAR,MAAM,EAAES,WALT;EAMC;EACAR,IAAI,EAAE;AAPP,CA1Ec,EAmFd;EACC;EACAC,SAAS,EAAE,MAAMO,WAFlB;EAGC;EACA;EACAT,MAAM,EAAEU,YALT;EAMC;EACAT,IAAI,EAAE;AAPP,CAnFc,EA4Fd;EACC;EACAC,SAAS,EAAE,OAAOQ,YAFnB;EAGC;EACA;EACAV,MAAM,EAAEW,WALT;EAMC;EACAV,IAAI,EAAE;AAPP,CA5Fc,C"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _getStep = _interopRequireDefault(require("./getStep"));
3
+ var _getStep = _interopRequireDefault(require("./getStep.js"));
4
4
 
5
- var _approximate = _interopRequireDefault(require("./approximate"));
5
+ var _approximate = _interopRequireDefault(require("./approximate.js"));
6
6
 
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
8
 
9
9
  describe('steps/approximate', function () {
10
10
  it('should get step correctly', function () {
11
11
  var getStepFor = function getStepFor(secondsPassed) {
12
- return (0, _getStep.default)(_approximate.default, secondsPassed, {
12
+ return (0, _getStep["default"])(_approximate["default"], secondsPassed, {
13
13
  now: 0,
14
14
  units: ['now', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year']
15
15
  });
@@ -35,7 +35,7 @@ describe('steps/approximate', function () {
35
35
  });
36
36
  it('should get step correctly ("now" unit not allowed)', function () {
37
37
  var getStepFor = function getStepFor(secondsPassed) {
38
- return (0, _getStep.default)(_approximate.default, secondsPassed, {
38
+ return (0, _getStep["default"])(_approximate["default"], secondsPassed, {
39
39
  now: 0,
40
40
  units: ['second', 'minute', 'hour', 'day', 'week', 'month', 'year']
41
41
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/approximate.test.js"],"names":["describe","it","getStepFor","secondsPassed","steps","now","units","expect","unit","to","equal","factor","granularity","be","undefined"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AACnCC,EAAAA,EAAE,CAAC,2BAAD,EAA8B,YAAM;AACrC,QAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;AAAA,aAAmB,sBAAQC,oBAAR,EAAeD,aAAf,EAA8B;AACnEE,QAAAA,GAAG,EAAE,CAD8D;AAEnEC,QAAAA,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,QAHM,EAIN,MAJM,EAKN,KALM,EAMN,MANM,EAON,OAPM,EAQN,MARM;AAF4D,OAA9B,CAAnB;AAAA,KAAnB;;AAcAC,IAAAA,MAAM,CAACL,UAAU,CAAC,CAAD,CAAV,CAAcM,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,CAAD,CAAV,CAAcM,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeM,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,KAArC;AAEAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeM,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeS,MAAhB,CAAN,CAA8BF,EAA9B,CAAiCC,KAAjC,CAAuC,EAAvC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeU,WAAhB,CAAN,CAAmCH,EAAnC,CAAsCI,EAAtC,CAAyCC,SAAzC;AAEAP,IAAAA,MAAM,CAACL,UAAU,CAAC,MAAM,EA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AsCC,KAAtC,CAA4C,MAA5C;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,OAAO,EAAR,CAAV,CAAsBS,MAAvB,CAAN,CAAqCF,EAArC,CAAwCC,KAAxC,CAA8C,KAAK,EAAnD;AACA,GArCC,CAAF;AAuCAT,EAAAA,EAAE,CAAC,oDAAD,EAAuD,YAAM;AAC9D,QAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;AAAA,aAAmB,sBAAQC,oBAAR,EAAeD,aAAf,EAA8B;AACnEE,QAAAA,GAAG,EAAE,CAD8D;AAEnEC,QAAAA,KAAK,EAAE,CACN,QADM,EAEN,QAFM,EAGN,MAHM,EAIN,KAJM,EAKN,MALM,EAMN,OANM,EAON,MAPM;AAF4D,OAA9B,CAAnB;AAAA,KAAnB;;AAaAC,IAAAA,MAAM,CAACL,UAAU,CAAC,CAAD,CAAX,CAAN,CAAsBO,EAAtB,CAAyBI,EAAzB,CAA4BC,SAA5B;AACAP,IAAAA,MAAM,CAACL,UAAU,CAAC,CAAD,CAAV,CAAcM,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,QAApC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeM,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;AACAH,IAAAA,MAAM,CAACL,UAAU,CAAC,EAAD,CAAV,CAAeM,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;AACA,GAlBC,CAAF;AAmBA,CA3DO,CAAR","sourcesContent":["import getStep from './getStep'\r\nimport steps from './approximate'\r\n\r\ndescribe('steps/approximate', () => {\r\n\tit('should get step correctly', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tnow: 0,\r\n\t\t\tunits: [\r\n\t\t\t\t'now',\r\n\t\t\t\t'second',\r\n\t\t\t\t'minute',\r\n\t\t\t\t'hour',\r\n\t\t\t\t'day',\r\n\t\t\t\t'week',\r\n\t\t\t\t'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(0).unit).to.equal('now')\r\n\t\texpect(getStepFor(1).unit).to.equal('now')\r\n\t\texpect(getStepFor(45).unit).to.equal('now')\r\n\r\n\t\texpect(getStepFor(46).unit).to.equal('minute')\r\n\t\texpect(getStepFor(46).factor).to.equal(60)\r\n\t\texpect(getStepFor(46).granularity).to.be.undefined\r\n\r\n\t\texpect(getStepFor(2.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(getStepFor(2.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(getStepFor(2.5 * 60 - 1).granularity).to.be.undefined\r\n\r\n\t\texpect(getStepFor(2.5 * 60).unit).to.equal('minute')\r\n\t\texpect(getStepFor(2.5 * 60).factor).to.equal(60)\r\n\t\texpect(getStepFor(2.5 * 60).granularity).to.equal(5)\r\n\r\n\t\texpect(getStepFor(52.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(getStepFor(52.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(getStepFor(52.5 * 60 - 1).granularity).to.equal(5)\r\n\r\n\t\texpect(getStepFor(52.5 * 60).unit).to.equal('hour')\r\n\t\texpect(getStepFor(52.5 * 60).factor).to.equal(60 * 60)\r\n\t})\r\n\r\n\tit('should get step correctly (\"now\" unit not allowed)', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tnow: 0,\r\n\t\t\tunits: [\r\n\t\t\t\t'second',\r\n\t\t\t\t'minute',\r\n\t\t\t\t'hour',\r\n\t\t\t\t'day',\r\n\t\t\t\t'week',\r\n\t\t\t\t'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(0)).to.be.undefined\r\n\t\texpect(getStepFor(1).unit).to.equal('second')\r\n\t\texpect(getStepFor(45).unit).to.equal('second')\r\n\t\texpect(getStepFor(46).unit).to.equal('minute')\r\n\t})\r\n})"],"file":"approximate.test.js"}
1
+ {"version":3,"file":"approximate.test.js","names":["describe","it","getStepFor","secondsPassed","getStep","steps","now","units","expect","unit","to","equal","factor","granularity","be","undefined"],"sources":["../../source/steps/approximate.test.js"],"sourcesContent":["import getStep from './getStep.js'\r\nimport steps from './approximate.js'\r\n\r\ndescribe('steps/approximate', () => {\r\n\tit('should get step correctly', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tnow: 0,\r\n\t\t\tunits: [\r\n\t\t\t\t'now',\r\n\t\t\t\t'second',\r\n\t\t\t\t'minute',\r\n\t\t\t\t'hour',\r\n\t\t\t\t'day',\r\n\t\t\t\t'week',\r\n\t\t\t\t'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(0).unit).to.equal('now')\r\n\t\texpect(getStepFor(1).unit).to.equal('now')\r\n\t\texpect(getStepFor(45).unit).to.equal('now')\r\n\r\n\t\texpect(getStepFor(46).unit).to.equal('minute')\r\n\t\texpect(getStepFor(46).factor).to.equal(60)\r\n\t\texpect(getStepFor(46).granularity).to.be.undefined\r\n\r\n\t\texpect(getStepFor(2.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(getStepFor(2.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(getStepFor(2.5 * 60 - 1).granularity).to.be.undefined\r\n\r\n\t\texpect(getStepFor(2.5 * 60).unit).to.equal('minute')\r\n\t\texpect(getStepFor(2.5 * 60).factor).to.equal(60)\r\n\t\texpect(getStepFor(2.5 * 60).granularity).to.equal(5)\r\n\r\n\t\texpect(getStepFor(52.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(getStepFor(52.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(getStepFor(52.5 * 60 - 1).granularity).to.equal(5)\r\n\r\n\t\texpect(getStepFor(52.5 * 60).unit).to.equal('hour')\r\n\t\texpect(getStepFor(52.5 * 60).factor).to.equal(60 * 60)\r\n\t})\r\n\r\n\tit('should get step correctly (\"now\" unit not allowed)', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tnow: 0,\r\n\t\t\tunits: [\r\n\t\t\t\t'second',\r\n\t\t\t\t'minute',\r\n\t\t\t\t'hour',\r\n\t\t\t\t'day',\r\n\t\t\t\t'week',\r\n\t\t\t\t'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(0)).to.be.undefined\r\n\t\texpect(getStepFor(1).unit).to.equal('second')\r\n\t\texpect(getStepFor(45).unit).to.equal('second')\r\n\t\texpect(getStepFor(46).unit).to.equal('minute')\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,mBAAD,EAAsB,YAAM;EACnCC,EAAE,CAAC,2BAAD,EAA8B,YAAM;IACrC,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;MAAA,OAAmB,IAAAC,mBAAA,EAAQC,uBAAR,EAAeF,aAAf,EAA8B;QACnEG,GAAG,EAAE,CAD8D;QAEnEC,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,QAHM,EAIN,MAJM,EAKN,KALM,EAMN,MANM,EAON,OAPM,EAQN,MARM;MAF4D,CAA9B,CAAnB;IAAA,CAAnB;;IAcAC,MAAM,CAACN,UAAU,CAAC,CAAD,CAAV,CAAcO,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;IACAH,MAAM,CAACN,UAAU,CAAC,CAAD,CAAV,CAAcO,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;IACAH,MAAM,CAACN,UAAU,CAAC,EAAD,CAAV,CAAeO,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,KAArC;IAEAH,MAAM,CAACN,UA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19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = getStep;
6
+ exports["default"] = getStep;
7
7
 
8
- var _getStepDenominator = _interopRequireDefault(require("./getStepDenominator"));
8
+ var _getStepDenominator = _interopRequireDefault(require("./getStepDenominator.js"));
9
9
 
10
- var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime"));
10
+ var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime.js"));
11
11
 
12
- var _round = require("../round");
12
+ var _round = require("../round.js");
13
13
 
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
19
 
18
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
21
 
@@ -95,7 +97,7 @@ function _getStep(steps, secondsPassed, _ref2) {
95
97
 
96
98
  if (step.granularity) {
97
99
  // Recalculate the amount of seconds passed based on `granularity`.
98
- var secondsPassedGranular = (0, _round.getRoundFunction)(round)(Math.abs(secondsPassed) / (0, _getStepDenominator.default)(step) / step.granularity) * step.granularity; // If the granularity for this step is too high,
100
+ var secondsPassedGranular = (0, _round.getRoundFunction)(round)(Math.abs(secondsPassed) / (0, _getStepDenominator["default"])(step) / step.granularity) * step.granularity; // If the granularity for this step is too high,
99
101
  // then fall back to the previous step.
100
102
  // (if there is any previous step)
101
103
 
@@ -119,7 +121,7 @@ function _getStep(steps, secondsPassed, _ref2) {
119
121
 
120
122
  function getStepIndex(steps, secondsPassed, options) {
121
123
  var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
122
- var minTime = (0, _getStepMinTime.default)(steps[i], _objectSpread({
124
+ var minTime = (0, _getStepMinTime["default"])(steps[i], _objectSpread({
123
125
  prevStep: steps[i - 1],
124
126
  timestamp: options.now - secondsPassed * 1000
125
127
  }, options)); // If `minTime` isn't defined or deduceable for this step, then stop.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStep.js"],"names":["getStep","steps","secondsPassed","now","future","round","units","getNextStep","filterStepsByUnits","step","_getStep","prevStep","indexOf","nextStep","undefined","length","i","getStepIndex","granularity","secondsPassedGranular","Math","abs","options","minTime","timestamp","filter","unit","formatAs"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;AAsBe,SAASA,OAAT,CAAiBC,KAAjB,EAAwBC,aAAxB,QAAmF;AAAA,MAA1CC,GAA0C,QAA1CA,GAA0C;AAAA,MAArCC,MAAqC,QAArCA,MAAqC;AAAA,MAA7BC,KAA6B,QAA7BA,KAA6B;AAAA,MAAtBC,KAAsB,QAAtBA,KAAsB;AAAA,MAAfC,WAAe,QAAfA,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AAMA,SAASR,kBAAT,CAA4BP,KAA5B,EAAmCK,KAAnC,EAA0C;AACzC,SAAOL,KAAK,CAACwB,MAAN,CAAa,iBAAwB;AAAA,QAArBC,IAAqB,SAArBA,IAAqB;AAAA,QAAfC,QAAe,SAAfA,QAAe;AAC3C;AACAD,IAAAA,IAAI,GAAGA,IAAI,IAAIC,QAAf,CAF2C,CAG3C;AACA;;AACA,QAAID,IAAJ,EAAU;AACT,aAAOpB,KAAK,CAACM,OAAN,CAAcc,IAAd,KAAuB,CAA9B;AACA,KAP0C,CAQ3C;AACA;AACA;;;AACA,WAAO,IAAP;AACA,GAZM,CAAP;AAaA","sourcesContent":["import getStepDenominator from './getStepDenominator'\r\nimport getStepMinTime from './getStepMinTime'\r\nimport { getRoundFunction } from '../round'\r\n\r\n/**\r\n * Finds an appropriate `step` of `steps` for the time interval (in seconds).\r\n *\r\n * @param {Object[]} steps - Time formatting steps.\r\n *\r\n * @param {number} secondsPassed - Time interval (in seconds).\r\n * `< 0` for past dates and `> 0` for future dates.\r\n *\r\n * @param {number} options.now - Current timestamp.\r\n *\r\n * @param {boolean} [options.future] - Whether the date should be formatted as a future one\r\n * instead of a past one.\r\n *\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n *\r\n * @param {string[]} [options.units] - A list of allowed time units.\r\n * (Example: ['second', 'minute', 'hour', …])\r\n *\r\n * @param {boolean} [options.getNextStep] - Pass true to return `[step, nextStep]` instead of just `step`.\r\n *\r\n * @return {Object|Object[]} [step] — Either a `step` or `[prevStep, step, nextStep]`.\r\n */\r\nexport default function getStep(steps, secondsPassed, { now, future, round, units, getNextStep }) {\r\n\t// Ignore steps having not-supported time units in `formatAs`.\r\n\tsteps = filterStepsByUnits(steps, units)\r\n\tconst step = _getStep(steps, secondsPassed, { now, future, round })\r\n\tif (getNextStep) {\r\n\t\tif (step) {\r\n\t\t\tconst prevStep = steps[steps.indexOf(step) - 1]\r\n\t\t\tconst nextStep = steps[steps.indexOf(step) + 1]\r\n\t\t\treturn [prevStep, step, nextStep]\r\n\t\t}\r\n\t\treturn [undefined, undefined, steps[0]]\r\n\t}\r\n\treturn step\r\n}\r\n\r\nfunction _getStep(steps, secondsPassed, { now, future, round }) {\r\n\t// If no steps fit the conditions then return nothing.\r\n\tif (steps.length === 0) {\r\n\t\treturn\r\n\t}\r\n\r\n\t// Find the most appropriate step.\r\n\tconst i = getStepIndex(steps, secondsPassed, {\r\n\t\tnow,\r\n\t\tfuture: future || secondsPassed < 0,\r\n\t\tround\r\n\t})\r\n\r\n\t// If no step is applicable the return nothing.\r\n\tif (i === -1) {\r\n\t\treturn\r\n\t}\r\n\r\n\tconst step = steps[i]\r\n\r\n\t// Apply granularity to the time amount\r\n\t// (and fall back to the previous step\r\n\t// if the first level of granularity\r\n\t// isn't met by this amount)\r\n\tif (step.granularity) {\r\n\t\t// Recalculate the amount of seconds passed based on `granularity`.\r\n\t\tconst secondsPassedGranular = getRoundFunction(round)((Math.abs(secondsPassed) / getStepDenominator(step)) / step.granularity) * step.granularity\r\n\t\t// If the granularity for this step is too high,\r\n\t\t// then fall back to the previous step.\r\n\t\t// (if there is any previous step)\r\n\t\tif (secondsPassedGranular === 0 && i > 0) {\r\n\t\t\treturn steps[i - 1]\r\n\t\t}\r\n\t}\r\n\r\n\treturn step\r\n}\r\n\r\n/**\r\n * Iterates through steps until it finds the maximum one satisfying the `minTime` threshold.\r\n * @param {Object} steps - Steps.\r\n * @param {number} secondsPassed - How much seconds have passed since the date till `now`.\r\n * @param {number} options.now - Current timestamp.\r\n * @param {boolean} options.future - Whether the time interval should be formatted as a future one.\r\n * @param {number} [i] - Gradation step currently being tested.\r\n * @return {number} Gradation step index.\r\n */\r\nfunction getStepIndex(steps, secondsPassed, options, i = 0) {\r\n\tconst minTime = getStepMinTime(steps[i], {\r\n\t\tprevStep: steps[i - 1],\r\n\t\ttimestamp: options.now - secondsPassed * 1000,\r\n\t\t...options\r\n\t})\r\n\t// If `minTime` isn't defined or deduceable for this step, then stop.\r\n\tif (minTime === undefined) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If the `minTime` threshold for moving from previous step\r\n\t// to this step is too high then return the previous step.\r\n\tif (Math.abs(secondsPassed) < minTime) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If it's the last step then return it.\r\n\tif (i === steps.length - 1) {\r\n\t\treturn i\r\n\t}\r\n\t// Move to the next step.\r\n\treturn getStepIndex(steps, secondsPassed, options, i + 1)\r\n}\r\n\r\n/**\r\n * Leaves only allowed steps.\r\n * @param {Object[]} steps\r\n * @param {string[]} units - Allowed time units.\r\n * @return {Object[]}\r\n */\r\nfunction filterStepsByUnits(steps, units) {\r\n\treturn steps.filter(({ unit, formatAs }) => {\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tunit = unit || formatAs\r\n\t\t// If this step has a `unit` defined\r\n\t\t// then this `unit` must be in the list of allowed `units`.\r\n\t\tif (unit) {\r\n\t\t\treturn units.indexOf(unit) >= 0\r\n\t\t}\r\n\t\t// A step is not required to specify a `unit`:\r\n\t\t// alternatively, it could specify `format()`.\r\n\t\t// (see \"twitter\" style for an example)\r\n\t\treturn true\r\n\t})\r\n}"],"file":"getStep.js"}
1
+ {"version":3,"file":"getStep.js","names":["getStep","steps","secondsPassed","now","future","round","units","getNextStep","filterStepsByUnits","step","_getStep","prevStep","indexOf","nextStep","undefined","length","i","getStepIndex","granularity","secondsPassedGranular","getRoundFunction","Math","abs","getStepDenominator","options","minTime","getStepMinTime","timestamp","filter","unit","formatAs"],"sources":["../../source/steps/getStep.js"],"sourcesContent":["import getStepDenominator from './getStepDenominator.js'\r\nimport getStepMinTime from './getStepMinTime.js'\r\nimport { getRoundFunction } from '../round.js'\r\n\r\n/**\r\n * Finds an appropriate `step` of `steps` for the time interval (in seconds).\r\n *\r\n * @param {Object[]} steps - Time formatting steps.\r\n *\r\n * @param {number} secondsPassed - Time interval (in seconds).\r\n * `< 0` for past dates and `> 0` for future dates.\r\n *\r\n * @param {number} options.now - Current timestamp.\r\n *\r\n * @param {boolean} [options.future] - Whether the date should be formatted as a future one\r\n * instead of a past one.\r\n *\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n *\r\n * @param {string[]} [options.units] - A list of allowed time units.\r\n * (Example: ['second', 'minute', 'hour', …])\r\n *\r\n * @param {boolean} [options.getNextStep] - Pass true to return `[step, nextStep]` instead of just `step`.\r\n *\r\n * @return {Object|Object[]} [step] — Either a `step` or `[prevStep, step, nextStep]`.\r\n */\r\nexport default function getStep(steps, secondsPassed, { now, future, round, units, getNextStep }) {\r\n\t// Ignore steps having not-supported time units in `formatAs`.\r\n\tsteps = filterStepsByUnits(steps, units)\r\n\tconst step = _getStep(steps, secondsPassed, { now, future, round })\r\n\tif (getNextStep) {\r\n\t\tif (step) {\r\n\t\t\tconst prevStep = steps[steps.indexOf(step) - 1]\r\n\t\t\tconst nextStep = steps[steps.indexOf(step) + 1]\r\n\t\t\treturn [prevStep, step, nextStep]\r\n\t\t}\r\n\t\treturn [undefined, undefined, steps[0]]\r\n\t}\r\n\treturn step\r\n}\r\n\r\nfunction _getStep(steps, secondsPassed, { now, future, round }) {\r\n\t// If no steps fit the conditions then return nothing.\r\n\tif (steps.length === 0) {\r\n\t\treturn\r\n\t}\r\n\r\n\t// Find the most appropriate step.\r\n\tconst i = getStepIndex(steps, secondsPassed, {\r\n\t\tnow,\r\n\t\tfuture: future || secondsPassed < 0,\r\n\t\tround\r\n\t})\r\n\r\n\t// If no step is applicable the return nothing.\r\n\tif (i === -1) {\r\n\t\treturn\r\n\t}\r\n\r\n\tconst step = steps[i]\r\n\r\n\t// Apply granularity to the time amount\r\n\t// (and fall back to the previous step\r\n\t// if the first level of granularity\r\n\t// isn't met by this amount)\r\n\tif (step.granularity) {\r\n\t\t// Recalculate the amount of seconds passed based on `granularity`.\r\n\t\tconst secondsPassedGranular = getRoundFunction(round)((Math.abs(secondsPassed) / getStepDenominator(step)) / step.granularity) * step.granularity\r\n\t\t// If the granularity for this step is too high,\r\n\t\t// then fall back to the previous step.\r\n\t\t// (if there is any previous step)\r\n\t\tif (secondsPassedGranular === 0 && i > 0) {\r\n\t\t\treturn steps[i - 1]\r\n\t\t}\r\n\t}\r\n\r\n\treturn step\r\n}\r\n\r\n/**\r\n * Iterates through steps until it finds the maximum one satisfying the `minTime` threshold.\r\n * @param {Object} steps - Steps.\r\n * @param {number} secondsPassed - How much seconds have passed since the date till `now`.\r\n * @param {number} options.now - Current timestamp.\r\n * @param {boolean} options.future - Whether the time interval should be formatted as a future one.\r\n * @param {number} [i] - Gradation step currently being tested.\r\n * @return {number} Gradation step index.\r\n */\r\nfunction getStepIndex(steps, secondsPassed, options, i = 0) {\r\n\tconst minTime = getStepMinTime(steps[i], {\r\n\t\tprevStep: steps[i - 1],\r\n\t\ttimestamp: options.now - secondsPassed * 1000,\r\n\t\t...options\r\n\t})\r\n\t// If `minTime` isn't defined or deduceable for this step, then stop.\r\n\tif (minTime === undefined) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If the `minTime` threshold for moving from previous step\r\n\t// to this step is too high then return the previous step.\r\n\tif (Math.abs(secondsPassed) < minTime) {\r\n\t\treturn i - 1\r\n\t}\r\n\t// If it's the last step then return it.\r\n\tif (i === steps.length - 1) {\r\n\t\treturn i\r\n\t}\r\n\t// Move to the next step.\r\n\treturn getStepIndex(steps, secondsPassed, options, i + 1)\r\n}\r\n\r\n/**\r\n * Leaves only allowed steps.\r\n * @param {Object[]} steps\r\n * @param {string[]} units - Allowed time units.\r\n * @return {Object[]}\r\n */\r\nfunction filterStepsByUnits(steps, units) {\r\n\treturn steps.filter(({ unit, formatAs }) => {\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tunit = unit || formatAs\r\n\t\t// If this step has a `unit` defined\r\n\t\t// then this `unit` must be in the list of allowed `units`.\r\n\t\tif (unit) {\r\n\t\t\treturn units.indexOf(unit) >= 0\r\n\t\t}\r\n\t\t// A step is not required to specify a `unit`:\r\n\t\t// alternatively, it could specify `format()`.\r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EACA,IAAIC,OAAO,KAAKX,SAAhB,EAA2B;IAC1B,OAAOE,CAAC,GAAG,CAAX;EACA,CAT0D,CAU3D;EACA;;;EACA,IAAIK,IAAI,CAACC,GAAL,CAASpB,aAAT,IAA0BuB,OAA9B,EAAuC;IACtC,OAAOT,CAAC,GAAG,CAAX;EACA,CAd0D,CAe3D;;;EACA,IAAIA,CAAC,KAAKf,KAAK,CAACc,MAAN,GAAe,CAAzB,EAA4B;IAC3B,OAAOC,CAAP;EACA,CAlB0D,CAmB3D;;;EACA,OAAOC,YAAY,CAAChB,KAAD,EAAQC,aAAR,EAAuBsB,OAAvB,EAAgCR,CAAC,GAAG,CAApC,CAAnB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASR,kBAAT,CAA4BP,KAA5B,EAAmCK,KAAnC,EAA0C;EACzC,OAAOL,KAAK,CAAC2B,MAAN,CAAa,iBAAwB;IAAA,IAArBC,IAAqB,SAArBA,IAAqB;IAAA,IAAfC,QAAe,SAAfA,QAAe;IAC3C;IACAD,IAAI,GAAGA,IAAI,IAAIC,QAAf,CAF2C,CAG3C;IACA;;IACA,IAAID,IAAJ,EAAU;MACT,OAAOvB,KAAK,CAACM,OAAN,CAAciB,IAAd,KAAuB,CAA9B;IACA,CAP0C,CAQ3C;IACA;IACA;;;IACA,OAAO,IAAP;EACA,CAZM,CAAP;AAaA"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _getStep = _interopRequireDefault(require("./getStep"));
3
+ var _getStep = _interopRequireDefault(require("./getStep.js"));
4
4
 
5
- var _round = _interopRequireDefault(require("./round"));
5
+ var _round = _interopRequireDefault(require("./round.js"));
6
6
 
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
8
 
9
9
  describe('getStep', function () {
10
10
  it('should return nothing if no time units are supported', function () {
11
- expect((0, _getStep.default)(_round.default, 0, {
11
+ expect((0, _getStep["default"])(_round["default"], 0, {
12
12
  units: ['femtosecond']
13
13
  })).to.be.undefined;
14
14
  }); // it('should throw if a non-first step does not have a `minTime` or `test()`', () => {
@@ -22,18 +22,18 @@ describe('getStep', function () {
22
22
  // })
23
23
 
24
24
  it('should fall back to previous step if granularity is too high for the next step', function () {
25
- var steps = _round.default.slice();
25
+ var steps = _round["default"].slice();
26
26
 
27
27
  steps[1].formatAs.should.equal('second');
28
28
  steps[1].granularity = 3;
29
- (0, _getStep.default)(steps, 1.49, {
29
+ (0, _getStep["default"])(steps, 1.49, {
30
30
  now: 0,
31
31
  units: ['now', 'second']
32
32
  }).formatAs.should.equal('now'); // And if there's no previous step, then use the current one.
33
33
 
34
34
  var firstStep = steps[0];
35
35
  steps.splice(0, 1);
36
- (0, _getStep.default)(steps, 1.49, {
36
+ (0, _getStep["default"])(steps, 1.49, {
37
37
  now: 0,
38
38
  units: ['now', 'second']
39
39
  }).formatAs.should.equal('second');
@@ -41,35 +41,35 @@ describe('getStep', function () {
41
41
  delete steps[1].granularity;
42
42
  });
43
43
  it('should support `minTime` object', function () {
44
- expect((0, _getStep.default)([{
44
+ expect((0, _getStep["default"])([{
45
45
  unit: 'second'
46
46
  }, {
47
47
  minTime: {
48
- default: 10
48
+ "default": 10
49
49
  },
50
50
  unit: 'minute'
51
51
  }], 5, {
52
52
  now: 0,
53
53
  units: ['second', 'minute']
54
54
  }).unit).to.equal('second');
55
- expect((0, _getStep.default)([{
55
+ expect((0, _getStep["default"])([{
56
56
  unit: 'second'
57
57
  }, {
58
58
  minTime: {
59
- default: 10
59
+ "default": 10
60
60
  },
61
61
  unit: 'minute'
62
62
  }], 10, {
63
63
  now: 0,
64
64
  units: ['second', 'minute']
65
65
  }).unit).to.equal('minute');
66
- expect((0, _getStep.default)([{
66
+ expect((0, _getStep["default"])([{
67
67
  id: 'seconds',
68
68
  unit: 'second'
69
69
  }, {
70
70
  minTime: {
71
71
  seconds: 20,
72
- default: 10
72
+ "default": 10
73
73
  },
74
74
  unit: 'minute'
75
75
  }], 10, {
@@ -78,7 +78,7 @@ describe('getStep', function () {
78
78
  }).unit).to.equal('second');
79
79
  });
80
80
  it('should support legacy `threshold()` function', function () {
81
- expect((0, _getStep.default)([{
81
+ expect((0, _getStep["default"])([{
82
82
  unit: 'second'
83
83
  }, {
84
84
  threshold: function threshold() {
@@ -89,7 +89,7 @@ describe('getStep', function () {
89
89
  now: 0,
90
90
  units: ['second', 'minute']
91
91
  }).unit).to.equal('second');
92
- expect((0, _getStep.default)([{
92
+ expect((0, _getStep["default"])([{
93
93
  unit: 'second'
94
94
  }, {
95
95
  threshold: function threshold() {
@@ -102,7 +102,7 @@ describe('getStep', function () {
102
102
  }).unit).to.equal('minute');
103
103
  });
104
104
  it('should stop when reaching a step that has no "minTime" and for which "minTime" could not be deduced', function () {
105
- expect((0, _getStep.default)([{
105
+ expect((0, _getStep["default"])([{
106
106
  formatAs: 'second'
107
107
  }, {
108
108
  formatAs: 'unsupported-time-unit'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStep.test.js"],"names":["describe","it","expect","round","units","to","be","undefined","steps","slice","formatAs","should","equal","granularity","now","firstStep","splice","unshift","unit","minTime","default","id","seconds","threshold"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,SAAD,EAAY,YAAM;AACzBC,EAAAA,EAAE,CAAC,sDAAD,EAAyD,YAAM;AAChEC,IAAAA,MAAM,CAAC,sBAAQC,cAAR,EAAe,CAAf,EAAkB;AAAEC,MAAAA,KAAK,EAAE,CAAC,aAAD;AAAT,KAAlB,CAAD,CAAN,CAAsDC,EAAtD,CAAyDC,EAAzD,CAA4DC,SAA5D;AACA,GAFC,CAAF,CADyB,CAKzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAN,EAAAA,EAAE,CAAC,gFAAD,EAAmF,YAAM;AAC1F,QAAMO,KAAK,GAAGL,eAAMM,KAAN,EAAd;;AAEAD,IAAAA,KAA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KADD,EAEC;AACCK,MAAAA,SAAS,EAAE;AAAA,eAAM,EAAN;AAAA,OADZ;AAECL,MAAAA,IAAI,EAAE;AAFP,KAFD,CADM,EAQN,EARM,EASN;AAAEJ,MAAAA,GAAG,EAAE,CAAP;AAAUV,MAAAA,KAAK,EAAE,CAAC,QAAD,EAAW,QAAX;AAAjB,KATM,EAULc,IAVI,CAAN,CAUQb,EAVR,CAUWO,KAVX,CAUiB,QAVjB;AAWA,GAxBC,CAAF;AA0BAX,EAAAA,EAAE,CAAC,qGAAD,EAAwG,YAAM;AAC/GC,IAAAA,MAAM,CAAC,sBACN,CACC;AAAEQ,MAAAA,QAAQ,EAAE;AAAZ,KADD,EAEC;AAAEA,MAAAA,QAAQ,EAAE;AAAZ,KAFD,CADM,EAKN,EALM,EAMN;AAAEI,MAAAA,GAAG,EAAE,CAAP;AAAUV,MAAAA,KAAK,EAAE,CAAC,QAAD,EAAW,uBAAX;AAAjB,KANM,EAOLM,QAPI,CAAN,CAOYL,EAPZ,CAOeO,KAPf,CAOqB,QAPrB;AAQA,GATC,CAAF;AAUA,CAnHO,CAAR","sourcesContent":["import getStep from './getStep'\r\nimport round from './round'\r\n\r\ndescribe('getStep', () => {\r\n\tit('should return nothing if no time units are supported', () => {\r\n\t\texpect(getStep(round, 0, { units: ['femtosecond'] })).to.be.undefined\r\n\t})\r\n\r\n\t// it('should throw if a non-first step does not have a `minTime` or `test()`', () => {\r\n\t// \texpect(getStep([{ unit: 'second' }], 2, { units: ['second'] })).to.deep.equal({ unit: 'second' })\r\n\t//\r\n\t// \texpect(() => {\r\n\t// \t\tgetStep([{ unit: 'second' }, { unit: 'minute' }], 2, { units: ['second', 'minute'] })\r\n\t// \t}).to.throw(\r\n\t// \t\t'Each step must define either `minTime` or `test()`, except for the first one. Got \"undefined\", undefined. Step: {\"unit\":\"minute\"}'\r\n\t// \t)\r\n\t// })\r\n\r\n\tit('should fall back to previous step if granularity is too high for the next step', () => {\r\n\t\tconst steps = round.slice()\r\n\r\n\t\tsteps[1].formatAs.should.equal('second')\r\n\t\tsteps[1].granularity = 3\r\n\r\n\t\tgetStep(steps, 1.49, { now: 0, units: ['now', 'second'] }).formatAs.should.equal('now')\r\n\r\n\t\t// And if there's no previous step, then use the current one.\r\n\r\n\t\tconst firstStep = steps[0]\r\n\t\tsteps.splice(0, 1)\r\n\r\n\t\tgetStep(steps, 1.49, { now: 0, units: ['now', 'second'] }).formatAs.should.equal('second')\r\n\r\n\t\tsteps.unshift(firstStep)\r\n\r\n\t\tdelete steps[1].granularity\r\n\t})\r\n\r\n\tit('should support `minTime` object', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: { default: 10 },\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t5,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: { default: 10 },\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('minute')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 'seconds',\r\n\t\t\t\t\tunit: 'second'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: {\r\n\t\t\t\t\t\tseconds: 20,\r\n\t\t\t\t\t\tdefault: 10\r\n\t\t\t\t\t},\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\t})\r\n\r\n\tit('should support legacy `threshold()` function', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tthreshold: () => 10,\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t5,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tthreshold: () => 10,\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('minute')\r\n\t})\r\n\r\n\tit('should stop when reaching a step that has no \"minTime\" and for which \"minTime\" could not be deduced', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ formatAs: 'second' },\r\n\t\t\t\t{ formatAs: 'unsupported-time-unit' }\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'unsupported-time-unit'] }\r\n\t\t).formatAs).to.equal('second')\r\n\t})\r\n})"],"file":"getStep.test.js"}
1
+ {"version":3,"file":"getStep.test.js","names":["describe","it","expect","getStep","round","units","to","be","undefined","steps","slice","formatAs","should","equal","granularity","now","firstStep","splice","unshift","unit","minTime","id","seconds","threshold"],"sources":["../../source/steps/getStep.test.js"],"sourcesContent":["import getStep from './getStep.js'\r\nimport round from './round.js'\r\n\r\ndescribe('getStep', () => {\r\n\tit('should return nothing if no time units are supported', () => {\r\n\t\texpect(getStep(round, 0, { units: ['femtosecond'] })).to.be.undefined\r\n\t})\r\n\r\n\t// it('should throw if a non-first step does not have a `minTime` or `test()`', () => {\r\n\t// \texpect(getStep([{ unit: 'second' }], 2, { units: ['second'] })).to.deep.equal({ unit: 'second' })\r\n\t//\r\n\t// \texpect(() => {\r\n\t// \t\tgetStep([{ unit: 'second' }, { unit: 'minute' }], 2, { units: ['second', 'minute'] })\r\n\t// \t}).to.throw(\r\n\t// \t\t'Each step must define either `minTime` or `test()`, except for the first one. Got \"undefined\", undefined. Step: {\"unit\":\"minute\"}'\r\n\t// \t)\r\n\t// })\r\n\r\n\tit('should fall back to previous step if granularity is too high for the next step', () => {\r\n\t\tconst steps = round.slice()\r\n\r\n\t\tsteps[1].formatAs.should.equal('second')\r\n\t\tsteps[1].granularity = 3\r\n\r\n\t\tgetStep(steps, 1.49, { now: 0, units: ['now', 'second'] }).formatAs.should.equal('now')\r\n\r\n\t\t// And if there's no previous step, then use the current one.\r\n\r\n\t\tconst firstStep = steps[0]\r\n\t\tsteps.splice(0, 1)\r\n\r\n\t\tgetStep(steps, 1.49, { now: 0, units: ['now', 'second'] }).formatAs.should.equal('second')\r\n\r\n\t\tsteps.unshift(firstStep)\r\n\r\n\t\tdelete steps[1].granularity\r\n\t})\r\n\r\n\tit('should support `minTime` object', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: { default: 10 },\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t5,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: { default: 10 },\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('minute')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 'seconds',\r\n\t\t\t\t\tunit: 'second'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tminTime: {\r\n\t\t\t\t\t\tseconds: 20,\r\n\t\t\t\t\t\tdefault: 10\r\n\t\t\t\t\t},\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\t})\r\n\r\n\tit('should support legacy `threshold()` function', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tthreshold: () => 10,\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t5,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('second')\r\n\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ unit: 'second' },\r\n\t\t\t\t{\r\n\t\t\t\t\tthreshold: () => 10,\r\n\t\t\t\t\tunit: 'minute'\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'minute'] }\r\n\t\t).unit).to.equal('minute')\r\n\t})\r\n\r\n\tit('should stop when reaching a step that has no \"minTime\" and for which \"minTime\" could not be deduced', () => {\r\n\t\texpect(getStep(\r\n\t\t\t[\r\n\t\t\t\t{ formatAs: 'second' },\r\n\t\t\t\t{ formatAs: 'unsupported-time-unit' }\r\n\t\t\t],\r\n\t\t\t10,\r\n\t\t\t{ now: 0, units: ['second', 'unsupported-time-unit'] }\r\n\t\t).formatAs).to.equal('second')\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,SAAD,EAAY,YAAM;EACzBC,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChEC,MAAM,CAAC,IAAAC,mBAAA,EAAQC,iBAAR,EAAe,CAAf,EAAkB;MAAEC,KAAK,EAAE,CAAC,aAAD;IAAT,CAAlB,CAAD,CAAN,C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IAAR,CADD,EAEC;MACCI,SAAS,EAAE;QAAA,OAAM,EAAN;MAAA,CADZ;MAECJ,IAAI,EAAE;IAFP,CAFD,CADM,EAQN,EARM,EASN;MAAEJ,GAAG,EAAE,CAAP;MAAUV,KAAK,EAAE,CAAC,QAAD,EAAW,QAAX;IAAjB,CATM,EAULc,IAVI,CAAN,CAUQb,EAVR,CAUWO,KAVX,CAUiB,QAVjB;EAWA,CAxBC,CAAF;EA0BAZ,EAAE,CAAC,qGAAD,EAAwG,YAAM;IAC/GC,MAAM,CAAC,IAAAC,mBAAA,EACN,CACC;MAAEQ,QAAQ,EAAE;IAAZ,CADD,EAEC;MAAEA,QAAQ,EAAE;IAAZ,CAFD,CADM,EAKN,EALM,EAMN;MAAEI,GAAG,EAAE,CAAP;MAAUV,KAAK,EAAE,CAAC,QAAD,EAAW,uBAAX;IAAjB,CANM,EAOLM,QAPI,CAAN,CAOYL,EAPZ,CAOeO,KAPf,CAOqB,QAPrB;EAQA,CATC,CAAF;AAUA,CAnHO,CAAR"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = getStepDenominator;
6
+ exports["default"] = getStepDenominator;
7
7
 
8
- var _units = require("./units");
8
+ var _units = require("./units.js");
9
9
 
10
10
  function getStepDenominator(step) {
11
11
  // `factor` is a legacy property.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepDenominator.js"],"names":["getStepDenominator","step","factor","undefined","unit","formatAs"],"mappings":";;;;;;;AAAA;;AAEe,SAASA,kBAAT,CAA4BC,IAA5B,EAAkC;AAChD;AACA,MAAIA,IAAI,CAACC,MAAL,KAAgBC,SAApB,EAA+B;AAC9B,WAAOF,IAAI,CAACC,MAAZ;AACA,GAJ+C,CAKhD;;;AACA,SAAO,6BAAiBD,IAAI,CAACG,IAAL,IAAaH,IAAI,CAACI,QAAnC,KAAgD,CAAvD;AACA","sourcesContent":["import { getSecondsInUnit } from './units'\r\n\r\nexport default function getStepDenominator(step) {\r\n\t// `factor` is a legacy property.\r\n\tif (step.factor !== undefined) {\r\n\t\treturn step.factor\r\n\t}\r\n\t// \"unit\" is now called \"formatAs\".\r\n\treturn getSecondsInUnit(step.unit || step.formatAs) || 1\r\n}"],"file":"getStepDenominator.js"}
1
+ {"version":3,"file":"getStepDenominator.js","names":["getStepDenominator","step","factor","undefined","getSecondsInUnit","unit","formatAs"],"sources":["../../source/steps/getStepDenominator.js"],"sourcesContent":["import { getSecondsInUnit } from './units.js'\r\n\r\nexport default function getStepDenominator(step) {\r\n\t// `factor` is a legacy property.\r\n\tif (step.factor !== undefined) {\r\n\t\treturn step.factor\r\n\t}\r\n\t// \"unit\" is now called \"formatAs\".\r\n\treturn getSecondsInUnit(step.unit || step.formatAs) || 1\r\n}"],"mappings":";;;;;;;AAAA;;AAEe,SAASA,kBAAT,CAA4BC,IAA5B,EAAkC;EAChD;EACA,IAAIA,IAAI,CAACC,MAAL,KAAgBC,SAApB,EAA+B;IAC9B,OAAOF,IAAI,CAACC,MAAZ;EACA,CAJ+C,CAKhD;;;EACA,OAAO,IAAAE,uBAAA,EAAiBH,IAAI,CAACI,IAAL,IAAaJ,IAAI,CAACK,QAAnC,KAAgD,CAAvD;AACA"}
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
 
3
- var _getStepDenominator = _interopRequireDefault(require("./getStepDenominator"));
3
+ var _getStepDenominator = _interopRequireDefault(require("./getStepDenominator.js"));
4
4
 
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6
6
 
7
7
  describe('getStepDenominator', function () {
8
8
  it('should support the older "unit" name', function () {
9
- (0, _getStepDenominator.default)({
9
+ (0, _getStepDenominator["default"])({
10
10
  unit: 'minute'
11
11
  }).should.equal(60);
12
12
  });
13
13
  it('should return 1 as a default "denominator"', function () {
14
- (0, _getStepDenominator.default)({
14
+ (0, _getStepDenominator["default"])({
15
15
  formatAs: 'exotic'
16
16
  }).should.equal(1);
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepDenominator.test.js"],"names":["describe","it","unit","should","equal","formatAs"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,oBAAD,EAAuB,YAAM;AACpCC,EAAAA,EAAE,CAAC,sCAAD,EAAyC,YAAM;AAChD,qCAAmB;AAAEC,MAAAA,IAAI,EAAE;AAAR,KAAnB,EAAuCC,MAAvC,CAA8CC,KAA9C,CAAoD,EAApD;AACA,GAFC,CAAF;AAIAH,EAAAA,EAAE,CAAC,4CAAD,EAA+C,YAAM;AACtD,qCAAmB;AAAEI,MAAAA,QAAQ,EAAE;AAAZ,KAAnB,EAA2CF,MAA3C,CAAkDC,KAAlD,CAAwD,CAAxD;AACA,GAFC,CAAF;AAGA,CARO,CAAR","sourcesContent":["import getStepDenominator from './getStepDenominator'\r\n\r\ndescribe('getStepDenominator', () => {\r\n\tit('should support the older \"unit\" name', () => {\r\n\t\tgetStepDenominator({ unit: 'minute' }).should.equal(60)\r\n\t})\r\n\r\n\tit('should return 1 as a default \"denominator\"', () => {\r\n\t\tgetStepDenominator({ formatAs: 'exotic' }).should.equal(1)\r\n\t})\r\n})"],"file":"getStepDenominator.test.js"}
1
+ {"version":3,"file":"getStepDenominator.test.js","names":["describe","it","getStepDenominator","unit","should","equal","formatAs"],"sources":["../../source/steps/getStepDenominator.test.js"],"sourcesContent":["import getStepDenominator from './getStepDenominator.js'\r\n\r\ndescribe('getStepDenominator', () => {\r\n\tit('should support the older \"unit\" name', () => {\r\n\t\tgetStepDenominator({ unit: 'minute' }).should.equal(60)\r\n\t})\r\n\r\n\tit('should return 1 as a default \"denominator\"', () => {\r\n\t\tgetStepDenominator({ formatAs: 'exotic' }).should.equal(1)\r\n\t})\r\n})"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,oBAAD,EAAuB,YAAM;EACpCC,EAAE,CAAC,sCAAD,EAAyC,YAAM;IAChD,IAAAC,8BAAA,EAAmB;MAAEC,IAAI,EAAE;IAAR,CAAnB,EAAuCC,MAAvC,CAA8CC,KAA9C,CAAoD,EAApD;EACA,CAFC,CAAF;EAIAJ,EAAE,CAAC,4CAAD,EAA+C,YAAM;IACtD,IAAAC,8BAAA,EAAmB;MAAEI,QAAQ,EAAE;IAAZ,CAAnB,EAA2CF,MAA3C,CAAkDC,KAAlD,CAAwD,CAAxD;EACA,CAFC,CAAF;AAGA,CARO,CAAR"}
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = getStepMinTime;
6
+ exports["default"] = getStepMinTime;
7
7
 
8
- var _units = require("./units");
8
+ var _units = require("./units.js");
9
9
 
10
- var _round = require("../round");
10
+ var _round = require("../round.js");
11
11
 
12
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
13
 
14
14
  function getStepMinTime(step, _ref) {
15
15
  var prevStep = _ref.prevStep,
@@ -47,7 +47,7 @@ function getStepMinTime(step, _ref) {
47
47
  if (prevStep && prevStep.id && minTime[prevStep.id] !== undefined) {
48
48
  minTime = minTime[prevStep.id];
49
49
  } else {
50
- minTime = minTime.default;
50
+ minTime = minTime["default"];
51
51
  }
52
52
  }
53
53
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepMinTime.js"],"names":["getStepMinTime","step","prevStep","timestamp","now","future","round","minTime","id","unit","undefined","threshold","default","getMinTimeForUnit","toUnit","fromUnit","formatAs","test","console","warn","JSON","stringify","toUnitAmount","fromUnitAmount"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEe,SAASA,cAAT,CAAwBC,IAAxB,QAOZ;AAAA,MANFC,QAME,QANFA,QAME;AAAA,MALFC,SAKE,QALFA,SAKE;AAAA,MAHFC,GAGE,QAHFA,GAGE;AAAA,MAFFC,MAEE,QAFFA,MAEE;AAAA,MADFC,KACE,QADFA,KACE;AACF,MAAIC,OAAJ,CADE,CAEF;;AACA,MAAIL,QAAJ,EAAc;AACb,QAAIA,QAAQ,CAACM,EAAT,IAAeN,QAAQ,CAACO,IAA5B,EAAkC;AACjCF,MAAAA,OAAO,GAAGN,IAAI,yBAAkBC,QAAQ,CAACM,EAAT,IAAeN,QAAQ,CAACO,IAA1C,EAAd;AACA;AACD;;AACD,MAAIF,OAAO,KAAKG,SAAhB,EAA2B;AAC1B;AACA,QAAIT,IAAI,CAACU,SAAL,KAAmBD,SAAvB,EAAkC;AACjC;AACAH,MAAAA,OAAO,GAAGN,IAAI,CAACU,SAAf,CAFiC,CAGjC;;AACA,UAAI,OAAOJ,OAAP,KAAmB,UAAvB,EAAmC;AAClCA,QAAAA,OAAO,GAAGA,OAAO,CAACH,GAAD,EAAMC,MAAN,CAAjB;AACA;AACD;AACD;;AACD,MAAIE,OAAO,KAAKG,SAAhB,EAA2B;AAC1BH,IAAAA,OAAO,GAAGN,IAAI,CAACM,OAAf;AACA,GArBC,CAsBF;AACA;;;AACA,MAAI,QAAOA,OAAP,MAAmB,QAAvB,EAAiC;AAChC,QAAIL,QAAQ,IAAIA,QAAQ,CAACM,EAArB,IAA2BD,OAAO,CAACL,QAAQ,CAACM,EAAV,CAAP,KAAyBE,SAAxD,EAAmE;AAClEH,MAAAA,OAAO,GAAGA,OAAO,CAACL,QAAQ,CAACM,EAAV,CAAjB;AACA,KAFD,MAEO;AACND,MAAAA,OAAO,GAAGA,OAAO,CAACK,OAAl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qB,IAArB,EAA2B,CAA3B,CAA1E;AACA;;AACD,SAAOM,OAAP;AACA;;AAED,SAASM,kBAAT,CAA2BC,MAA3B,EAAmCC,QAAnC,SAAwD;AAAA,MAATT,KAAS,SAATA,KAAS;AACvD,MAAMgB,YAAY,GAAG,6BAAiBR,MAAjB,CAArB,CADuD,CAEvD;AACA;AACA;AACA;AACA;AACA;;AACA,MAAIS,cAAJ;;AACA,MAAIR,QAAQ,KAAK,KAAjB,EAAwB;AACvBQ,IAAAA,cAAc,GAAG,6BAAiBT,MAAjB,CAAjB;AACA,GAFD,MAEO;AACNS,IAAAA,cAAc,GAAG,6BAAiBR,QAAjB,CAAjB;AACA;;AACD,MAAIO,YAAY,KAAKZ,SAAjB,IAA8Ba,cAAc,KAAKb,SAArD,EAAgE;AAC/D,WAAOY,YAAY,GAAGC,cAAc,IAAI,IAAI,4CAAgCjB,KAAhC,CAAR,CAApC;AACA;AACD","sourcesContent":["import { getSecondsInUnit } from './units'\r\nimport { getDiffRatioToNextRoundedNumber } from '../round'\r\n\r\nexport default function getStepMinTime(step, {\r\n\tprevStep,\r\n\ttimestamp,\r\n\t// `now` argument is used in a deprecated `step.test()` function.\r\n\tnow,\r\n\tfuture,\r\n\tround\r\n}) {\r\n\tlet minTime\r\n\t// \"threshold_for_xxx\" is a legacy property.\r\n\tif (prevStep) {\r\n\t\tif (prevStep.id || prevStep.unit) {\r\n\t\t\tminTime = step[`threshold_for_${prevStep.id || prevStep.unit}`]\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\t// \"threshold\" is a legacy property.\r\n\t\tif (step.threshold !== undefined) {\r\n\t\t\t// \"threshold\" is a legacy name for \"minTime\".\r\n\t\t\tminTime = step.threshold\r\n\t\t\t// \"threshold\" function is deprecated.\r\n\t\t\tif (typeof minTime === 'function') {\r\n\t\t\t\tminTime = minTime(now, future)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tminTime = step.minTime\r\n\t}\r\n\t// A deprecated way of specifying a different threshold\r\n\t// depending on the previous step's unit.\r\n\tif (typeof minTime === 'object') {\r\n\t\tif (prevStep && prevStep.id && minTime[prevStep.id] !== undefined) {\r\n\t\t\tminTime = minTime[prevStep.id]\r\n\t\t} else {\r\n\t\t\tminTime = minTime.default\r\n\t\t}\r\n\t}\r\n\tif (typeof minTime === 'function') {\r\n\t\tminTime = minTime(timestamp, {\r\n\t\t\tfuture,\r\n\t\t\tgetMinTimeForUnit(toUnit, fromUnit) {\r\n\t\t\t\treturn getMinTimeForUnit(\r\n\t\t\t\t\ttoUnit,\r\n\t\t\t\t\tfromUnit || prevStep && prevStep.formatAs,\r\n\t\t\t\t\t{ round }\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\t// Evaluate the `test()` function.\r\n\t// `test()` function is deprecated.\r\n\tif (minTime === undefined) {\r\n\t\tif (step.test) {\r\n\t\t\tif (step.test(timestamp, {\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})) {\r\n\t\t\t\t// `0` threshold always passes.\r\n\t\t\t\tminTime = 0\r\n\t\t\t} else {\r\n\t\t\t\t// `MAX_SAFE_INTEGER` threshold won't ever pass in real life.\r\n\t\t\t\tminTime = 9007199254740991 // Number.MAX_SAFE_INTEGER\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tif (prevStep) {\r\n\t\t\tif (step.formatAs && prevStep.formatAs) {\r\n\t\t\t\tminTime = getMinTimeForUnit(step.formatAs, prevStep.formatAs, { round })\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// The first step's `minTime` is `0` by default.\r\n\t\t\tminTime = 0\r\n\t\t}\r\n\t}\r\n\t// Warn if no `minTime` was defined or could be deduced.\r\n\tif (minTime === undefined) {\r\n\t\tconsole.warn('[javascript-time-ago] A step should specify `minTime`:\\n' + JSON.stringify(step, null, 2))\r\n\t}\r\n\treturn minTime\r\n}\r\n\r\nfunction getMinTimeForUnit(toUnit, fromUnit, { round }) {\r\n\tconst toUnitAmount = getSecondsInUnit(toUnit)\r\n\t// if (!fromUnit) {\r\n\t// \treturn toUnitAmount;\r\n\t// }\r\n\t// if (!fromUnit) {\r\n\t// \tfromUnit = getPreviousUnitFor(toUnit)\r\n\t// }\r\n\tlet fromUnitAmount\r\n\tif (fromUnit === 'now') {\r\n\t\tfromUnitAmount = getSecondsInUnit(toUnit)\r\n\t} else {\r\n\t\tfromUnitAmount = getSecondsInUnit(fromUnit)\r\n\t}\r\n\tif (toUnitAmount !== undefined && fromUnitAmount !== undefined) {\r\n\t\treturn toUnitAmount - fromUnitAmount * (1 - getDiffRatioToNextRoundedNumber(round))\r\n\t}\r\n}"],"file":"getStepMinTime.js"}
1
+ {"version":3,"file":"getStepMinTime.js","names":["getStepMinTime","step","prevStep","timestamp","now","future","round","minTime","id","unit","undefined","threshold","getMinTimeForUnit","toUnit","fromUnit","formatAs","test","console","warn","JSON","stringify","toUnitAmount","getSecondsInUnit","fromUnitAmount","getDiffRatioToNextRoundedNumber"],"sources":["../../source/steps/getStepMinTime.js"],"sourcesContent":["import { getSecondsInUnit } from './units.js'\r\nimport { getDiffRatioToNextRoundedNumber } from '../round.js'\r\n\r\nexport default function getStepMinTime(step, {\r\n\tprevStep,\r\n\ttimestamp,\r\n\t// `now` argument is used in a deprecated `step.test()` function.\r\n\tnow,\r\n\tfuture,\r\n\tround\r\n}) {\r\n\tlet minTime\r\n\t// \"threshold_for_xxx\" is a legacy property.\r\n\tif (prevStep) {\r\n\t\tif (prevStep.id || prevStep.unit) {\r\n\t\t\tminTime = step[`threshold_for_${prevStep.id || prevStep.unit}`]\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\t// \"threshold\" is a legacy property.\r\n\t\tif (step.threshold !== undefined) {\r\n\t\t\t// \"threshold\" is a legacy name for \"minTime\".\r\n\t\t\tminTime = step.threshold\r\n\t\t\t// \"threshold\" function is deprecated.\r\n\t\t\tif (typeof minTime === 'function') {\r\n\t\t\t\tminTime = minTime(now, future)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tminTime = step.minTime\r\n\t}\r\n\t// A deprecated way of specifying a different threshold\r\n\t// depending on the previous step's unit.\r\n\tif (typeof minTime === 'object') {\r\n\t\tif (prevStep && prevStep.id && minTime[prevStep.id] !== undefined) {\r\n\t\t\tminTime = minTime[prevStep.id]\r\n\t\t} else {\r\n\t\t\tminTime = minTime.default\r\n\t\t}\r\n\t}\r\n\tif (typeof minTime === 'function') {\r\n\t\tminTime = minTime(timestamp, {\r\n\t\t\tfuture,\r\n\t\t\tgetMinTimeForUnit(toUnit, fromUnit) {\r\n\t\t\t\treturn getMinTimeForUnit(\r\n\t\t\t\t\ttoUnit,\r\n\t\t\t\t\tfromUnit || prevStep && prevStep.formatAs,\r\n\t\t\t\t\t{ round }\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\t// Evaluate the `test()` function.\r\n\t// `test()` function is deprecated.\r\n\tif (minTime === undefined) {\r\n\t\tif (step.test) {\r\n\t\t\tif (step.test(timestamp, {\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})) {\r\n\t\t\t\t// `0` threshold always passes.\r\n\t\t\t\tminTime = 0\r\n\t\t\t} else {\r\n\t\t\t\t// `MAX_SAFE_INTEGER` threshold won't ever pass in real life.\r\n\t\t\t\tminTime = 9007199254740991 // Number.MAX_SAFE_INTEGER\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minTime === undefined) {\r\n\t\tif (prevStep) {\r\n\t\t\tif (step.formatAs && prevStep.formatAs) {\r\n\t\t\t\tminTime = getMinTimeForUnit(step.formatAs, prevStep.formatAs, { round })\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// The first step's `minTime` is `0` by default.\r\n\t\t\tminTime = 0\r\n\t\t}\r\n\t}\r\n\t// Warn if no `minTime` was defined or could be deduced.\r\n\tif (minTime === undefined) {\r\n\t\tconsole.warn('[javascript-time-ago] A step should specify `minTime`:\\n' + JSON.stringify(step, null, 2))\r\n\t}\r\n\treturn minTime\r\n}\r\n\r\nfunction getMinTimeForUnit(toUnit, fromUnit, { round }) {\r\n\tconst toUnitAmount = getSecondsInUnit(toUnit)\r\n\t// if (!fromUnit) {\r\n\t// \treturn toUnitAmount;\r\n\t// }\r\n\t// if (!fromUnit) {\r\n\t// \tfromUnit = getPreviousUnitFor(toUnit)\r\n\t// }\r\n\tlet fromUnitAmount\r\n\tif (fromUnit === 'now') {\r\n\t\tfromUnitAmount = getSecondsInUnit(toUnit)\r\n\t} else {\r\n\t\tfromUnitAmount = getSecondsInUnit(fromUnit)\r\n\t}\r\n\tif (toUnitAmount !== undefined && fromUnitAmount !== undefined) {\r\n\t\treturn toUnitAmount - fromUnitAmount * (1 - getDiffRatioToNextRoundedNumber(round))\r\n\t}\r\n}"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEe,SAASA,cAAT,CAAwBC,IAAxB,QAOZ;EAAA,IANFC,QAME,QANFA,QAME;EAAA,IALFC,SAKE,QALFA,SAKE;EAAA,IAHFC,GAGE,QAHFA,GAGE;EAAA,IAFFC,MAEE,QAFFA,MAEE;EAAA,IADFC,KACE,QADFA,KACE;EACF,IAAIC,OAAJ,CADE,CAEF;;EACA,IAAIL,QAAJ,EAAc;IACb,IAAIA,QAAQ,CAACM,EAAT,IAAeN,QAAQ,CAACO,IAA5B,EAAkC;MACjCF,OAAO,GAAGN,IAAI,yBAAkBC,QAAQ,CAACM,EAAT,IAAeN,QAAQ,CAACO,IAA1C,EAAd;IACA;EACD;;EACD,IAAIF,OAAO,KAAKG,SAAhB,EAA2B;IAC1B;IACA,IAAIT,IAAI,CAACU,SAAL,KAAmBD,SAAvB,EAAkC;MACjC;MACAH,OAAO,GAAGN,IAAI,CAACU,SAAf,CAFiC,CAGjC;;MACA,IAAI,OAAOJ,OAAP,KAAmB,UAAvB,EAAmC;QAClC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AQ,CAACa,QAA9B,EAAwC;QACvCR,OAAO,GAAGK,kBAAiB,CAACX,IAAI,CAACc,QAAN,EAAgBb,QAAQ,CAACa,QAAzB,EAAmC;UAAET,KAAK,EAALA;QAAF,CAAnC,CAA3B;MACA;IACD,CAJD,MAIO;MACN;MACAC,OAAO,GAAG,CAAV;IACA;EACD,CApEC,CAqEF;;;EACA,IAAIA,OAAO,KAAKG,SAAhB,EAA2B;IAC1BO,OAAO,CAACC,IAAR,CAAa,6DAA6DC,IAAI,CAACC,SAAL,CAAenB,IAAf,EAAqB,IAArB,EAA2B,CAA3B,CAA1E;EACA;;EACD,OAAOM,OAAP;AACA;;AAED,SAASK,kBAAT,CAA2BC,MAA3B,EAAmCC,QAAnC,SAAwD;EAAA,IAATR,KAAS,SAATA,KAAS;EACvD,IAAMe,YAAY,GAAG,IAAAC,uBAAA,EAAiBT,MAAjB,CAArB,CADuD,CAEvD;EACA;EACA;EACA;EACA;EACA;;EACA,IAAIU,cAAJ;;EACA,IAAIT,QAAQ,KAAK,KAAjB,EAAwB;IACvBS,cAAc,GAAG,IAAAD,uBAAA,EAAiBT,MAAjB,CAAjB;EACA,CAFD,MAEO;IACNU,cAAc,GAAG,IAAAD,uBAAA,EAAiBR,QAAjB,CAAjB;EACA;;EACD,IAAIO,YAAY,KAAKX,SAAjB,IAA8Ba,cAAc,KAAKb,SAArD,EAAgE;IAC/D,OAAOW,YAAY,GAAGE,cAAc,IAAI,IAAI,IAAAC,sCAAA,EAAgClB,KAAhC,CAAR,CAApC;EACA;AACD"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime"));
3
+ var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime.js"));
4
4
 
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6
6
 
7
7
  describe('getStepMinTime', function () {
8
8
  it('should support `step.test()` function (returns true)', function () {
9
- (0, _getStepMinTime.default)({
9
+ (0, _getStepMinTime["default"])({
10
10
  test: function test() {
11
11
  return true;
12
12
  }
@@ -17,7 +17,7 @@ describe('getStepMinTime', function () {
17
17
  }).should.equal(0);
18
18
  });
19
19
  it('should support `step.test()` function (returns false)', function () {
20
- (0, _getStepMinTime.default)({
20
+ (0, _getStepMinTime["default"])({
21
21
  test: function test() {
22
22
  return false;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepMinTime.test.js"],"names":["describe","it","test","prevStep","minTime","should","equal"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,gBAAD,EAAmB,YAAM;AAChCC,EAAAA,EAAE,CAAC,sDAAD,EAAyD,YAAM;AAChE,iCAAe;AACdC,MAAAA,IAAI,EAAE;AAAA,eAAM,IAAN;AAAA;AADQ,KAAf,EAEG;AACFC,MAAAA,QAAQ,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AADR,KAFH,EAIGC,MAJH,CAIUC,KAJV,CAIgB,CAJhB;AAKA,GANC,CAAF;AAQAL,EAAAA,EAAE,CAAC,uDAAD,EAA0D,YAAM;AACjE,iCAAe;AACdC,MAAAA,IAAI,EAAE;AAAA,eAAM,KAAN;AAAA;AADQ,KAAf,EAEG;AACFC,MAAAA,QAAQ,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AADR,KAFH,EAIGC,MAJH,CAIUC,KAJV,CAIgB,gBAJhB;AAKA,GANC,CAAF;AAOA,CAhBO,CAAR","sourcesContent":["import getStepMinTime from './getStepMinTime'\r\n\r\ndescribe('getStepMinTime', () => {\r\n\tit('should support `step.test()` function (returns true)', () => {\r\n\t\tgetStepMinTime({\r\n\t\t\ttest: () => true\r\n\t\t}, {\r\n\t\t\tprevStep: { minTime: 1 }\r\n\t\t}).should.equal(0)\r\n\t})\r\n\r\n\tit('should support `step.test()` function (returns false)', () => {\r\n\t\tgetStepMinTime({\r\n\t\t\ttest: () => false\r\n\t\t}, {\r\n\t\t\tprevStep: { minTime: 1 }\r\n\t\t}).should.equal(9007199254740991)\r\n\t})\r\n})"],"file":"getStepMinTime.test.js"}
1
+ {"version":3,"file":"getStepMinTime.test.js","names":["describe","it","getStepMinTime","test","prevStep","minTime","should","equal"],"sources":["../../source/steps/getStepMinTime.test.js"],"sourcesContent":["import getStepMinTime from './getStepMinTime.js'\r\n\r\ndescribe('getStepMinTime', () => {\r\n\tit('should support `step.test()` function (returns true)', () => {\r\n\t\tgetStepMinTime({\r\n\t\t\ttest: () => true\r\n\t\t}, {\r\n\t\t\tprevStep: { minTime: 1 }\r\n\t\t}).should.equal(0)\r\n\t})\r\n\r\n\tit('should support `step.test()` function (returns false)', () => {\r\n\t\tgetStepMinTime({\r\n\t\t\ttest: () => false\r\n\t\t}, {\r\n\t\t\tprevStep: { minTime: 1 }\r\n\t\t}).should.equal(9007199254740991)\r\n\t})\r\n})"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,gBAAD,EAAmB,YAAM;EAChCC,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChE,IAAAC,0BAAA,EAAe;MACdC,IAAI,EAAE;QAAA,OAAM,IAAN;MAAA;IADQ,CAAf,EAEG;MACFC,QAAQ,EAAE;QAAEC,OAAO,EAAE;MAAX;IADR,CAFH,EAIGC,MAJH,CAIUC,KAJV,CAIgB,CAJhB;EAKA,CANC,CAAF;EAQAN,EAAE,CAAC,uDAAD,EAA0D,YAAM;IACjE,IAAAC,0BAAA,EAAe;MACdC,IAAI,EAAE;QAAA,OAAM,KAAN;MAAA;IADQ,CAAf,EAEG;MACFC,QAAQ,EAAE;QAAEC,OAAO,EAAE;MAAX;IADR,CAFH,EAIGC,MAJH,CAIUC,KAJV,CAIgB,gBAJhB;EAKA,CANC,CAAF;AAOA,CAhBO,CAAR"}
@@ -3,18 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = getTimeToNextUpdate;
6
+ exports.INFINITY = void 0;
7
+ exports["default"] = getTimeToNextUpdate;
7
8
  exports.getStepChangesAt = getStepChangesAt;
8
9
  exports.getTimeToStepChange = getTimeToStepChange;
9
- exports.INFINITY = void 0;
10
10
 
11
- var _getTimeToNextUpdateForUnit2 = _interopRequireDefault(require("./getTimeToNextUpdateForUnit"));
11
+ var _getTimeToNextUpdateForUnit2 = _interopRequireDefault(require("./getTimeToNextUpdateForUnit.js"));
12
12
 
13
- var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime"));
13
+ var _getStepMinTime = _interopRequireDefault(require("./getStepMinTime.js"));
14
14
 
15
- var _round = require("../round");
15
+ var _round = require("../round.js");
16
16
 
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
18
 
19
19
  // A thousand years is practically a metaphor for "infinity".
20
20
  var YEAR = 365 * 24 * 60 * 60 * 1000;
@@ -42,7 +42,7 @@ function getTimeToNextUpdate(date, step, _ref) {
42
42
  var timestamp = date.getTime ? date.getTime() : date;
43
43
 
44
44
  var getTimeToNextUpdateForUnit = function getTimeToNextUpdateForUnit(unit) {
45
- return (0, _getTimeToNextUpdateForUnit2.default)(unit, timestamp, {
45
+ return (0, _getTimeToNextUpdateForUnit2["default"])(unit, timestamp, {
46
46
  now: now,
47
47
  round: round
48
48
  });
@@ -120,7 +120,7 @@ function getStepChangesAt(currentOrNextStep, timestamp, _ref2) {
120
120
  // but it does change the wording when switching
121
121
  // from "future" to "past": "in ..." -> "... ago".
122
122
  // Therefore, the label should be updated at zero-point too.
123
- var minTime = (0, _getStepMinTime.default)(currentOrNextStep, {
123
+ var minTime = (0, _getStepMinTime["default"])(currentOrNextStep, {
124
124
  timestamp: timestamp,
125
125
  now: now,
126
126
  future: future,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getTimeToNextUpdate.js"],"names":["YEAR","INFINITY","getTimeToNextUpdate","date","step","prevStep","nextStep","now","future","round","timestamp","getTime","getTimeToNextUpdateForUnit","unit","timeToStepChange","getTimeToStepChange","undefined","timeToNextUpdate","getRoundFunction","formatAs","Math","min","getStepChangesAt","currentOrNextStep","minTime","stepChangesAt"],"mappings":";;;;;;;;;;AAAA;;AACA;;AACA;;;;AAEA;AACA,IAAMA,IAAI,GAAG,MAAM,EAAN,GAAW,EAAX,GAAgB,EAAhB,GAAqB,IAAlC;AACO,IAAMC,QAAQ,GAAG,OAAOD,IAAxB;AAEP;;;;;;;;;;;;;;AAWe,SAASE,mBAAT,CAA6BC,IAA7B,EAAmCC,IAAnC,QAAqF;AAAA,MAA1CC,QAA0C,QAA1CA,QAA0C;AAAA,MAAhCC,QAAgC,QAAhCA,QAAgC;AAAA,MAAtBC,GAAsB,QAAtBA,GAAsB;AAAA,MAAjBC,MAAiB,QAAjBA,MAAiB;AAAA,MAATC,KAAS,QAATA,KAAS;AACnG,MAAMC,SAAS,GAAGP,IAAI,CAACQ,OAAL,GAAeR,IAAI,CAACQ,OAAL,EAAf,GAAgCR,IAAlD;;AAEA,MAAMS,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,IAAD;AAAA,WAAU,0CAA4BA,IAA5B,EAAkCH,SAAlC,EAA6C;AAAEH,MAAAA,GAAG,EAAHA,GAAF;AAAOE,MAAAA,KAAK,EAALA;AAAP,KAA7C,CAAV;AAAA,GAAnC,CAHmG,CAKnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,gBAAgB,GAAGC,mBAAmB,CAACP,MAAM,GAAGJ,IAAH,GAAUE,QAAjB,EAA2BI,SAA3B,EAAsC;AACjFF,IAAAA,MAAM,EAANA,MADiF;AAEjFD,IAAAA,GAAG,EAAHA,GAFiF;AAGjFE,IAAAA,KAAK,EAALA,KAHiF;AAIjFJ,IAAAA,QAAQ,EAAEG,MAAM,GAAGH,QAAH,GAAcD,IAJmD,CAK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AAK,EAALA,KAA1B;AAAiCJ,IAAAA,QAAQ,EAARA;AAAjC,GAAlC,CAAhB;;AACA,MAAImB,OAAO,KAAKR,SAAhB,EAA2B;AAC1B;AACA;;AACD,MAAIR,MAAJ,EAAY;AACX;AACA;AACA;AACA;AACA;AACA,WAAOE,SAAS,GAAGc,OAAO,GAAG,IAAtB,GAA6B,CAApC;AACA,GAPD,MAOO;AACN;AACA;AACA;AACA;AACA;AAEA;AACA,QAAIA,OAAO,KAAK,CAAZ,IAAiBd,SAAS,KAAKH,GAAnC,EAAwC;AACvC,aAAON,QAAP;AACA;;AAED,WAAOS,SAAS,GAAGc,OAAO,GAAG,IAA7B;AACA;AACD;;AAEM,SAAST,mBAAT,CAA6BX,IAA7B,EAAmCM,SAAnC,SAKJ;AAAA,MAJFH,GAIE,SAJFA,GAIE;AAAA,MAHFC,MAGE,SAHFA,MAGE;AAAA,MAFFC,KAEE,SAFFA,KAEE;AAAA,MADFJ,QACE,SADFA,QACE;;AACF,MAAID,IAAJ,EAAU;AACT,QAAMqB,aAAa,GAAGH,gBAAgB,CAAClB,IAAD,EAAOM,SAAP,EAAkB;AACvDH,MAAAA,GAAG,EAAHA,GADuD;AAEvDC,MAAAA,MAAM,EAANA,MAFuD;AAGvDC,MAAAA,KAAK,EAALA,KAHuD;AAIvDJ,MAAAA,QAAQ,EAARA;AAJuD,KAAlB,CAAtC;;AAMA,QAAIoB,aAAa,KAAKT,SAAtB,EAAiC;AAChC;AACA;;AACD,WAAOS,aAAa,GAAGlB,GAAvB;AACA,GAXD,MAWO;AACN,QAAIC,MAAJ,EAAY;AACX;AACA;AACA,aAAOE,SAAS,GAAGH,GAAZ,GAAkB,CAAzB;AACA,KAJD,MAIO;AACN;AACA,aAAON,QAAP;AACA;AACD;AACD","sourcesContent":["import _getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit'\r\nimport getStepMinTime from './getStepMinTime'\r\nimport { getRoundFunction } from '../round'\r\n\r\n// A thousand years is practically a metaphor for \"infinity\".\r\nconst YEAR = 365 * 24 * 60 * 60 * 1000\r\nexport const INFINITY = 1000 * YEAR\r\n\r\n/**\r\n * Gets the time to next update for a date and a step.\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {object} step\r\n * @param {object} [options.previousStep]\r\n * @param {object} [options.nextStep]\r\n * @param {number} options.now\r\n * @param {boolean} options.future\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdate(date, step, { prevStep, nextStep, now, future, round }) {\r\n\tconst timestamp = date.getTime ? date.getTime() : date\r\n\r\n\tconst getTimeToNextUpdateForUnit = (unit) => _getTimeToNextUpdateForUnit(unit, timestamp, { now, round })\r\n\r\n\t// For future dates, steps move from the last one to the first one,\r\n\t// while for past dates, steps move from the first one to the last one,\r\n\t// due to the fact that time flows in one direction,\r\n\t// and future dates' interval naturally becomes smaller\r\n\t// while past dates' interval naturally grows larger.\r\n\t//\r\n\t// For future dates, it's the transition\r\n\t// from the current step to the previous step,\r\n\t// therefore check the `minTime` of the current step.\r\n\t//\r\n\t// For past dates, it's the transition\r\n\t// from the current step to the next step,\r\n\t// therefore check the `minTime` of the next step.\r\n\t//\r\n\tconst timeToStepChange = getTimeToStepChange(future ? step : nextStep, timestamp, {\r\n\t\tfuture,\r\n\t\tnow,\r\n\t\tround,\r\n\t\tprevStep: future ? prevStep : step,\r\n\t\t// isFirstStep: future && isFirstStep\r\n\t})\r\n\r\n\tif (timeToStepChange === undefined) {\r\n\t\t// Can't reliably determine \"time to next update\"\r\n\t\t// if not all of the steps provide `minTime`.\r\n\t\treturn\r\n\t}\r\n\r\n\tlet timeToNextUpdate\r\n\r\n\tif (step) {\r\n\t\tif (step.getTimeToNextUpdate) {\r\n\t\t\ttimeToNextUpdate = step.getTimeToNextUpdate(timestamp, {\r\n\t\t\t\tgetTimeToNextUpdateForUnit,\r\n\t\t\t\tgetRoundFunction,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tif (timeToNextUpdate === undefined) {\r\n\t\t\t// \"unit\" is now called \"formatAs\".\r\n\t\t\tconst unit = step.unit || step.formatAs\r\n\t\t\tif (unit) {\r\n\t\t\t\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\t\t\t\t// In such cases, `getTimeToNextUpdateForUnit()` returns `undefined`,\r\n\t\t\t\t// and the next step's `minTime` could be used to calculate the update interval:\r\n\t\t\t\t// it will just assume that the label never changes for this step.\r\n\t\t\t\ttimeToNextUpdate = getTimeToNextUpdateForUnit(unit)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (timeToNextUpdate === undefined) {\r\n\t\treturn timeToStepChange\r\n\t}\r\n\r\n\treturn Math.min(timeToNextUpdate, timeToStepChange)\r\n}\r\n\r\nexport function getStepChangesAt(currentOrNextStep, timestamp, { now, future, round, prevStep }) {\r\n\t// The first step's `minTime` is `0` by default.\r\n\t// It doesn't \"change\" steps at zero point\r\n\t// but it does change the wording when switching\r\n\t// from \"future\" to \"past\": \"in ...\" -> \"... ago\".\r\n\t// Therefore, the label should be updated at zero-point too.\r\n\tconst minTime = getStepMinTime(currentOrNextStep, { timestamp, now, future, round, prevStep })\r\n\tif (minTime === undefined) {\r\n\t\treturn\r\n\t}\r\n\tif (future) {\r\n\t\t// The step changes to the previous step\r\n\t\t// as soon as `timestamp - now` becomes\r\n\t\t// less than the `minTime` of the current step:\r\n\t\t// `timestamp - now === minTime - 1`\r\n\t\t// => `now === timestamp - minTime + 1`.\r\n\t\treturn timestamp - minTime * 1000 + 1\r\n\t} else {\r\n\t\t// The step changes to the next step\r\n\t\t// as soon as `now - timestamp` becomes\r\n\t\t// equal to `minTime` of the next step:\r\n\t\t// `now - timestamp === minTime`\r\n\t\t// => `now === timestamp + minTime`.\r\n\r\n\t\t// This is a special case when double-update could be skipped.\r\n\t\tif (minTime === 0 && timestamp === now) {\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\r\n\t\treturn timestamp + minTime * 1000\r\n\t}\r\n}\r\n\r\nexport function getTimeToStepChange(step, timestamp, {\r\n\tnow,\r\n\tfuture,\r\n\tround,\r\n\tprevStep\r\n}) {\r\n\tif (step) {\r\n\t\tconst stepChangesAt = getStepChangesAt(step, timestamp, {\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround,\r\n\t\t\tprevStep\r\n\t\t})\r\n\t\tif (stepChangesAt === undefined) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\treturn stepChangesAt - now\r\n\t} else {\r\n\t\tif (future) {\r\n\t\t\t// No step.\r\n\t\t\t// Update right after zero point, when it changes from \"future\" to \"past\".\r\n\t\t\treturn timestamp - now + 1\r\n\t\t} else {\r\n\t\t\t// The last step doesn't ever change when `date` is in the past.\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\t}\r\n}"],"file":"getTimeToNextUpdate.js"}
1
+ {"version":3,"file":"getTimeToNextUpdate.js","names":["YEAR","INFINITY","getTimeToNextUpdate","date","step","prevStep","nextStep","now","future","round","timestamp","getTime","getTimeToNextUpdateForUnit","unit","_getTimeToNextUpdateForUnit","timeToStepChange","getTimeToStepChange","undefined","timeToNextUpdate","getRoundFunction","formatAs","Math","min","getStepChangesAt","currentOrNextStep","minTime","getStepMinTime","stepChangesAt"],"sources":["../../source/steps/getTimeToNextUpdate.js"],"sourcesContent":["import _getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit.js'\r\nimport getStepMinTime from './getStepMinTime.js'\r\nimport { getRoundFunction } from '../round.js'\r\n\r\n// A thousand years is practically a metaphor for \"infinity\".\r\nconst YEAR = 365 * 24 * 60 * 60 * 1000\r\nexport const INFINITY = 1000 * YEAR\r\n\r\n/**\r\n * Gets the time to next update for a date and a step.\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {object} step\r\n * @param {object} [options.previousStep]\r\n * @param {object} [options.nextStep]\r\n * @param {number} options.now\r\n * @param {boolean} options.future\r\n * @param {string} [options.round] - (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdate(date, step, { prevStep, nextStep, now, future, round }) {\r\n\tconst timestamp = date.getTime ? date.getTime() : date\r\n\r\n\tconst getTimeToNextUpdateForUnit = (unit) => _getTimeToNextUpdateForUnit(unit, timestamp, { now, round })\r\n\r\n\t// For future dates, steps move from the last one to the first one,\r\n\t// while for past dates, steps move from the first one to the last one,\r\n\t// due to the fact that time flows in one direction,\r\n\t// and future dates' interval naturally becomes smaller\r\n\t// while past dates' interval naturally grows larger.\r\n\t//\r\n\t// For future dates, it's the transition\r\n\t// from the current step to the previous step,\r\n\t// therefore check the `minTime` of the current step.\r\n\t//\r\n\t// For past dates, it's the transition\r\n\t// from the current step to the next step,\r\n\t// therefore check the `minTime` of the next step.\r\n\t//\r\n\tconst timeToStepChange = getTimeToStepChange(future ? step : nextStep, timestamp, {\r\n\t\tfuture,\r\n\t\tnow,\r\n\t\tround,\r\n\t\tprevStep: future ? prevStep : step,\r\n\t\t// isFirstStep: future && isFirstStep\r\n\t})\r\n\r\n\tif (timeToStepChange === undefined) {\r\n\t\t// Can't reliably determine \"time to next update\"\r\n\t\t// if not all of the steps provide `minTime`.\r\n\t\treturn\r\n\t}\r\n\r\n\tlet timeToNextUpdate\r\n\r\n\tif (step) {\r\n\t\tif (step.getTimeToNextUpdate) {\r\n\t\t\ttimeToNextUpdate = step.getTimeToNextUpdate(timestamp, {\r\n\t\t\t\tgetTimeToNextUpdateForUnit,\r\n\t\t\t\tgetRoundFunction,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tif (timeToNextUpdate === undefined) {\r\n\t\t\t// \"unit\" is now called \"formatAs\".\r\n\t\t\tconst unit = step.unit || step.formatAs\r\n\t\t\tif (unit) {\r\n\t\t\t\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\t\t\t\t// In such cases, `getTimeToNextUpdateForUnit()` returns `undefined`,\r\n\t\t\t\t// and the next step's `minTime` could be used to calculate the update interval:\r\n\t\t\t\t// it will just assume that the label never changes for this step.\r\n\t\t\t\ttimeToNextUpdate = getTimeToNextUpdateForUnit(unit)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (timeToNextUpdate === undefined) {\r\n\t\treturn timeToStepChange\r\n\t}\r\n\r\n\treturn Math.min(timeToNextUpdate, timeToStepChange)\r\n}\r\n\r\nexport function getStepChangesAt(currentOrNextStep, timestamp, { now, future, round, prevStep }) {\r\n\t// The first step's `minTime` is `0` by default.\r\n\t// It doesn't \"change\" steps at zero point\r\n\t// but it does change the wording when switching\r\n\t// from \"future\" to \"past\": \"in ...\" -> \"... ago\".\r\n\t// Therefore, the label should be updated at zero-point too.\r\n\tconst minTime = getStepMinTime(currentOrNextStep, { timestamp, now, future, round, prevStep })\r\n\tif (minTime === undefined) {\r\n\t\treturn\r\n\t}\r\n\tif (future) {\r\n\t\t// The step changes to the previous step\r\n\t\t// as soon as `timestamp - now` becomes\r\n\t\t// less than the `minTime` of the current step:\r\n\t\t// `timestamp - now === minTime - 1`\r\n\t\t// => `now === timestamp - minTime + 1`.\r\n\t\treturn timestamp - minTime * 1000 + 1\r\n\t} else {\r\n\t\t// The step changes to the next step\r\n\t\t// as soon as `now - timestamp` becomes\r\n\t\t// equal to `minTime` of the next step:\r\n\t\t// `now - timestamp === minTime`\r\n\t\t// => `now === timestamp + minTime`.\r\n\r\n\t\t// This is a special case when double-update could be skipped.\r\n\t\tif (minTime === 0 && timestamp === now) {\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\r\n\t\treturn timestamp + minTime * 1000\r\n\t}\r\n}\r\n\r\nexport function getTimeToStepChange(step, timestamp, {\r\n\tnow,\r\n\tfuture,\r\n\tround,\r\n\tprevStep\r\n}) {\r\n\tif (step) {\r\n\t\tconst stepChangesAt = getStepChangesAt(step, timestamp, {\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround,\r\n\t\t\tprevStep\r\n\t\t})\r\n\t\tif (stepChangesAt === undefined) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\treturn stepChangesAt - now\r\n\t} else {\r\n\t\tif (future) {\r\n\t\t\t// No step.\r\n\t\t\t// Update right after zero point, when it changes from \"future\" to \"past\".\r\n\t\t\treturn timestamp - now + 1\r\n\t\t} else {\r\n\t\t\t// The last step doesn't ever change when `date` is in the past.\r\n\t\t\treturn INFINITY\r\n\t\t}\r\n\t}\r\n}"],"mappings":";;;;;;;;;;AAAA;;AACA;;AACA;;;;AAEA;AACA,IAAMA,IAAI,GAAG,MAAM,EAAN,GAAW,EAAX,GAAgB,EAAhB,GAAqB,IAAlC;AACO,IAAMC,QAAQ,GAAG,OAAOD,IAAxB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACe,SAASE,mBAAT,CAA6BC,IAA7B,EAAmCC,IAAnC,QAAqF;EAAA,IAA1CC,QAA0C,QAA1CA,QAA0C;EAAA,IAAhCC,QAAgC,QAAhCA,QAAgC;EAAA,IAAtBC,GAAsB,QAAtBA,GAAsB;EAAA,IAAjBC,MAAiB,QAAjBA,MAAiB;EAAA,IAATC,KAAS,QAATA,KAAS;EACnG,IAAMC,SAAS,GAAGP,IAAI,CAACQ,OAAL,GAAeR,IAAI,CAACQ,OAAL,EAAf,GAAgCR,IAAlD;;EAEA,IAAMS,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,IAAD;IAAA,OAAU,IAAAC,uCAAA,EAA4BD,IAA5B,EAAkCH,SAAlC,EAA6C;MAAEH,GAAG,EAAHA,GAAF;MAAOE,KAAK,EAALA;IAAP,CAA7C,CAAV;EAAA,CAAnC,CAHmG,CAKnG;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;EACA,IAAMM,gBAAgB,GAAGC,mB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