javascript-time-ago 2.3.11 → 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 (1426) hide show
  1. package/CHANGELOG.md +10 -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 +42 -62
  19. package/commonjs/TimeAgo.js.map +1 -1
  20. package/commonjs/TimeAgo.test.js +70 -104
  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 +23 -0
  27. package/commonjs/isStyleObject.js.map +1 -0
  28. package/commonjs/isStyleObject.test.js +39 -0
  29. package/commonjs/isStyleObject.test.js.map +1 -0
  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/bs.json +1 -4
  202. package/locale/ca/index.cjs +3 -0
  203. package/locale/ca/index.cjs.js +3 -0
  204. package/locale/ca/index.js +1 -3
  205. package/locale/ca/package.json +14 -0
  206. package/locale/ccp/index.cjs +3 -0
  207. package/locale/ccp/index.cjs.js +3 -0
  208. package/locale/ccp/index.js +1 -3
  209. package/locale/ccp/package.json +14 -0
  210. package/locale/ce/index.cjs +3 -0
  211. package/locale/ce/index.cjs.js +3 -0
  212. package/locale/ce/index.js +1 -3
  213. package/locale/ce/package.json +14 -0
  214. package/locale/ceb/index.cjs +3 -0
  215. package/locale/ceb/index.cjs.js +3 -0
  216. package/locale/ceb/index.js +1 -3
  217. package/locale/ceb/package.json +14 -0
  218. package/locale/chr/index.cjs +3 -0
  219. package/locale/chr/index.cjs.js +3 -0
  220. package/locale/chr/index.js +1 -3
  221. package/locale/chr/package.json +14 -0
  222. package/locale/cs/index.cjs +3 -0
  223. package/locale/cs/index.cjs.js +3 -0
  224. package/locale/cs/index.js +1 -3
  225. package/locale/cs/package.json +14 -0
  226. package/locale/cy/index.cjs +3 -0
  227. package/locale/cy/index.cjs.js +3 -0
  228. package/locale/cy/index.js +1 -3
  229. package/locale/cy/package.json +14 -0
  230. package/locale/da/index.cjs +3 -0
  231. package/locale/da/index.cjs.js +3 -0
  232. package/locale/da/index.js +1 -3
  233. package/locale/da/package.json +14 -0
  234. package/locale/de/index.cjs +3 -0
  235. package/locale/de/index.cjs.js +3 -0
  236. package/locale/de/index.js +1 -3
  237. package/locale/de/package.json +14 -0
  238. package/locale/dsb/index.cjs +3 -0
  239. package/locale/dsb/index.cjs.js +3 -0
  240. package/locale/dsb/index.js +1 -3
  241. package/locale/dsb/package.json +14 -0
  242. package/locale/dsb.json +42 -42
  243. package/locale/dz/index.cjs +3 -0
  244. package/locale/dz/index.cjs.js +3 -0
  245. package/locale/dz/index.js +1 -3
  246. package/locale/dz/package.json +14 -0
  247. package/locale/ee/index.cjs +3 -0
  248. package/locale/ee/index.cjs.js +3 -0
  249. package/locale/ee/index.js +1 -3
  250. package/locale/ee/package.json +14 -0
  251. package/locale/el/index.cjs +3 -0
  252. package/locale/el/index.cjs.js +3 -0
  253. package/locale/el/index.js +1 -3
  254. package/locale/el/package.json +14 -0
  255. package/locale/el.json +2 -2
  256. package/locale/en/index.cjs +3 -0
  257. package/locale/en/index.cjs.js +3 -0
  258. package/locale/en/index.js +1 -3
  259. package/locale/en/package.json +14 -0
  260. package/locale/en-001/index.cjs +3 -0
  261. package/locale/en-001/index.cjs.js +3 -0
  262. package/locale/en-001/index.js +1 -3
  263. package/locale/en-001/package.json +14 -0
  264. package/locale/en-150/index.cjs +3 -0
  265. package/locale/en-150/index.cjs.js +3 -0
  266. package/locale/en-150/index.js +1 -3
  267. package/locale/en-150/package.json +14 -0
  268. package/locale/en-AG/index.cjs +3 -0
  269. package/locale/en-AG/index.cjs.js +3 -0
  270. package/locale/en-AG/index.js +1 -3
  271. package/locale/en-AG/package.json +14 -0
  272. package/locale/en-AI/index.cjs +3 -0
  273. package/locale/en-AI/index.cjs.js +3 -0
  274. package/locale/en-AI/index.js +1 -3
  275. package/locale/en-AI/package.json +14 -0
  276. package/locale/en-AT/index.cjs +3 -0
  277. package/locale/en-AT/index.cjs.js +3 -0
  278. package/locale/en-AT/index.js +1 -3
  279. package/locale/en-AT/package.json +14 -0
  280. package/locale/en-AU/index.cjs +3 -0
  281. package/locale/en-AU/index.cjs.js +3 -0
  282. package/locale/en-AU/index.js +1 -3
  283. package/locale/en-AU/package.json +14 -0
  284. package/locale/en-BB/index.cjs +3 -0
  285. package/locale/en-BB/index.cjs.js +3 -0
  286. package/locale/en-BB/index.js +1 -3
  287. package/locale/en-BB/package.json +14 -0
  288. package/locale/en-BE/index.cjs +3 -0
  289. package/locale/en-BE/index.cjs.js +3 -0
  290. package/locale/en-BE/index.js +1 -3
  291. package/locale/en-BE/package.json +14 -0
  292. package/locale/en-BM/index.cjs +3 -0
  293. package/locale/en-BM/index.cjs.js +3 -0
  294. package/locale/en-BM/index.js +1 -3
  295. package/locale/en-BM/package.json +14 -0
  296. package/locale/en-BS/index.cjs +3 -0
  297. package/locale/en-BS/index.cjs.js +3 -0
  298. package/locale/en-BS/index.js +1 -3
  299. package/locale/en-BS/package.json +14 -0
  300. package/locale/en-BW/index.cjs +3 -0
  301. package/locale/en-BW/index.cjs.js +3 -0
  302. package/locale/en-BW/index.js +1 -3
  303. package/locale/en-BW/package.json +14 -0
  304. package/locale/en-BZ/index.cjs +3 -0
  305. package/locale/en-BZ/index.cjs.js +3 -0
  306. package/locale/en-BZ/index.js +1 -3
  307. package/locale/en-BZ/package.json +14 -0
  308. package/locale/en-CA/index.cjs +3 -0
  309. package/locale/en-CA/index.cjs.js +3 -0
  310. package/locale/en-CA/index.js +1 -3
  311. package/locale/en-CA/package.json +14 -0
  312. package/locale/en-CA.json +56 -56
  313. package/locale/en-CC/index.cjs +3 -0
  314. package/locale/en-CC/index.cjs.js +3 -0
  315. package/locale/en-CC/index.js +1 -3
  316. package/locale/en-CC/package.json +14 -0
  317. package/locale/en-CH/index.cjs +3 -0
  318. package/locale/en-CH/index.cjs.js +3 -0
  319. package/locale/en-CH/index.js +1 -3
  320. package/locale/en-CH/package.json +14 -0
  321. package/locale/en-CK/index.cjs +3 -0
  322. package/locale/en-CK/index.cjs.js +3 -0
  323. package/locale/en-CK/index.js +1 -3
  324. package/locale/en-CK/package.json +14 -0
  325. package/locale/en-CM/index.cjs +3 -0
  326. package/locale/en-CM/index.cjs.js +3 -0
  327. package/locale/en-CM/index.js +1 -3
  328. package/locale/en-CM/package.json +14 -0
  329. package/locale/en-CX/index.cjs +3 -0
  330. package/locale/en-CX/index.cjs.js +3 -0
  331. package/locale/en-CX/index.js +1 -3
  332. package/locale/en-CX/package.json +14 -0
  333. package/locale/en-CY/index.cjs +3 -0
  334. package/locale/en-CY/index.cjs.js +3 -0
  335. package/locale/en-CY/index.js +1 -3
  336. package/locale/en-CY/package.json +14 -0
  337. package/locale/en-DE/index.cjs +3 -0
  338. package/locale/en-DE/index.cjs.js +3 -0
  339. package/locale/en-DE/index.js +1 -3
  340. package/locale/en-DE/package.json +14 -0
  341. package/locale/en-DG/index.cjs +3 -0
  342. package/locale/en-DG/index.cjs.js +3 -0
  343. package/locale/en-DG/index.js +1 -3
  344. package/locale/en-DG/package.json +14 -0
  345. package/locale/en-DK/index.cjs +3 -0
  346. package/locale/en-DK/index.cjs.js +3 -0
  347. package/locale/en-DK/index.js +1 -3
  348. package/locale/en-DK/package.json +14 -0
  349. package/locale/en-DM/index.cjs +3 -0
  350. package/locale/en-DM/index.cjs.js +3 -0
  351. package/locale/en-DM/index.js +1 -3
  352. package/locale/en-DM/package.json +14 -0
  353. package/locale/en-ER/index.cjs +3 -0
  354. package/locale/en-ER/index.cjs.js +3 -0
  355. package/locale/en-ER/index.js +1 -3
  356. package/locale/en-ER/package.json +14 -0
  357. package/locale/en-FI/index.cjs +3 -0
  358. package/locale/en-FI/index.cjs.js +3 -0
  359. package/locale/en-FI/index.js +1 -3
  360. package/locale/en-FI/package.json +14 -0
  361. package/locale/en-FJ/index.cjs +3 -0
  362. package/locale/en-FJ/index.cjs.js +3 -0
  363. package/locale/en-FJ/index.js +1 -3
  364. package/locale/en-FJ/package.json +14 -0
  365. package/locale/en-FK/index.cjs +3 -0
  366. package/locale/en-FK/index.cjs.js +3 -0
  367. package/locale/en-FK/index.js +1 -3
  368. package/locale/en-FK/package.json +14 -0
  369. package/locale/en-FM/index.cjs +3 -0
  370. package/locale/en-FM/index.cjs.js +3 -0
  371. package/locale/en-FM/index.js +1 -3
  372. package/locale/en-FM/package.json +14 -0
  373. package/locale/en-GB/index.cjs +3 -0
  374. package/locale/en-GB/index.cjs.js +3 -0
  375. package/locale/en-GB/index.js +1 -3
  376. package/locale/en-GB/package.json +14 -0
  377. package/locale/en-GD/index.cjs +3 -0
  378. package/locale/en-GD/index.cjs.js +3 -0
  379. package/locale/en-GD/index.js +1 -3
  380. package/locale/en-GD/package.json +14 -0
  381. package/locale/en-GG/index.cjs +3 -0
  382. package/locale/en-GG/index.cjs.js +3 -0
  383. package/locale/en-GG/index.js +1 -3
  384. package/locale/en-GG/package.json +14 -0
  385. package/locale/en-GH/index.cjs +3 -0
  386. package/locale/en-GH/index.cjs.js +3 -0
  387. package/locale/en-GH/index.js +1 -3
  388. package/locale/en-GH/package.json +14 -0
  389. package/locale/en-GI/index.cjs +3 -0
  390. package/locale/en-GI/index.cjs.js +3 -0
  391. package/locale/en-GI/index.js +1 -3
  392. package/locale/en-GI/package.json +14 -0
  393. package/locale/en-GM/index.cjs +3 -0
  394. package/locale/en-GM/index.cjs.js +3 -0
  395. package/locale/en-GM/index.js +1 -3
  396. package/locale/en-GM/package.json +14 -0
  397. package/locale/en-GY/index.cjs +3 -0
  398. package/locale/en-GY/index.cjs.js +3 -0
  399. package/locale/en-GY/index.js +1 -3
  400. package/locale/en-GY/package.json +14 -0
  401. package/locale/en-HK/index.cjs +3 -0
  402. package/locale/en-HK/index.cjs.js +3 -0
  403. package/locale/en-HK/index.js +1 -3
  404. package/locale/en-HK/package.json +14 -0
  405. package/locale/en-IE/index.cjs +3 -0
  406. package/locale/en-IE/index.cjs.js +3 -0
  407. package/locale/en-IE/index.js +1 -3
  408. package/locale/en-IE/package.json +14 -0
  409. package/locale/en-IL/index.cjs +3 -0
  410. package/locale/en-IL/index.cjs.js +3 -0
  411. package/locale/en-IL/index.js +1 -3
  412. package/locale/en-IL/package.json +14 -0
  413. package/locale/en-IM/index.cjs +3 -0
  414. package/locale/en-IM/index.cjs.js +3 -0
  415. package/locale/en-IM/index.js +1 -3
  416. package/locale/en-IM/package.json +14 -0
  417. package/locale/en-IN/index.cjs +3 -0
  418. package/locale/en-IN/index.cjs.js +3 -0
  419. package/locale/en-IN/index.js +1 -3
  420. package/locale/en-IN/package.json +14 -0
  421. package/locale/en-IO/index.cjs +3 -0
  422. package/locale/en-IO/index.cjs.js +3 -0
  423. package/locale/en-IO/index.js +1 -3
  424. package/locale/en-IO/package.json +14 -0
  425. package/locale/en-JE/index.cjs +3 -0
  426. package/locale/en-JE/index.cjs.js +3 -0
  427. package/locale/en-JE/index.js +1 -3
  428. package/locale/en-JE/package.json +14 -0
  429. package/locale/en-JM/index.cjs +3 -0
  430. package/locale/en-JM/index.cjs.js +3 -0
  431. package/locale/en-JM/index.js +1 -3
  432. package/locale/en-JM/package.json +14 -0
  433. package/locale/en-KE/index.cjs +3 -0
  434. package/locale/en-KE/index.cjs.js +3 -0
  435. package/locale/en-KE/index.js +1 -3
  436. package/locale/en-KE/package.json +14 -0
  437. package/locale/en-KI/index.cjs +3 -0
  438. package/locale/en-KI/index.cjs.js +3 -0
  439. package/locale/en-KI/index.js +1 -3
  440. package/locale/en-KI/package.json +14 -0
  441. package/locale/en-KN/index.cjs +3 -0
  442. package/locale/en-KN/index.cjs.js +3 -0
  443. package/locale/en-KN/index.js +1 -3
  444. package/locale/en-KN/package.json +14 -0
  445. package/locale/en-KY/index.cjs +3 -0
  446. package/locale/en-KY/index.cjs.js +3 -0
  447. package/locale/en-KY/index.js +1 -3
  448. package/locale/en-KY/package.json +14 -0
  449. package/locale/en-LC/index.cjs +3 -0
  450. package/locale/en-LC/index.cjs.js +3 -0
  451. package/locale/en-LC/index.js +1 -3
  452. package/locale/en-LC/package.json +14 -0
  453. package/locale/en-LR/index.cjs +3 -0
  454. package/locale/en-LR/index.cjs.js +3 -0
  455. package/locale/en-LR/index.js +1 -3
  456. package/locale/en-LR/package.json +14 -0
  457. package/locale/en-LS/index.cjs +3 -0
  458. package/locale/en-LS/index.cjs.js +3 -0
  459. package/locale/en-LS/index.js +1 -3
  460. package/locale/en-LS/package.json +14 -0
  461. package/locale/en-MG/index.cjs +3 -0
  462. package/locale/en-MG/index.cjs.js +3 -0
  463. package/locale/en-MG/index.js +1 -3
  464. package/locale/en-MG/package.json +14 -0
  465. package/locale/en-MO/index.cjs +3 -0
  466. package/locale/en-MO/index.cjs.js +3 -0
  467. package/locale/en-MO/index.js +1 -3
  468. package/locale/en-MO/package.json +14 -0
  469. package/locale/en-MS/index.cjs +3 -0
  470. package/locale/en-MS/index.cjs.js +3 -0
  471. package/locale/en-MS/index.js +1 -3
  472. package/locale/en-MS/package.json +14 -0
  473. package/locale/en-MT/index.cjs +3 -0
  474. package/locale/en-MT/index.cjs.js +3 -0
  475. package/locale/en-MT/index.js +1 -3
  476. package/locale/en-MT/package.json +14 -0
  477. package/locale/en-MU/index.cjs +3 -0
  478. package/locale/en-MU/index.cjs.js +3 -0
  479. package/locale/en-MU/index.js +1 -3
  480. package/locale/en-MU/package.json +14 -0
  481. package/locale/en-MV/index.cjs +3 -0
  482. package/locale/en-MV/index.cjs.js +3 -0
  483. package/locale/en-MV/index.js +1 -0
  484. package/locale/en-MV/package.json +14 -0
  485. package/locale/{en-PH.json → en-MV.json} +1 -1
  486. package/locale/en-MW/index.cjs +3 -0
  487. package/locale/en-MW/index.cjs.js +3 -0
  488. package/locale/en-MW/index.js +1 -3
  489. package/locale/en-MW/package.json +14 -0
  490. package/locale/en-MY/index.cjs +3 -0
  491. package/locale/en-MY/index.cjs.js +3 -0
  492. package/locale/en-MY/index.js +1 -3
  493. package/locale/en-MY/package.json +14 -0
  494. package/locale/en-NA/index.cjs +3 -0
  495. package/locale/en-NA/index.cjs.js +3 -0
  496. package/locale/en-NA/index.js +1 -3
  497. package/locale/en-NA/package.json +14 -0
  498. package/locale/en-NF/index.cjs +3 -0
  499. package/locale/en-NF/index.cjs.js +3 -0
  500. package/locale/en-NF/index.js +1 -3
  501. package/locale/en-NF/package.json +14 -0
  502. package/locale/en-NG/index.cjs +3 -0
  503. package/locale/en-NG/index.cjs.js +3 -0
  504. package/locale/en-NG/index.js +1 -3
  505. package/locale/en-NG/package.json +14 -0
  506. package/locale/en-NL/index.cjs +3 -0
  507. package/locale/en-NL/index.cjs.js +3 -0
  508. package/locale/en-NL/index.js +1 -3
  509. package/locale/en-NL/package.json +14 -0
  510. package/locale/en-NR/index.cjs +3 -0
  511. package/locale/en-NR/index.cjs.js +3 -0
  512. package/locale/en-NR/index.js +1 -3
  513. package/locale/en-NR/package.json +14 -0
  514. package/locale/en-NU/index.cjs +3 -0
  515. package/locale/en-NU/index.cjs.js +3 -0
  516. package/locale/en-NU/index.js +1 -3
  517. package/locale/en-NU/package.json +14 -0
  518. package/locale/en-NZ/index.cjs +3 -0
  519. package/locale/en-NZ/index.cjs.js +3 -0
  520. package/locale/en-NZ/index.js +1 -3
  521. package/locale/en-NZ/package.json +14 -0
  522. package/locale/en-PG/index.cjs +3 -0
  523. package/locale/en-PG/index.cjs.js +3 -0
  524. package/locale/en-PG/index.js +1 -3
  525. package/locale/en-PG/package.json +14 -0
  526. package/locale/en-PK/index.cjs +3 -0
  527. package/locale/en-PK/index.cjs.js +3 -0
  528. package/locale/en-PK/index.js +1 -3
  529. package/locale/en-PK/package.json +14 -0
  530. package/locale/en-PN/index.cjs +3 -0
  531. package/locale/en-PN/index.cjs.js +3 -0
  532. package/locale/en-PN/index.js +1 -3
  533. package/locale/en-PN/package.json +14 -0
  534. package/locale/en-PW/index.cjs +3 -0
  535. package/locale/en-PW/index.cjs.js +3 -0
  536. package/locale/en-PW/index.js +1 -3
  537. package/locale/en-PW/package.json +14 -0
  538. package/locale/en-RW/index.cjs +3 -0
  539. package/locale/en-RW/index.cjs.js +3 -0
  540. package/locale/en-RW/index.js +1 -3
  541. package/locale/en-RW/package.json +14 -0
  542. package/locale/en-SB/index.cjs +3 -0
  543. package/locale/en-SB/index.cjs.js +3 -0
  544. package/locale/en-SB/index.js +1 -3
  545. package/locale/en-SB/package.json +14 -0
  546. package/locale/en-SC/index.cjs +3 -0
  547. package/locale/en-SC/index.cjs.js +3 -0
  548. package/locale/en-SC/index.js +1 -3
  549. package/locale/en-SC/package.json +14 -0
  550. package/locale/en-SD/index.cjs +3 -0
  551. package/locale/en-SD/index.cjs.js +3 -0
  552. package/locale/en-SD/index.js +1 -3
  553. package/locale/en-SD/package.json +14 -0
  554. package/locale/en-SE/index.cjs +3 -0
  555. package/locale/en-SE/index.cjs.js +3 -0
  556. package/locale/en-SE/index.js +1 -3
  557. package/locale/en-SE/package.json +14 -0
  558. package/locale/en-SG/index.cjs +3 -0
  559. package/locale/en-SG/index.cjs.js +3 -0
  560. package/locale/en-SG/index.js +1 -3
  561. package/locale/en-SG/package.json +14 -0
  562. package/locale/en-SH/index.cjs +3 -0
  563. package/locale/en-SH/index.cjs.js +3 -0
  564. package/locale/en-SH/index.js +1 -3
  565. package/locale/en-SH/package.json +14 -0
  566. package/locale/en-SI/index.cjs +3 -0
  567. package/locale/en-SI/index.cjs.js +3 -0
  568. package/locale/en-SI/index.js +1 -3
  569. package/locale/en-SI/package.json +14 -0
  570. package/locale/en-SL/index.cjs +3 -0
  571. package/locale/en-SL/index.cjs.js +3 -0
  572. package/locale/en-SL/index.js +1 -3
  573. package/locale/en-SL/package.json +14 -0
  574. package/locale/en-SS/index.cjs +3 -0
  575. package/locale/en-SS/index.cjs.js +3 -0
  576. package/locale/en-SS/index.js +1 -3
  577. package/locale/en-SS/package.json +14 -0
  578. package/locale/en-SX/index.cjs +3 -0
  579. package/locale/en-SX/index.cjs.js +3 -0
  580. package/locale/en-SX/index.js +1 -3
  581. package/locale/en-SX/package.json +14 -0
  582. package/locale/en-SZ/index.cjs +3 -0
  583. package/locale/en-SZ/index.cjs.js +3 -0
  584. package/locale/en-SZ/index.js +1 -3
  585. package/locale/en-SZ/package.json +14 -0
  586. package/locale/en-TC/index.cjs +3 -0
  587. package/locale/en-TC/index.cjs.js +3 -0
  588. package/locale/en-TC/index.js +1 -3
  589. package/locale/en-TC/package.json +14 -0
  590. package/locale/en-TK/index.cjs +3 -0
  591. package/locale/en-TK/index.cjs.js +3 -0
  592. package/locale/en-TK/index.js +1 -3
  593. package/locale/en-TK/package.json +14 -0
  594. package/locale/en-TO/index.cjs +3 -0
  595. package/locale/en-TO/index.cjs.js +3 -0
  596. package/locale/en-TO/index.js +1 -3
  597. package/locale/en-TO/package.json +14 -0
  598. package/locale/en-TT/index.cjs +3 -0
  599. package/locale/en-TT/index.cjs.js +3 -0
  600. package/locale/en-TT/index.js +1 -3
  601. package/locale/en-TT/package.json +14 -0
  602. package/locale/en-TV/index.cjs +3 -0
  603. package/locale/en-TV/index.cjs.js +3 -0
  604. package/locale/en-TV/index.js +1 -3
  605. package/locale/en-TV/package.json +14 -0
  606. package/locale/en-TZ/index.cjs +3 -0
  607. package/locale/en-TZ/index.cjs.js +3 -0
  608. package/locale/en-TZ/index.js +1 -3
  609. package/locale/en-TZ/package.json +14 -0
  610. package/locale/en-UG/index.cjs +3 -0
  611. package/locale/en-UG/index.cjs.js +3 -0
  612. package/locale/en-UG/index.js +1 -3
  613. package/locale/en-UG/package.json +14 -0
  614. package/locale/en-VC/index.cjs +3 -0
  615. package/locale/en-VC/index.cjs.js +3 -0
  616. package/locale/en-VC/index.js +1 -3
  617. package/locale/en-VC/package.json +14 -0
  618. package/locale/en-VG/index.cjs +3 -0
  619. package/locale/en-VG/index.cjs.js +3 -0
  620. package/locale/en-VG/index.js +1 -3
  621. package/locale/en-VG/package.json +14 -0
  622. package/locale/en-VU/index.cjs +3 -0
  623. package/locale/en-VU/index.cjs.js +3 -0
  624. package/locale/en-VU/index.js +1 -3
  625. package/locale/en-VU/package.json +14 -0
  626. package/locale/en-WS/index.cjs +3 -0
  627. package/locale/en-WS/index.cjs.js +3 -0
  628. package/locale/en-WS/index.js +1 -3
  629. package/locale/en-WS/package.json +14 -0
  630. package/locale/en-ZA/index.cjs +3 -0
  631. package/locale/en-ZA/index.cjs.js +3 -0
  632. package/locale/en-ZA/index.js +1 -3
  633. package/locale/en-ZA/package.json +14 -0
  634. package/locale/en-ZM/index.cjs +3 -0
  635. package/locale/en-ZM/index.cjs.js +3 -0
  636. package/locale/en-ZM/index.js +1 -3
  637. package/locale/en-ZM/package.json +14 -0
  638. package/locale/en-ZW/index.cjs +3 -0
  639. package/locale/en-ZW/index.cjs.js +3 -0
  640. package/locale/en-ZW/index.js +1 -3
  641. package/locale/en-ZW/package.json +14 -0
  642. package/locale/es/index.cjs +3 -0
  643. package/locale/es/index.cjs.js +3 -0
  644. package/locale/es/index.js +1 -3
  645. package/locale/es/package.json +14 -0
  646. package/locale/es-419/index.cjs +3 -0
  647. package/locale/es-419/index.cjs.js +3 -0
  648. package/locale/es-419/index.js +1 -3
  649. package/locale/es-419/package.json +14 -0
  650. package/locale/es-AR/index.cjs +3 -0
  651. package/locale/es-AR/index.cjs.js +3 -0
  652. package/locale/es-AR/index.js +1 -3
  653. package/locale/es-AR/package.json +14 -0
  654. package/locale/es-BO/index.cjs +3 -0
  655. package/locale/es-BO/index.cjs.js +3 -0
  656. package/locale/es-BO/index.js +1 -3
  657. package/locale/es-BO/package.json +14 -0
  658. package/locale/es-BR/index.cjs +3 -0
  659. package/locale/es-BR/index.cjs.js +3 -0
  660. package/locale/es-BR/index.js +1 -3
  661. package/locale/es-BR/package.json +14 -0
  662. package/locale/es-BZ/index.cjs +3 -0
  663. package/locale/es-BZ/index.cjs.js +3 -0
  664. package/locale/es-BZ/index.js +1 -3
  665. package/locale/es-BZ/package.json +14 -0
  666. package/locale/es-CL/index.cjs +3 -0
  667. package/locale/es-CL/index.cjs.js +3 -0
  668. package/locale/es-CL/index.js +1 -3
  669. package/locale/es-CL/package.json +14 -0
  670. package/locale/es-CO/index.cjs +3 -0
  671. package/locale/es-CO/index.cjs.js +3 -0
  672. package/locale/es-CO/index.js +1 -3
  673. package/locale/es-CO/package.json +14 -0
  674. package/locale/es-CR/index.cjs +3 -0
  675. package/locale/es-CR/index.cjs.js +3 -0
  676. package/locale/es-CR/index.js +1 -3
  677. package/locale/es-CR/package.json +14 -0
  678. package/locale/es-CU/index.cjs +3 -0
  679. package/locale/es-CU/index.cjs.js +3 -0
  680. package/locale/es-CU/index.js +1 -3
  681. package/locale/es-CU/package.json +14 -0
  682. package/locale/es-DO/index.cjs +3 -0
  683. package/locale/es-DO/index.cjs.js +3 -0
  684. package/locale/es-DO/index.js +1 -3
  685. package/locale/es-DO/package.json +14 -0
  686. package/locale/es-EC/index.cjs +3 -0
  687. package/locale/es-EC/index.cjs.js +3 -0
  688. package/locale/es-EC/index.js +1 -3
  689. package/locale/es-EC/package.json +14 -0
  690. package/locale/es-GT/index.cjs +3 -0
  691. package/locale/es-GT/index.cjs.js +3 -0
  692. package/locale/es-GT/index.js +1 -3
  693. package/locale/es-GT/package.json +14 -0
  694. package/locale/es-HN/index.cjs +3 -0
  695. package/locale/es-HN/index.cjs.js +3 -0
  696. package/locale/es-HN/index.js +1 -3
  697. package/locale/es-HN/package.json +14 -0
  698. package/locale/es-MX/index.cjs +3 -0
  699. package/locale/es-MX/index.cjs.js +3 -0
  700. package/locale/es-MX/index.js +1 -3
  701. package/locale/es-MX/package.json +14 -0
  702. package/locale/es-NI/index.cjs +3 -0
  703. package/locale/es-NI/index.cjs.js +3 -0
  704. package/locale/es-NI/index.js +1 -3
  705. package/locale/es-NI/package.json +14 -0
  706. package/locale/es-PA/index.cjs +3 -0
  707. package/locale/es-PA/index.cjs.js +3 -0
  708. package/locale/es-PA/index.js +1 -3
  709. package/locale/es-PA/package.json +14 -0
  710. package/locale/es-PE/index.cjs +3 -0
  711. package/locale/es-PE/index.cjs.js +3 -0
  712. package/locale/es-PE/index.js +1 -3
  713. package/locale/es-PE/package.json +14 -0
  714. package/locale/es-PR/index.cjs +3 -0
  715. package/locale/es-PR/index.cjs.js +3 -0
  716. package/locale/es-PR/index.js +1 -3
  717. package/locale/es-PR/package.json +14 -0
  718. package/locale/es-PY/index.cjs +3 -0
  719. package/locale/es-PY/index.cjs.js +3 -0
  720. package/locale/es-PY/index.js +1 -3
  721. package/locale/es-PY/package.json +14 -0
  722. package/locale/es-SV/index.cjs +3 -0
  723. package/locale/es-SV/index.cjs.js +3 -0
  724. package/locale/es-SV/index.js +1 -3
  725. package/locale/es-SV/package.json +14 -0
  726. package/locale/es-US/index.cjs +3 -0
  727. package/locale/es-US/index.cjs.js +3 -0
  728. package/locale/es-US/index.js +1 -3
  729. package/locale/es-US/package.json +14 -0
  730. package/locale/es-US.json +3 -3
  731. package/locale/es-UY/index.cjs +3 -0
  732. package/locale/es-UY/index.cjs.js +3 -0
  733. package/locale/es-UY/index.js +1 -3
  734. package/locale/es-UY/package.json +14 -0
  735. package/locale/es-VE/index.cjs +3 -0
  736. package/locale/es-VE/index.cjs.js +3 -0
  737. package/locale/es-VE/index.js +1 -3
  738. package/locale/es-VE/package.json +14 -0
  739. package/locale/es.json +4 -16
  740. package/locale/et/index.cjs +3 -0
  741. package/locale/et/index.cjs.js +3 -0
  742. package/locale/et/index.js +1 -3
  743. package/locale/et/package.json +14 -0
  744. package/locale/eu/index.cjs +3 -0
  745. package/locale/eu/index.cjs.js +3 -0
  746. package/locale/eu/index.js +1 -3
  747. package/locale/eu/package.json +14 -0
  748. package/locale/eu.json +6 -6
  749. package/locale/fa/index.cjs +3 -0
  750. package/locale/fa/index.cjs.js +3 -0
  751. package/locale/fa/index.js +1 -3
  752. package/locale/fa/package.json +14 -0
  753. package/locale/ff-Adlm/index.cjs +3 -0
  754. package/locale/ff-Adlm/index.cjs.js +3 -0
  755. package/locale/ff-Adlm/index.js +1 -3
  756. package/locale/ff-Adlm/package.json +14 -0
  757. package/locale/ff-Adlm.json +34 -34
  758. package/locale/fi/index.cjs +3 -0
  759. package/locale/fi/index.cjs.js +3 -0
  760. package/locale/fi/index.js +1 -3
  761. package/locale/fi/package.json +14 -0
  762. package/locale/fil/index.cjs +3 -0
  763. package/locale/fil/index.cjs.js +3 -0
  764. package/locale/fil/index.js +1 -3
  765. package/locale/fil/package.json +14 -0
  766. package/locale/fil.json +2 -2
  767. package/locale/fo/index.cjs +3 -0
  768. package/locale/fo/index.cjs.js +3 -0
  769. package/locale/fo/index.js +1 -3
  770. package/locale/fo/package.json +14 -0
  771. package/locale/fr/index.cjs +3 -0
  772. package/locale/fr/index.cjs.js +3 -0
  773. package/locale/fr/index.js +1 -3
  774. package/locale/fr/package.json +14 -0
  775. package/locale/fr-CA/index.cjs +3 -0
  776. package/locale/fr-CA/index.cjs.js +3 -0
  777. package/locale/fr-CA/index.js +1 -3
  778. package/locale/fr-CA/package.json +14 -0
  779. package/locale/fur/index.cjs +3 -0
  780. package/locale/fur/index.cjs.js +3 -0
  781. package/locale/fur/index.js +1 -3
  782. package/locale/fur/package.json +14 -0
  783. package/locale/fy/index.cjs +3 -0
  784. package/locale/fy/index.cjs.js +3 -0
  785. package/locale/fy/index.js +1 -3
  786. package/locale/fy/package.json +14 -0
  787. package/locale/ga/index.cjs +3 -0
  788. package/locale/ga/index.cjs.js +3 -0
  789. package/locale/ga/index.js +1 -3
  790. package/locale/ga/package.json +14 -0
  791. package/locale/gd/index.cjs +3 -0
  792. package/locale/gd/index.cjs.js +3 -0
  793. package/locale/gd/index.js +1 -3
  794. package/locale/gd/package.json +14 -0
  795. package/locale/gl/index.cjs +3 -0
  796. package/locale/gl/index.cjs.js +3 -0
  797. package/locale/gl/index.js +1 -3
  798. package/locale/gl/package.json +14 -0
  799. package/locale/gu/index.cjs +3 -0
  800. package/locale/gu/index.cjs.js +3 -0
  801. package/locale/gu/index.js +1 -3
  802. package/locale/gu/package.json +14 -0
  803. package/locale/ha/index.cjs +3 -0
  804. package/locale/ha/index.cjs.js +3 -0
  805. package/locale/ha/index.js +1 -3
  806. package/locale/ha/package.json +14 -0
  807. package/locale/he/index.cjs +3 -0
  808. package/locale/he/index.cjs.js +3 -0
  809. package/locale/he/index.js +1 -3
  810. package/locale/he/package.json +14 -0
  811. package/locale/he.json +2 -2
  812. package/locale/hi/index.cjs +3 -0
  813. package/locale/hi/index.cjs.js +3 -0
  814. package/locale/hi/index.js +1 -3
  815. package/locale/hi/package.json +14 -0
  816. package/locale/hi-Latn/index.cjs +3 -0
  817. package/locale/hi-Latn/index.cjs.js +3 -0
  818. package/locale/hi-Latn/index.js +1 -0
  819. package/locale/hi-Latn/package.json +14 -0
  820. package/locale/hi-Latn.json +183 -0
  821. package/locale/hr/index.cjs +3 -0
  822. package/locale/hr/index.cjs.js +3 -0
  823. package/locale/hr/index.js +1 -3
  824. package/locale/hr/package.json +14 -0
  825. package/locale/hsb/index.cjs +3 -0
  826. package/locale/hsb/index.cjs.js +3 -0
  827. package/locale/hsb/index.js +1 -3
  828. package/locale/hsb/package.json +14 -0
  829. package/locale/hsb.json +42 -42
  830. package/locale/hu/index.cjs +3 -0
  831. package/locale/hu/index.cjs.js +3 -0
  832. package/locale/hu/index.js +1 -3
  833. package/locale/hu/package.json +14 -0
  834. package/locale/hy/index.cjs +3 -0
  835. package/locale/hy/index.cjs.js +3 -0
  836. package/locale/hy/index.js +1 -3
  837. package/locale/hy/package.json +14 -0
  838. package/locale/ia/index.cjs +3 -0
  839. package/locale/ia/index.cjs.js +3 -0
  840. package/locale/ia/index.js +1 -3
  841. package/locale/ia/package.json +14 -0
  842. package/locale/ia.json +121 -145
  843. package/locale/id/index.cjs +3 -0
  844. package/locale/id/index.cjs.js +3 -0
  845. package/locale/id/index.js +1 -3
  846. package/locale/id/package.json +14 -0
  847. package/locale/id.json +11 -11
  848. package/locale/ig/index.cjs +3 -0
  849. package/locale/ig/index.cjs.js +3 -0
  850. package/locale/ig/index.js +1 -3
  851. package/locale/ig/package.json +14 -0
  852. package/locale/is/index.cjs +3 -0
  853. package/locale/is/index.cjs.js +3 -0
  854. package/locale/is/index.js +1 -3
  855. package/locale/is/package.json +14 -0
  856. package/locale/is.json +8 -8
  857. package/locale/it/index.cjs +3 -0
  858. package/locale/it/index.cjs.js +3 -0
  859. package/locale/it/index.js +1 -3
  860. package/locale/it/package.json +14 -0
  861. package/locale/ja/index.cjs +3 -0
  862. package/locale/ja/index.cjs.js +3 -0
  863. package/locale/ja/index.js +1 -3
  864. package/locale/ja/package.json +14 -0
  865. package/locale/jgo/index.cjs +3 -0
  866. package/locale/jgo/index.cjs.js +3 -0
  867. package/locale/jgo/index.js +1 -3
  868. package/locale/jgo/package.json +14 -0
  869. package/locale/jv/index.cjs +3 -0
  870. package/locale/jv/index.cjs.js +3 -0
  871. package/locale/jv/index.js +1 -3
  872. package/locale/jv/package.json +14 -0
  873. package/locale/jv.json +6 -6
  874. package/locale/ka/index.cjs +3 -0
  875. package/locale/ka/index.cjs.js +3 -0
  876. package/locale/ka/index.js +1 -3
  877. package/locale/ka/package.json +14 -0
  878. package/locale/kea/index.cjs +3 -0
  879. package/locale/kea/index.cjs.js +3 -0
  880. package/locale/kea/index.js +1 -3
  881. package/locale/kea/package.json +14 -0
  882. package/locale/kgp/index.cjs +3 -0
  883. package/locale/kgp/index.cjs.js +3 -0
  884. package/locale/kgp/index.js +1 -0
  885. package/locale/kgp/package.json +14 -0
  886. package/locale/kgp.json +165 -0
  887. package/locale/kk/index.cjs +3 -0
  888. package/locale/kk/index.cjs.js +3 -0
  889. package/locale/kk/index.js +1 -3
  890. package/locale/kk/package.json +14 -0
  891. package/locale/kl/index.cjs +3 -0
  892. package/locale/kl/index.cjs.js +3 -0
  893. package/locale/kl/index.js +1 -3
  894. package/locale/kl/package.json +14 -0
  895. package/locale/km/index.cjs +3 -0
  896. package/locale/km/index.cjs.js +3 -0
  897. package/locale/km/index.js +1 -3
  898. package/locale/km/package.json +14 -0
  899. package/locale/kn/index.cjs +3 -0
  900. package/locale/kn/index.cjs.js +3 -0
  901. package/locale/kn/index.js +1 -3
  902. package/locale/kn/package.json +14 -0
  903. package/locale/ko/index.cjs +3 -0
  904. package/locale/ko/index.cjs.js +3 -0
  905. package/locale/ko/index.js +1 -3
  906. package/locale/ko/package.json +14 -0
  907. package/locale/kok/index.cjs +3 -0
  908. package/locale/kok/index.cjs.js +3 -0
  909. package/locale/kok/index.js +1 -3
  910. package/locale/kok/package.json +14 -0
  911. package/locale/ksh/index.cjs +3 -0
  912. package/locale/ksh/index.cjs.js +3 -0
  913. package/locale/ksh/index.js +1 -3
  914. package/locale/ksh/package.json +14 -0
  915. package/locale/ku/index.cjs +3 -0
  916. package/locale/ku/index.cjs.js +3 -0
  917. package/locale/ku/index.js +1 -3
  918. package/locale/ku/package.json +14 -0
  919. package/locale/ky/index.cjs +3 -0
  920. package/locale/ky/index.cjs.js +3 -0
  921. package/locale/ky/index.js +1 -3
  922. package/locale/ky/package.json +14 -0
  923. package/locale/lb/index.cjs +3 -0
  924. package/locale/lb/index.cjs.js +3 -0
  925. package/locale/lb/index.js +1 -3
  926. package/locale/lb/package.json +14 -0
  927. package/locale/lkt/index.cjs +3 -0
  928. package/locale/lkt/index.cjs.js +3 -0
  929. package/locale/lkt/index.js +1 -3
  930. package/locale/lkt/package.json +14 -0
  931. package/locale/lo/index.cjs +3 -0
  932. package/locale/lo/index.cjs.js +3 -0
  933. package/locale/lo/index.js +1 -3
  934. package/locale/lo/package.json +14 -0
  935. package/locale/lt/index.cjs +3 -0
  936. package/locale/lt/index.cjs.js +3 -0
  937. package/locale/lt/index.js +1 -3
  938. package/locale/lt/package.json +14 -0
  939. package/locale/lv/index.cjs +3 -0
  940. package/locale/lv/index.cjs.js +3 -0
  941. package/locale/lv/index.js +1 -3
  942. package/locale/lv/package.json +14 -0
  943. package/locale/mk/index.cjs +3 -0
  944. package/locale/mk/index.cjs.js +3 -0
  945. package/locale/mk/index.js +1 -3
  946. package/locale/mk/package.json +14 -0
  947. package/locale/ml/index.cjs +3 -0
  948. package/locale/ml/index.cjs.js +3 -0
  949. package/locale/ml/index.js +1 -3
  950. package/locale/ml/package.json +14 -0
  951. package/locale/mn/index.cjs +3 -0
  952. package/locale/mn/index.cjs.js +3 -0
  953. package/locale/mn/index.js +1 -3
  954. package/locale/mn/package.json +14 -0
  955. package/locale/mni/index.cjs +3 -0
  956. package/locale/mni/index.cjs.js +3 -0
  957. package/locale/mni/index.js +1 -0
  958. package/locale/mni/package.json +14 -0
  959. package/locale/mni.json +159 -0
  960. package/locale/mr/index.cjs +3 -0
  961. package/locale/mr/index.cjs.js +3 -0
  962. package/locale/mr/index.js +1 -3
  963. package/locale/mr/package.json +14 -0
  964. package/locale/ms/index.cjs +3 -0
  965. package/locale/ms/index.cjs.js +3 -0
  966. package/locale/ms/index.js +1 -3
  967. package/locale/ms/package.json +14 -0
  968. package/locale/mt/index.cjs +3 -0
  969. package/locale/mt/index.cjs.js +3 -0
  970. package/locale/mt/index.js +1 -3
  971. package/locale/mt/package.json +14 -0
  972. package/locale/my/index.cjs +3 -0
  973. package/locale/my/index.cjs.js +3 -0
  974. package/locale/my/index.js +1 -3
  975. package/locale/my/package.json +14 -0
  976. package/locale/mzn/index.cjs +3 -0
  977. package/locale/mzn/index.cjs.js +3 -0
  978. package/locale/mzn/index.js +1 -3
  979. package/locale/mzn/package.json +14 -0
  980. package/locale/nb/index.cjs +3 -0
  981. package/locale/nb/index.cjs.js +3 -0
  982. package/locale/nb/index.js +1 -3
  983. package/locale/nb/package.json +14 -0
  984. package/locale/nb.json +2 -2
  985. package/locale/ne/index.cjs +3 -0
  986. package/locale/ne/index.cjs.js +3 -0
  987. package/locale/ne/index.js +1 -3
  988. package/locale/ne/package.json +14 -0
  989. package/locale/nl/index.cjs +3 -0
  990. package/locale/nl/index.cjs.js +3 -0
  991. package/locale/nl/index.js +1 -3
  992. package/locale/nl/package.json +14 -0
  993. package/locale/nn/index.cjs +3 -0
  994. package/locale/nn/index.cjs.js +3 -0
  995. package/locale/nn/index.js +1 -3
  996. package/locale/nn/package.json +14 -0
  997. package/locale/nn.json +10 -10
  998. package/locale/no/index.cjs +3 -0
  999. package/locale/no/index.cjs.js +3 -0
  1000. package/locale/no/index.js +1 -3
  1001. package/locale/no/package.json +14 -0
  1002. package/locale/no.json +2 -2
  1003. package/locale/or/index.cjs +3 -0
  1004. package/locale/or/index.cjs.js +3 -0
  1005. package/locale/or/index.js +1 -3
  1006. package/locale/or/package.json +14 -0
  1007. package/locale/pa/index.cjs +3 -0
  1008. package/locale/pa/index.cjs.js +3 -0
  1009. package/locale/pa/index.js +1 -3
  1010. package/locale/pa/package.json +14 -0
  1011. package/locale/pcm/index.cjs +3 -0
  1012. package/locale/pcm/index.cjs.js +3 -0
  1013. package/locale/pcm/index.js +1 -3
  1014. package/locale/pcm/package.json +14 -0
  1015. package/locale/pl/index.cjs +3 -0
  1016. package/locale/pl/index.cjs.js +3 -0
  1017. package/locale/pl/index.js +1 -3
  1018. package/locale/pl/package.json +14 -0
  1019. package/locale/ps/index.cjs +3 -0
  1020. package/locale/ps/index.cjs.js +3 -0
  1021. package/locale/ps/index.js +1 -3
  1022. package/locale/ps/package.json +14 -0
  1023. package/locale/ps-PK/index.cjs +3 -0
  1024. package/locale/ps-PK/index.cjs.js +3 -0
  1025. package/locale/ps-PK/index.js +1 -3
  1026. package/locale/ps-PK/package.json +14 -0
  1027. package/locale/pt/index.cjs +3 -0
  1028. package/locale/pt/index.cjs.js +3 -0
  1029. package/locale/pt/index.js +1 -3
  1030. package/locale/pt/package.json +14 -0
  1031. package/locale/pt-AO/index.cjs +3 -0
  1032. package/locale/pt-AO/index.cjs.js +3 -0
  1033. package/locale/pt-AO/index.js +1 -3
  1034. package/locale/pt-AO/package.json +14 -0
  1035. package/locale/pt-CH/index.cjs +3 -0
  1036. package/locale/pt-CH/index.cjs.js +3 -0
  1037. package/locale/pt-CH/index.js +1 -3
  1038. package/locale/pt-CH/package.json +14 -0
  1039. package/locale/pt-CV/index.cjs +3 -0
  1040. package/locale/pt-CV/index.cjs.js +3 -0
  1041. package/locale/pt-CV/index.js +1 -3
  1042. package/locale/pt-CV/package.json +14 -0
  1043. package/locale/pt-GQ/index.cjs +3 -0
  1044. package/locale/pt-GQ/index.cjs.js +3 -0
  1045. package/locale/pt-GQ/index.js +1 -3
  1046. package/locale/pt-GQ/package.json +14 -0
  1047. package/locale/pt-GW/index.cjs +3 -0
  1048. package/locale/pt-GW/index.cjs.js +3 -0
  1049. package/locale/pt-GW/index.js +1 -3
  1050. package/locale/pt-GW/package.json +14 -0
  1051. package/locale/pt-LU/index.cjs +3 -0
  1052. package/locale/pt-LU/index.cjs.js +3 -0
  1053. package/locale/pt-LU/index.js +1 -3
  1054. package/locale/pt-LU/package.json +14 -0
  1055. package/locale/pt-MO/index.cjs +3 -0
  1056. package/locale/pt-MO/index.cjs.js +3 -0
  1057. package/locale/pt-MO/index.js +1 -3
  1058. package/locale/pt-MO/package.json +14 -0
  1059. package/locale/pt-MZ/index.cjs +3 -0
  1060. package/locale/pt-MZ/index.cjs.js +3 -0
  1061. package/locale/pt-MZ/index.js +1 -3
  1062. package/locale/pt-MZ/package.json +14 -0
  1063. package/locale/pt-PT/index.cjs +3 -0
  1064. package/locale/pt-PT/index.cjs.js +3 -0
  1065. package/locale/pt-PT/index.js +1 -3
  1066. package/locale/pt-PT/package.json +14 -0
  1067. package/locale/pt-ST/index.cjs +3 -0
  1068. package/locale/pt-ST/index.cjs.js +3 -0
  1069. package/locale/pt-ST/index.js +1 -3
  1070. package/locale/pt-ST/package.json +14 -0
  1071. package/locale/pt-TL/index.cjs +3 -0
  1072. package/locale/pt-TL/index.cjs.js +3 -0
  1073. package/locale/pt-TL/index.js +1 -3
  1074. package/locale/pt-TL/package.json +14 -0
  1075. package/locale/qu/index.cjs +3 -0
  1076. package/locale/qu/index.cjs.js +3 -0
  1077. package/locale/qu/index.js +1 -3
  1078. package/locale/qu/package.json +14 -0
  1079. package/locale/rm/index.cjs +3 -0
  1080. package/locale/rm/index.cjs.js +3 -0
  1081. package/locale/rm/index.js +1 -3
  1082. package/locale/rm/package.json +14 -0
  1083. package/locale/ro/index.cjs +3 -0
  1084. package/locale/ro/index.cjs.js +3 -0
  1085. package/locale/ro/index.js +1 -3
  1086. package/locale/ro/package.json +14 -0
  1087. package/locale/ru/index.cjs +3 -0
  1088. package/locale/ru/index.cjs.js +3 -0
  1089. package/locale/ru/index.js +1 -3
  1090. package/locale/ru/package.json +14 -0
  1091. package/locale/sah/index.cjs +3 -0
  1092. package/locale/sah/index.cjs.js +3 -0
  1093. package/locale/sah/index.js +1 -3
  1094. package/locale/sah/package.json +14 -0
  1095. package/locale/sc/index.cjs +3 -0
  1096. package/locale/sc/index.cjs.js +3 -0
  1097. package/locale/sc/index.js +1 -0
  1098. package/locale/sc/package.json +14 -0
  1099. package/locale/sc.json +249 -0
  1100. package/locale/sd/index.cjs +3 -0
  1101. package/locale/sd/index.cjs.js +3 -0
  1102. package/locale/sd/index.js +1 -3
  1103. package/locale/sd/package.json +14 -0
  1104. package/locale/se/index.cjs +3 -0
  1105. package/locale/se/index.cjs.js +3 -0
  1106. package/locale/se/index.js +1 -3
  1107. package/locale/se/package.json +14 -0
  1108. package/locale/se-FI/index.cjs +3 -0
  1109. package/locale/se-FI/index.cjs.js +3 -0
  1110. package/locale/se-FI/index.js +1 -3
  1111. package/locale/se-FI/package.json +14 -0
  1112. package/locale/si/index.cjs +3 -0
  1113. package/locale/si/index.cjs.js +3 -0
  1114. package/locale/si/index.js +1 -3
  1115. package/locale/si/package.json +14 -0
  1116. package/locale/sk/index.cjs +3 -0
  1117. package/locale/sk/index.cjs.js +3 -0
  1118. package/locale/sk/index.js +1 -3
  1119. package/locale/sk/package.json +14 -0
  1120. package/locale/sl/index.cjs +3 -0
  1121. package/locale/sl/index.cjs.js +3 -0
  1122. package/locale/sl/index.js +1 -3
  1123. package/locale/sl/package.json +14 -0
  1124. package/locale/so/index.cjs +3 -0
  1125. package/locale/so/index.cjs.js +3 -0
  1126. package/locale/so/index.js +1 -3
  1127. package/locale/so/package.json +14 -0
  1128. package/locale/sq/index.cjs +3 -0
  1129. package/locale/sq/index.cjs.js +3 -0
  1130. package/locale/sq/index.js +1 -3
  1131. package/locale/sq/package.json +14 -0
  1132. package/locale/sr/index.cjs +3 -0
  1133. package/locale/sr/index.cjs.js +3 -0
  1134. package/locale/sr/index.js +1 -3
  1135. package/locale/sr/package.json +14 -0
  1136. package/locale/sr-Cyrl-BA/index.cjs +3 -0
  1137. package/locale/sr-Cyrl-BA/index.cjs.js +3 -0
  1138. package/locale/sr-Cyrl-BA/index.js +1 -3
  1139. package/locale/sr-Cyrl-BA/package.json +14 -0
  1140. package/locale/sr-Cyrl-BA.json +2 -2
  1141. package/locale/sr-Latn/index.cjs +3 -0
  1142. package/locale/sr-Latn/index.cjs.js +3 -0
  1143. package/locale/sr-Latn/index.js +1 -3
  1144. package/locale/sr-Latn/package.json +14 -0
  1145. package/locale/sr-Latn-BA/index.cjs +3 -0
  1146. package/locale/sr-Latn-BA/index.cjs.js +3 -0
  1147. package/locale/sr-Latn-BA/index.js +1 -3
  1148. package/locale/sr-Latn-BA/package.json +14 -0
  1149. package/locale/sr-Latn-BA.json +2 -2
  1150. package/locale/sr-Latn.json +3 -3
  1151. package/locale/sr.json +3 -3
  1152. package/locale/su/index.cjs +3 -0
  1153. package/locale/su/index.cjs.js +3 -0
  1154. package/locale/su/index.js +1 -3
  1155. package/locale/su/package.json +14 -0
  1156. package/locale/sv/index.cjs +3 -0
  1157. package/locale/sv/index.cjs.js +3 -0
  1158. package/locale/sv/index.js +1 -3
  1159. package/locale/sv/package.json +14 -0
  1160. package/locale/sw/index.cjs +3 -0
  1161. package/locale/sw/index.cjs.js +3 -0
  1162. package/locale/sw/index.js +1 -3
  1163. package/locale/sw/package.json +14 -0
  1164. package/locale/ta/index.cjs +3 -0
  1165. package/locale/ta/index.cjs.js +3 -0
  1166. package/locale/ta/index.js +1 -3
  1167. package/locale/ta/package.json +14 -0
  1168. package/locale/te/index.cjs +3 -0
  1169. package/locale/te/index.cjs.js +3 -0
  1170. package/locale/te/index.js +1 -3
  1171. package/locale/te/package.json +14 -0
  1172. package/locale/tg/index.cjs +3 -0
  1173. package/locale/tg/index.cjs.js +3 -0
  1174. package/locale/tg/index.js +1 -3
  1175. package/locale/tg/package.json +14 -0
  1176. package/locale/th/index.cjs +3 -0
  1177. package/locale/th/index.cjs.js +3 -0
  1178. package/locale/th/index.js +1 -3
  1179. package/locale/th/package.json +14 -0
  1180. package/locale/ti/index.cjs +3 -0
  1181. package/locale/ti/index.cjs.js +3 -0
  1182. package/locale/ti/index.js +1 -3
  1183. package/locale/ti/package.json +14 -0
  1184. package/locale/ti.json +1 -1
  1185. package/locale/tk/index.cjs +3 -0
  1186. package/locale/tk/index.cjs.js +3 -0
  1187. package/locale/tk/index.js +1 -3
  1188. package/locale/tk/package.json +14 -0
  1189. package/locale/to/index.cjs +3 -0
  1190. package/locale/to/index.cjs.js +3 -0
  1191. package/locale/to/index.js +1 -3
  1192. package/locale/to/package.json +14 -0
  1193. package/locale/tr/index.cjs +3 -0
  1194. package/locale/tr/index.cjs.js +3 -0
  1195. package/locale/tr/index.js +1 -3
  1196. package/locale/tr/package.json +14 -0
  1197. package/locale/tt/index.cjs +3 -0
  1198. package/locale/tt/index.cjs.js +3 -0
  1199. package/locale/tt/index.js +1 -3
  1200. package/locale/tt/package.json +14 -0
  1201. package/locale/ug/index.cjs +3 -0
  1202. package/locale/ug/index.cjs.js +3 -0
  1203. package/locale/ug/index.js +1 -3
  1204. package/locale/ug/package.json +14 -0
  1205. package/locale/uk/index.cjs +3 -0
  1206. package/locale/uk/index.cjs.js +3 -0
  1207. package/locale/uk/index.js +1 -3
  1208. package/locale/uk/package.json +14 -0
  1209. package/locale/ur/index.cjs +3 -0
  1210. package/locale/ur/index.cjs.js +3 -0
  1211. package/locale/ur/index.js +1 -3
  1212. package/locale/ur/package.json +14 -0
  1213. package/locale/ur-IN/index.cjs +3 -0
  1214. package/locale/ur-IN/index.cjs.js +3 -0
  1215. package/locale/ur-IN/index.js +1 -3
  1216. package/locale/ur-IN/package.json +14 -0
  1217. package/locale/uz/index.cjs +3 -0
  1218. package/locale/uz/index.cjs.js +3 -0
  1219. package/locale/uz/index.js +1 -3
  1220. package/locale/uz/package.json +14 -0
  1221. package/locale/uz-Cyrl/index.cjs +3 -0
  1222. package/locale/uz-Cyrl/index.cjs.js +3 -0
  1223. package/locale/uz-Cyrl/index.js +1 -3
  1224. package/locale/uz-Cyrl/package.json +14 -0
  1225. package/locale/vi/index.cjs +3 -0
  1226. package/locale/vi/index.cjs.js +3 -0
  1227. package/locale/vi/index.js +1 -3
  1228. package/locale/vi/package.json +14 -0
  1229. package/locale/wae/index.cjs +3 -0
  1230. package/locale/wae/index.cjs.js +3 -0
  1231. package/locale/wae/index.js +1 -3
  1232. package/locale/wae/package.json +14 -0
  1233. package/locale/wo/index.cjs +3 -0
  1234. package/locale/wo/index.cjs.js +3 -0
  1235. package/locale/wo/index.js +1 -3
  1236. package/locale/wo/package.json +14 -0
  1237. package/locale/yi/index.cjs +3 -0
  1238. package/locale/yi/index.cjs.js +3 -0
  1239. package/locale/yi/index.js +1 -3
  1240. package/locale/yi/package.json +14 -0
  1241. package/locale/yo/index.cjs +3 -0
  1242. package/locale/yo/index.cjs.js +3 -0
  1243. package/locale/yo/index.js +1 -3
  1244. package/locale/yo/package.json +14 -0
  1245. package/locale/yo-BJ/index.cjs +3 -0
  1246. package/locale/yo-BJ/index.cjs.js +3 -0
  1247. package/locale/yo-BJ/index.js +1 -3
  1248. package/locale/yo-BJ/package.json +14 -0
  1249. package/locale/yrl/index.cjs +3 -0
  1250. package/locale/yrl/index.cjs.js +3 -0
  1251. package/locale/yrl/index.js +1 -0
  1252. package/locale/yrl/package.json +14 -0
  1253. package/locale/yrl.json +309 -0
  1254. package/locale/yue/index.cjs +3 -0
  1255. package/locale/yue/index.cjs.js +3 -0
  1256. package/locale/yue/index.js +1 -3
  1257. package/locale/yue/package.json +14 -0
  1258. package/locale/yue-Hans/index.cjs +3 -0
  1259. package/locale/yue-Hans/index.cjs.js +3 -0
  1260. package/locale/yue-Hans/index.js +1 -3
  1261. package/locale/yue-Hans/package.json +14 -0
  1262. package/locale/zh/index.cjs +3 -0
  1263. package/locale/zh/index.cjs.js +3 -0
  1264. package/locale/zh/index.js +1 -3
  1265. package/locale/zh/package.json +14 -0
  1266. package/locale/zh-Hans-HK/index.cjs +3 -0
  1267. package/locale/zh-Hans-HK/index.cjs.js +3 -0
  1268. package/locale/zh-Hans-HK/index.js +1 -3
  1269. package/locale/zh-Hans-HK/package.json +14 -0
  1270. package/locale/zh-Hans-MO/index.cjs +3 -0
  1271. package/locale/zh-Hans-MO/index.cjs.js +3 -0
  1272. package/locale/zh-Hans-MO/index.js +1 -3
  1273. package/locale/zh-Hans-MO/package.json +14 -0
  1274. package/locale/zh-Hans-SG/index.cjs +3 -0
  1275. package/locale/zh-Hans-SG/index.cjs.js +3 -0
  1276. package/locale/zh-Hans-SG/index.js +1 -3
  1277. package/locale/zh-Hans-SG/package.json +14 -0
  1278. package/locale/zh-Hant/index.cjs +3 -0
  1279. package/locale/zh-Hant/index.cjs.js +3 -0
  1280. package/locale/zh-Hant/index.js +1 -3
  1281. package/locale/zh-Hant/package.json +14 -0
  1282. package/locale/zh-Hant-HK/index.cjs +3 -0
  1283. package/locale/zh-Hant-HK/index.cjs.js +3 -0
  1284. package/locale/zh-Hant-HK/index.js +1 -3
  1285. package/locale/zh-Hant-HK/package.json +14 -0
  1286. package/locale/zh-Hant-MO/index.cjs +3 -0
  1287. package/locale/zh-Hant-MO/index.cjs.js +3 -0
  1288. package/locale/zh-Hant-MO/index.js +1 -3
  1289. package/locale/zh-Hant-MO/package.json +14 -0
  1290. package/locale/zu/index.cjs +3 -0
  1291. package/locale/zu/index.cjs.js +3 -0
  1292. package/locale/zu/index.js +1 -3
  1293. package/locale/zu/package.json +14 -0
  1294. package/locale-more-styles/ckb/long-time.json +9 -0
  1295. package/locale-more-styles/ckb/mini.json +9 -0
  1296. package/locale-more-styles/ckb/now.json +7 -0
  1297. package/locale-more-styles/ckb/short-time.json +12 -0
  1298. package/modules/LocaleDataStore.js.map +1 -1
  1299. package/modules/PropTypes.js +7 -1
  1300. package/modules/PropTypes.js.map +1 -1
  1301. package/modules/TimeAgo.js +25 -45
  1302. package/modules/TimeAgo.js.map +1 -1
  1303. package/modules/TimeAgo.test.js +7 -39
  1304. package/modules/TimeAgo.test.js.map +1 -1
  1305. package/modules/cache.js +8 -12
  1306. package/modules/cache.js.map +1 -1
  1307. package/modules/cache.test.js +1 -1
  1308. package/modules/cache.test.js.map +1 -1
  1309. package/modules/isStyleObject.js +15 -0
  1310. package/modules/isStyleObject.js.map +1 -0
  1311. package/modules/isStyleObject.test.js +34 -0
  1312. package/modules/isStyleObject.test.js.map +1 -0
  1313. package/modules/locale.js +9 -14
  1314. package/modules/locale.js.map +1 -1
  1315. package/modules/locale.test.js +2 -2
  1316. package/modules/locale.test.js.map +1 -1
  1317. package/modules/round.js.map +1 -1
  1318. package/modules/steps/approximate.js +1 -1
  1319. package/modules/steps/approximate.js.map +1 -1
  1320. package/modules/steps/approximate.test.js +2 -2
  1321. package/modules/steps/approximate.test.js.map +1 -1
  1322. package/modules/steps/getStep.js +6 -4
  1323. package/modules/steps/getStep.js.map +1 -1
  1324. package/modules/steps/getStep.test.js +5 -5
  1325. package/modules/steps/getStep.test.js.map +1 -1
  1326. package/modules/steps/getStepDenominator.js +1 -1
  1327. package/modules/steps/getStepDenominator.js.map +1 -1
  1328. package/modules/steps/getStepDenominator.test.js +1 -1
  1329. package/modules/steps/getStepDenominator.test.js.map +1 -1
  1330. package/modules/steps/getStepMinTime.js +4 -4
  1331. package/modules/steps/getStepMinTime.js.map +1 -1
  1332. package/modules/steps/getStepMinTime.test.js +1 -1
  1333. package/modules/steps/getStepMinTime.test.js.map +1 -1
  1334. package/modules/steps/getTimeToNextUpdate.js +3 -3
  1335. package/modules/steps/getTimeToNextUpdate.js.map +1 -1
  1336. package/modules/steps/getTimeToNextUpdate.test.js +1 -1
  1337. package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
  1338. package/modules/steps/getTimeToNextUpdateForUnit.js +2 -2
  1339. package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  1340. package/modules/steps/getTimeToNextUpdateForUnit.test.js +1 -1
  1341. package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  1342. package/modules/steps/helpers.js.map +1 -1
  1343. package/modules/steps/helpers.test.js +1 -1
  1344. package/modules/steps/helpers.test.js.map +1 -1
  1345. package/modules/steps/index.js +4 -4
  1346. package/modules/steps/index.js.map +1 -1
  1347. package/modules/steps/renameLegacyProperties.js +7 -7
  1348. package/modules/steps/renameLegacyProperties.js.map +1 -1
  1349. package/modules/steps/renameLegacyProperties.test.js +2 -2
  1350. package/modules/steps/renameLegacyProperties.test.js.map +1 -1
  1351. package/modules/steps/round.js.map +1 -1
  1352. package/modules/steps/round.test.js +2 -2
  1353. package/modules/steps/round.test.js.map +1 -1
  1354. package/modules/steps/units.js.map +1 -1
  1355. package/modules/style/approximate.js +1 -1
  1356. package/modules/style/approximate.js.map +1 -1
  1357. package/modules/style/approximateTime.js +1 -1
  1358. package/modules/style/approximateTime.js.map +1 -1
  1359. package/modules/style/approximateTime.test.js +11 -16
  1360. package/modules/style/approximateTime.test.js.map +1 -1
  1361. package/modules/style/getStyleByName.js +13 -13
  1362. package/modules/style/getStyleByName.js.map +1 -1
  1363. package/modules/style/mini.js.map +1 -1
  1364. package/modules/style/mini.test.js +8 -6
  1365. package/modules/style/mini.test.js.map +1 -1
  1366. package/modules/style/miniMinute.js +5 -3
  1367. package/modules/style/miniMinute.js.map +1 -1
  1368. package/modules/style/miniMinute.test.js +8 -6
  1369. package/modules/style/miniMinute.test.js.map +1 -1
  1370. package/modules/style/miniMinuteNow.js +5 -3
  1371. package/modules/style/miniMinuteNow.js.map +1 -1
  1372. package/modules/style/miniMinuteNow.test.js +8 -6
  1373. package/modules/style/miniMinuteNow.test.js.map +1 -1
  1374. package/modules/style/miniNow.js +5 -3
  1375. package/modules/style/miniNow.js.map +1 -1
  1376. package/modules/style/miniNow.test.js +8 -6
  1377. package/modules/style/miniNow.test.js.map +1 -1
  1378. package/modules/style/renameLegacyProperties.js +4 -2
  1379. package/modules/style/renameLegacyProperties.js.map +1 -1
  1380. package/modules/style/renameLegacyProperties.test.js +2 -2
  1381. package/modules/style/renameLegacyProperties.test.js.map +1 -1
  1382. package/modules/style/round.js +1 -1
  1383. package/modules/style/round.js.map +1 -1
  1384. package/modules/style/round.test.js +17 -11
  1385. package/modules/style/round.test.js.map +1 -1
  1386. package/modules/style/roundMinute.js +5 -3
  1387. package/modules/style/roundMinute.js.map +1 -1
  1388. package/modules/style/roundMinute.test.js +8 -6
  1389. package/modules/style/roundMinute.test.js.map +1 -1
  1390. package/modules/style/twitter.js +13 -13
  1391. package/modules/style/twitter.js.map +1 -1
  1392. package/modules/style/twitter.test.js +9 -7
  1393. package/modules/style/twitter.test.js.map +1 -1
  1394. package/modules/style/twitterFirstMinute.js +7 -5
  1395. package/modules/style/twitterFirstMinute.js.map +1 -1
  1396. package/modules/style/twitterFirstMinute.test.js +10 -8
  1397. package/modules/style/twitterFirstMinute.test.js.map +1 -1
  1398. package/modules/style/twitterMinute.js +5 -3
  1399. package/modules/style/twitterMinute.js.map +1 -1
  1400. package/modules/style/twitterMinute.test.js +10 -8
  1401. package/modules/style/twitterMinute.test.js.map +1 -1
  1402. package/modules/style/twitterMinuteNow.js +5 -3
  1403. package/modules/style/twitterMinuteNow.js.map +1 -1
  1404. package/modules/style/twitterMinuteNow.test.js +10 -8
  1405. package/modules/style/twitterMinuteNow.test.js.map +1 -1
  1406. package/modules/style/twitterNow.js +5 -3
  1407. package/modules/style/twitterNow.js.map +1 -1
  1408. package/modules/style/twitterNow.test.js +10 -8
  1409. package/modules/style/twitterNow.test.js.map +1 -1
  1410. package/package.json +671 -75
  1411. package/prop-types/index.cjs +2 -0
  1412. package/prop-types/index.cjs.js +7 -0
  1413. package/prop-types/index.js +1 -1
  1414. package/prop-types/package.json +9 -3
  1415. package/{rollup.config.js → rollup.config.mjs} +1 -1
  1416. package/steps/index.cjs +1 -0
  1417. package/steps/index.cjs.js +6 -0
  1418. package/steps/index.js +1 -1
  1419. package/steps/package.json +9 -3
  1420. package/cache/index.commonjs.js +0 -2
  1421. package/gradation/index.commonjs.js +0 -2
  1422. package/index.commonjs.js +0 -9
  1423. package/load-all-locales.js +0 -275
  1424. package/locale/en-PH/index.js +0 -3
  1425. package/prop-types/index.commonjs.js +0 -2
  1426. package/steps/index.commonjs.js +0 -2
@@ -0,0 +1,15 @@
1
+ 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); }
2
+
3
+ export default function isStyleObject(object) {
4
+ return isObject(object) && (Array.isArray(object.steps) || // `gradation` property is deprecated: it has been renamed to `steps`.
5
+ Array.isArray(object.gradation) || // `flavour` property is deprecated: it has been renamed to `labels`.
6
+ Array.isArray(object.flavour) || typeof object.flavour === 'string' || Array.isArray(object.labels) || typeof object.labels === 'string' || // `units` property is deprecated.
7
+ Array.isArray(object.units) || // `custom` property is deprecated.
8
+ typeof object.custom === 'function');
9
+ }
10
+ var OBJECT_CONSTRUCTOR = {}.constructor;
11
+
12
+ function isObject(object) {
13
+ return _typeof(object) !== undefined && object !== null && object.constructor === OBJECT_CONSTRUCTOR;
14
+ }
15
+ //# sourceMappingURL=isStyleObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isStyleObject.js","names":["isStyleObject","object","isObject","Array","isArray","steps","gradation","flavour","labels","units","custom","OBJECT_CONSTRUCTOR","constructor","undefined"],"sources":["../source/isStyleObject.js"],"sourcesContent":["export default function isStyleObject(object) {\r\n\treturn isObject(object) && (\r\n\t\tArray.isArray(object.steps) ||\r\n\t\t// `gradation` property is deprecated: it has been renamed to `steps`.\r\n\t\tArray.isArray(object.gradation) ||\r\n\t\t// `flavour` property is deprecated: it has been renamed to `labels`.\r\n\t\tArray.isArray(object.flavour) ||\r\n\t\ttypeof object.flavour === 'string' ||\r\n\t\tArray.isArray(object.labels) ||\r\n\t\ttypeof object.labels === 'string' ||\r\n\t\t// `units` property is deprecated.\r\n\t\tArray.isArray(object.units) ||\r\n\t\t// `custom` property is deprecated.\r\n\t\ttypeof object.custom === 'function'\r\n\t)\r\n}\r\n\r\nconst OBJECT_CONSTRUCTOR = {}.constructor\r\nfunction isObject(object) {\r\n\treturn typeof object !== undefined && object !== null && object.constructor === OBJECT_CONSTRUCTOR\r\n}"],"mappings":";;AAAA,eAAe,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;EAC7C,OAAOC,QAAQ,CAACD,MAAD,CAAR,KACNE,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACI,KAArB,KACA;EACAF,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACK,SAArB,CAFA,IAGA;EACAH,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACM,OAArB,CAJA,IAKA,OAAON,MAAM,CAACM,OAAd,KAA0B,QAL1B,IAMAJ,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACO,MAArB,CANA,IAOA,OAAOP,MAAM,CAACO,MAAd,KAAyB,QAPzB,IAQA;EACAL,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACQ,KAArB,CATA,IAUA;EACA,OAAOR,MAAM,CAACS,MAAd,KAAyB,UAZnB,CAAP;AAcA;AAED,IAAMC,kBAAkB,GAAG,GAAGC,WAA9B;;AACA,SAASV,QAAT,CAAkBD,MAAlB,EAA0B;EACzB,OAAO,QAAOA,MAAP,MAAkBY,SAAlB,IAA+BZ,MAAM,KAAK,IAA1C,IAAkDA,MAAM,CAACW,WAAP,KAAuBD,kBAAhF;AACA"}
@@ -0,0 +1,34 @@
1
+ import isStyleObject from './isStyleObject.js';
2
+ describe('isStyleObject', function () {
3
+ it('should detect a style object', function () {
4
+ isStyleObject({
5
+ gradation: []
6
+ }).should.equal(true);
7
+ isStyleObject({
8
+ steps: []
9
+ }).should.equal(true);
10
+ isStyleObject({
11
+ flavour: 'long'
12
+ }).should.equal(true);
13
+ isStyleObject({
14
+ flavour: ['long']
15
+ }).should.equal(true);
16
+ isStyleObject({
17
+ labels: 'long'
18
+ }).should.equal(true);
19
+ isStyleObject({
20
+ labels: ['long']
21
+ }).should.equal(true);
22
+ isStyleObject({
23
+ units: ['now']
24
+ }).should.equal(true);
25
+ isStyleObject({
26
+ future: true,
27
+ round: 'floor',
28
+ now: 0,
29
+ getTimeToNextUpdate: true
30
+ }).should.equal(false);
31
+ isStyleObject('round').should.equal(false);
32
+ });
33
+ });
34
+ //# sourceMappingURL=isStyleObject.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isStyleObject.test.js","names":["isStyleObject","describe","it","gradation","should","equal","steps","flavour","labels","units","future","round","now","getTimeToNextUpdate"],"sources":["../source/isStyleObject.test.js"],"sourcesContent":["import isStyleObject from './isStyleObject.js'\r\n\r\ndescribe('isStyleObject', () => {\r\n\tit('should detect a style object', () => {\r\n\t\tisStyleObject({\r\n\t\t\tgradation: []\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tsteps: []\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tflavour: 'long'\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tflavour: ['long']\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tlabels: 'long'\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tlabels: ['long']\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tunits: ['now']\r\n\t\t}).should.equal(true)\r\n\t\tisStyleObject({\r\n\t\t\tfuture: true,\r\n\t\t\tround: 'floor',\r\n\t\t\tnow: 0,\r\n\t\t\tgetTimeToNextUpdate: true\r\n\t\t}).should.equal(false)\r\n\t\tisStyleObject('round').should.equal(false)\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,oBAA1B;AAEAC,QAAQ,CAAC,eAAD,EAAkB,YAAM;EAC/BC,EAAE,CAAC,8BAAD,EAAiC,YAAM;IACxCF,aAAa,CAAC;MACbG,SAAS,EAAE;IADE,CAAD,CAAb,CAEGC,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbM,KAAK,EAAE;IADM,CAAD,CAAb,CAEGF,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbO,OAAO,EAAE;IADI,CAAD,CAAb,CAEGH,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbO,OAAO,EAAE,CAAC,MAAD;IADI,CAAD,CAAb,CAEGH,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbQ,MAAM,EAAE;IADK,CAAD,CAAb,CAEGJ,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbQ,MAAM,EAAE,CAAC,MAAD;IADK,CAAD,CAAb,CAEGJ,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbS,KAAK,EAAE,CAAC,KAAD;IADM,CAAD,CAAb,CAEGL,MAFH,CAEUC,KAFV,CAEgB,IAFhB;IAGAL,aAAa,CAAC;MACbU,MAAM,EAAE,IADK;MAEbC,KAAK,EAAE,OAFM;MAGbC,GAAG,EAAE,CAHQ;MAIbC,mBAAmB,EAAE;IAJR,CAAD,CAAb,CAKGT,MALH,CAKUC,KALV,CAKgB,KALhB;IAMAL,aAAa,CAAC,OAAD,CAAb,CAAuBI,MAAvB,CAA8BC,KAA9B,CAAoC,KAApC;EACA,CA7BC,CAAF;AA8BA,CA/BO,CAAR"}
package/modules/locale.js CHANGED
@@ -1,4 +1,10 @@
1
- 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); }
1
+ 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); }
2
+
3
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2
8
 
3
9
  /**
4
10
  * Chooses the most appropriate locale
@@ -18,19 +24,8 @@ export default function chooseLocale(locales, isLocaleDataAvailable) {
18
24
  // This is not an intelligent algorithm,
19
25
  // but it will do for this library's case.
20
26
  // `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.
21
- for (var _iterator = locales, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
22
- var _ref;
23
-
24
- if (_isArray) {
25
- if (_i >= _iterator.length) break;
26
- _ref = _iterator[_i++];
27
- } else {
28
- _i = _iterator.next();
29
- if (_i.done) break;
30
- _ref = _i.value;
31
- }
32
-
33
- var locale = _ref;
27
+ for (var _iterator = _createForOfIteratorHelperLoose(locales), _step; !(_step = _iterator()).done;) {
28
+ var locale = _step.value;
34
29
 
35
30
  if (isLocaleDataAvailable(locale)) {
36
31
  return locale;
@@ -1 +1 @@
1
- {"version":3,"sources":["../source/locale.js"],"names":["chooseLocale","locales","isLocaleDataAvailable","locale","parts","split","length","pop","join","Error","intlDateTimeFormatSupportedLocale","intlDateTimeFormatSupported","Intl","DateTimeFormat","supportedLocalesOf","isIntlAvailable"],"mappings":";;AAAA;;;;;;;;;;;;;;AAcA,eAAe,SAASA,YAAT,CAAsBC,OAAtB,EAA+BC,qBAA/B,EAAsD;AACpE;AACA;AACA;AACA,uBAAmBD,OAAnB,kHAA4B;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,QAAnBE,MAAmB;;AAC3B,QAAID,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;AAClC,aAAOA,MAAP;AACA;;AACD,QAAMC,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,GAAb,CAAd;;AACA,WAAOD,KAAK,CAACE,MAAN,GAAe,CAAtB,EAAyB;AACxBF,MAAAA,KAAK,CAACG,GAAN;AACAJ,MAAAA,MAAM,GAAGC,KAAK,CAACI,IAAN,CAAW,GAAX,CAAT;;AACA,UAAIN,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;AAClC,eAAOA,MAAP;AACA;AACD;AACD;;AAED,QAAM,IAAIM,KAAJ,sEAAwER,OAAO,CAACO,IAAR,CAAa,IAAb,CAAxE,EAAN;AACA;AAED;;;;;;;AAMA,OAAO,SAASE,iCAAT,CAA2CT,OAA3C,EAAoD;AAC1D;AACA,MAAIU,2BAA2B,EAA/B,EAAmC;AAClC,WAAOC,IAAI,CAACC,cAAL,CAAoBC,kBAApB,CAAuCb,OAAvC,EAAgD,CAAhD,CAAP;AACA;AACD;AAED;;;;;AAIA,OAAO,SAASU,2BAAT,GAAuC;AAC7C;AACA;;AACA;AACA,MAAMI,eAAe,GAAG,QAAOH,IAAP,yCAAOA,IAAP,OAAgB,QAAxC;AACA,SAAOG,eAAe,IAAI,OAAOH,IAAI,CAACC,cAAZ,KAA+B,UAAzD;AACA","sourcesContent":["/**\r\n * Chooses the most appropriate locale\r\n * (one of the registered ones)\r\n * based on the list of preferred `locales` supplied by the user.\r\n *\r\n * @param {string[]} locales - the list of preferable locales (in [IETF format](https://en.wikipedia.org/wiki/IETF_language_tag)).\r\n * @param {Function} isLocaleDataAvailable - tests if a locale is available.\r\n *\r\n * @returns {string} The most suitable locale.\r\n *\r\n * @example\r\n * // Returns 'en'\r\n * chooseLocale(['en-US'], undefined, (locale) => locale === 'ru' || locale === 'en')\r\n */\r\nexport default function chooseLocale(locales, isLocaleDataAvailable) {\r\n\t// This is not an intelligent algorithm,\r\n\t// but it will do for this library's case.\r\n\t// `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.\r\n\tfor (let locale of locales) {\r\n\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\treturn locale\r\n\t\t}\r\n\t\tconst parts = locale.split('-')\r\n\t\twhile (parts.length > 1) {\r\n\t\t\tparts.pop()\r\n\t\t\tlocale = parts.join('-')\r\n\t\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\t\treturn locale\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error(`No locale data has been registered for any of the locales: ${locales.join(', ')}`)\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat` for these `locales`.\r\n * Returns the first suitable one.\r\n * @param {(string|string[])} locales\r\n * @return {?string} The first locale that can be used.\r\n */\r\nexport function intlDateTimeFormatSupportedLocale(locales) {\r\n\t/* istanbul ignore else */\r\n\tif (intlDateTimeFormatSupported()) {\r\n\t\treturn Intl.DateTimeFormat.supportedLocalesOf(locales)[0]\r\n\t}\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat`.\r\n * @return {boolean}\r\n */\r\nexport function intlDateTimeFormatSupported() {\r\n\t// Babel transforms `typeof` into some \"branches\"\r\n\t// so istanbul will show this as \"branch not covered\".\r\n\t/* istanbul ignore next */\r\n\tconst isIntlAvailable = typeof Intl === 'object'\r\n\treturn isIntlAvailable && typeof Intl.DateTimeFormat === 'function'\r\n}\r\n"],"file":"locale.js"}
1
+ {"version":3,"file":"locale.js","names":["chooseLocale","locales","isLocaleDataAvailable","locale","parts","split","length","pop","join","Error","intlDateTimeFormatSupportedLocale","intlDateTimeFormatSupported","Intl","DateTimeFormat","supportedLocalesOf","isIntlAvailable"],"sources":["../source/locale.js"],"sourcesContent":["/**\r\n * Chooses the most appropriate locale\r\n * (one of the registered ones)\r\n * based on the list of preferred `locales` supplied by the user.\r\n *\r\n * @param {string[]} locales - the list of preferable locales (in [IETF format](https://en.wikipedia.org/wiki/IETF_language_tag)).\r\n * @param {Function} isLocaleDataAvailable - tests if a locale is available.\r\n *\r\n * @returns {string} The most suitable locale.\r\n *\r\n * @example\r\n * // Returns 'en'\r\n * chooseLocale(['en-US'], undefined, (locale) => locale === 'ru' || locale === 'en')\r\n */\r\nexport default function chooseLocale(locales, isLocaleDataAvailable) {\r\n\t// This is not an intelligent algorithm,\r\n\t// but it will do for this library's case.\r\n\t// `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.\r\n\tfor (let locale of locales) {\r\n\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\treturn locale\r\n\t\t}\r\n\t\tconst parts = locale.split('-')\r\n\t\twhile (parts.length > 1) {\r\n\t\t\tparts.pop()\r\n\t\t\tlocale = parts.join('-')\r\n\t\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\t\treturn locale\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error(`No locale data has been registered for any of the locales: ${locales.join(', ')}`)\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat` for these `locales`.\r\n * Returns the first suitable one.\r\n * @param {(string|string[])} locales\r\n * @return {?string} The first locale that can be used.\r\n */\r\nexport function intlDateTimeFormatSupportedLocale(locales) {\r\n\t/* istanbul ignore else */\r\n\tif (intlDateTimeFormatSupported()) {\r\n\t\treturn Intl.DateTimeFormat.supportedLocalesOf(locales)[0]\r\n\t}\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat`.\r\n * @return {boolean}\r\n */\r\nexport function intlDateTimeFormatSupported() {\r\n\t// Babel transforms `typeof` into some \"branches\"\r\n\t// so istanbul will show this as \"branch not covered\".\r\n\t/* istanbul ignore next */\r\n\tconst isIntlAvailable = typeof Intl === 'object'\r\n\treturn isIntlAvailable && typeof Intl.DateTimeFormat === 'function'\r\n}\r\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,YAAT,CAAsBC,OAAtB,EAA+BC,qBAA/B,EAAsD;EACpE;EACA;EACA;EACA,qDAAmBD,OAAnB,wCAA4B;IAAA,IAAnBE,MAAmB;;IAC3B,IAAID,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;MAClC,OAAOA,MAAP;IACA;;IACD,IAAMC,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,GAAb,CAAd;;IACA,OAAOD,KAAK,CAACE,MAAN,GAAe,CAAtB,EAAyB;MACxBF,KAAK,CAACG,GAAN;MACAJ,MAAM,GAAGC,KAAK,CAACI,IAAN,CAAW,GAAX,CAAT;;MACA,IAAIN,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;QAClC,OAAOA,MAAP;MACA;IACD;EACD;;EAED,MAAM,IAAIM,KAAJ,sEAAwER,OAAO,CAACO,IAAR,CAAa,IAAb,CAAxE,EAAN;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,iCAAT,CAA2CT,OAA3C,EAAoD;EAC1D;EACA,IAAIU,2BAA2B,EAA/B,EAAmC;IAClC,OAAOC,IAAI,CAACC,cAAL,CAAoBC,kBAApB,CAAuCb,OAAvC,EAAgD,CAAhD,CAAP;EACA;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASU,2BAAT,GAAuC;EAC7C;EACA;;EACA;EACA,IAAMI,eAAe,GAAG,QAAOH,IAAP,yCAAOA,IAAP,OAAgB,QAAxC;EACA,OAAOG,eAAe,IAAI,OAAOH,IAAI,CAACC,cAAZ,KAA+B,UAAzD;AACA"}
@@ -1,4 +1,4 @@
1
- import chooseLocale, { intlDateTimeFormatSupportedLocale } from './locale';
1
+ import chooseLocale, { intlDateTimeFormatSupportedLocale } from './locale.js';
2
2
  describe('locale', function () {
3
3
  it("should tell if can use Intl for date formatting", function () {
4
4
  intlDateTimeFormatSupportedLocale('en').should.equal('en');
@@ -35,7 +35,7 @@ describe('locale', function () {
35
35
  choose('fr-FR', ['en', 'fr-FR']).should.equal('fr-FR');
36
36
  expect(function () {
37
37
  return choose('fr-FR', ['de', 'ru']);
38
- }).to.throw('No locale data has been registered for any of the locales: fr-FR');
38
+ }).to["throw"]('No locale data has been registered for any of the locales: fr-FR');
39
39
  });
40
40
  });
41
41
  //# sourceMappingURL=locale.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../source/locale.test.js"],"names":["chooseLocale","intlDateTimeFormatSupportedLocale","describe","it","should","equal","arrayToObject","array","reduce","object","locale","choose","locales","defaultLocale","concat","_","includes","expect","to","throw"],"mappings":"AAAA,OAAOA,YAAP,IAAuBC,iCAAvB,QAAgE,UAAhE;AAEAC,QAAQ,CAAC,QAAD,EAAW,YAAM;AACxBC,EAAAA,EAAE,oDAAoD,YAAM;AAC3DF,IAAAA,iCAAiC,CAAC,IAAD,CAAjC,CAAwCG,MAAxC,CAA+CC,KAA/C,CAAqD,IAArD;AACAJ,IAAAA,iCAAiC,CAAC,OAAD,CAAjC,CAA2CG,MAA3C,CAAkDC,KAAlD,CAAwD,OAAxD;AACAJ,IAAAA,iCAAiC,CAAC,CAAC,IAAD,EAAO,IAAP,CAAD,CAAjC,CAAgDG,MAAhD,CAAuDC,KAAvD,CAA6D,IAA7D;AACA,GAJC,CAAF;AAMAF,EAAAA,EAAE,8CAA8C,YAAM;AACrD,aAASG,aAAT,CAAuBC,KAAvB,EAA8B;AAC7B,aAAOA,KAAK,CAACC,MAAN,CAAa,UAACC,MAAD,EAASC,MAAT,EAAoB;AACvCD,QAAAA,MAAM,CAACC,MAAD,CAAN,G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AAtD,CAA4D,IAA5D;AACAM,IAAAA,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,OAAP,CAAV,CAAN,CAAiCP,MAAjC,CAAwCC,KAAxC,CAA8C,OAA9C;AAEAY,IAAAA,MAAM,CAAC;AAAA,aAAMN,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,IAAP,CAAV,CAAZ;AAAA,KAAD,CAAN,CAA4CO,EAA5C,CAA+CC,KAA/C,CACC,kEADD;AAGA,GA3BC,CAAF;AA4BA,CAnCO,CAAR","sourcesContent":["import chooseLocale, { intlDateTimeFormatSupportedLocale } from './locale'\r\n\r\ndescribe('locale', () => {\r\n\tit(`should tell if can use Intl for date formatting`, () => {\r\n\t\tintlDateTimeFormatSupportedLocale('en').should.equal('en')\r\n\t\tintlDateTimeFormatSupportedLocale('en-XX').should.equal('en-XX')\r\n\t\tintlDateTimeFormatSupportedLocale(['en', 'ru']).should.equal('en')\r\n\t})\r\n\r\n\tit(`should choose the most appropriate locale`, () => {\r\n\t\tfunction arrayToObject(array) {\r\n\t\t\treturn array.reduce((object, locale) => {\r\n\t\t\t\tobject[locale] = true\r\n\t\t\t\treturn object\r\n\t\t\t}, {})\r\n\t\t}\r\n\r\n\t\tfunction choose(locale, locales, defaultLocale = 'en') {\r\n\t\t\tif (typeof locale === 'string') {\r\n\t\t\t\tlocale = [locale]\r\n\t\t\t}\r\n\t\t\tlocale = locale.concat(defaultLocale)\r\n\t\t\treturn chooseLocale(locale, _ => locales.includes(_))\r\n\t\t}\r\n\r\n\t\tchoose('ru-RU', ['en', 'ru']).should.equal('ru')\r\n\t\tchoose('en-GB', ['en', 'ru']).should.equal('en')\r\n\t\tchoose('fr-FR', ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de']).should.equal('de')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de', 'fr']).should.equal('fr')\r\n\t\tchoose('fr-FR', ['en', 'fr-FR']).should.equal('fr-FR')\r\n\r\n\t\texpect(() => choose('fr-FR', ['de', 'ru'])).to.throw(\r\n\t\t\t'No locale data has been registered for any of the locales: fr-FR'\r\n\t\t)\r\n\t})\r\n})"],"file":"locale.test.js"}
1
+ {"version":3,"file":"locale.test.js","names":["chooseLocale","intlDateTimeFormatSupportedLocale","describe","it","should","equal","arrayToObject","array","reduce","object","locale","choose","locales","defaultLocale","concat","_","includes","expect","to"],"sources":["../source/locale.test.js"],"sourcesContent":["import chooseLocale, { intlDateTimeFormatSupportedLocale } from './locale.js'\r\n\r\ndescribe('locale', () => {\r\n\tit(`should tell if can use Intl for date formatting`, () => {\r\n\t\tintlDateTimeFormatSupportedLocale('en').should.equal('en')\r\n\t\tintlDateTimeFormatSupportedLocale('en-XX').should.equal('en-XX')\r\n\t\tintlDateTimeFormatSupportedLocale(['en', 'ru']).should.equal('en')\r\n\t})\r\n\r\n\tit(`should choose the most appropriate locale`, () => {\r\n\t\tfunction arrayToObject(array) {\r\n\t\t\treturn array.reduce((object, locale) => {\r\n\t\t\t\tobject[locale] = true\r\n\t\t\t\treturn object\r\n\t\t\t}, {})\r\n\t\t}\r\n\r\n\t\tfunction choose(locale, locales, defaultLocale = 'en') {\r\n\t\t\tif (typeof locale === 'string') {\r\n\t\t\t\tlocale = [locale]\r\n\t\t\t}\r\n\t\t\tlocale = locale.concat(defaultLocale)\r\n\t\t\treturn chooseLocale(locale, _ => locales.includes(_))\r\n\t\t}\r\n\r\n\t\tchoose('ru-RU', ['en', 'ru']).should.equal('ru')\r\n\t\tchoose('en-GB', ['en', 'ru']).should.equal('en')\r\n\t\tchoose('fr-FR', ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de']).should.equal('de')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de', 'fr']).should.equal('fr')\r\n\t\tchoose('fr-FR', ['en', 'fr-FR']).should.equal('fr-FR')\r\n\r\n\t\texpect(() => choose('fr-FR', ['de', 'ru'])).to.throw(\r\n\t\t\t'No locale data has been registered for any of the locales: fr-FR'\r\n\t\t)\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,YAAP,IAAuBC,iCAAvB,QAAgE,aAAhE;AAEAC,QAAQ,CAAC,QAAD,EAAW,YAAM;EACxBC,EAAE,oDAAoD,YAAM;IAC3DF,iCAAiC,CAAC,IAAD,CAAjC,CAAwCG,MAAxC,CAA+CC,KAA/C,CAAqD,IAArD;IACAJ,iCAAiC,CAAC,OAAD,CAAjC,CAA2CG,MAA3C,CAAkDC,KAAlD,CAAwD,OAAxD;IACAJ,iCAAiC,CAAC,CAAC,IAAD,EAAO,IAAP,CAAD,CAAjC,CAAgDG,MAAhD,CAAuDC,KAAvD,CAA6D,IAA7D;EACA,CAJC,CAAF;EAMAF,EAAE,8CAA8C,YAAM;IACrD,SAASG,aAAT,CAAuBC,KAAvB,EAA8B;MAC7B,OAAOA,KAAK,CAACC,MAAN,CAAa,UAACC,MAAD,EAASC,MAAT,EAAoB;QACvCD,MAAM,CAACC,MAAD,CAAN,GAAiB,IAAjB;QACA,OAAOD,MAAP;MACA,CAHM,EAGJ,EAHI,CAAP;IAIA;;IAED,SAASE,MAAT,CAAgBD,MAAhB,EAAwBE,OAAxB,EAAuD;MAAA,IAAtBC,aAAsB,uEAAN,IAAM;;MACtD,IAAI,OAAOH,MAAP,KAAkB,QAAtB,EAAgC;QAC/BA,MAAM,GAAG,CAACA,MAAD,CAAT;MACA;;MACDA,MAAM,GAAGA,MAAM,CAACI,MAAP,CAAcD,aAAd,CAAT;MACA,OAAOb,YAAY,CAACU,MAAD,EAAS,UAAAK,CAAC;QAAA,OAAIH,OAAO,CAACI,QAAR,CAAiBD,CAAjB,CAAJ;MAAA,CAAV,CAAnB;IACA;;IAEDJ,MAAM,CAAC,OAAD,EAAU,CAAC,IA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AAOD,IAAI,CAACD,KAAZ;AAJF;AAMA,C,CAED;;AACA,OAAO,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":"AAAA,OAAO,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;;AACA,OAAO,SAASG,+BAAT,CAAyCH,KAAzC,EAAgD;EACtD,QAAQA,KAAR;IACC,KAAK,OAAL;MACC;MACA;MACA,OAAO,CAAP;;IACD;MACC;MACA;MACA,OAAO,GAAP;EARF;AAUA"}
@@ -1,4 +1,4 @@
1
- import { minute, hour, day, week, month, year } from './units'; // "factor" is a legacy property.
1
+ import { minute, hour, day, week, month, year } from './units.js'; // "factor" is a legacy property.
2
2
  // Developers shouldn't need to use it in their custom steps.
3
3
  // "threshold" is a legacy name of "min".
4
4
  // Developers should use "min" property name instead of "threshold".
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/approximate.js"],"names":["minute","hour","day","week","month","year","factor","unit","threshold","threshold_for_now","granularity","threshold_for_minute"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,GAAvB,EAA4BC,IAA5B,EAAkCC,KAAlC,EAAyCC,IAAzC,QAAqD,SAArD,C,CAEA;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;;AACA,eAAe,CACd;AACC;AACA;AACAC,EAAAA,MAAM,EAAE,CAHT;AAII;AACHC,EAAAA,IAAI,EAAE;AALP,CADc,EAQd;AACC;AACA;AACAC,EAAAA,SAAS,EAAE,CAHZ;AAIC;AACAC,EAAAA,iBAAiB,EAAE,IALpB;AAMC;AACA;AACAH,EAAAA,MAAM,EAAE,CART;AASI;AACHC,EAAAA,IAAI,EAAE;AAVP,CARc,EAoBd;AACC;AACAC,EAAAA,SAAS,EAAE,IAFZ;AAGC;AACA;AACAF,EAAAA,MAAM,EAAEN,MALT;AAMI;AACHO,EAAAA,IAAI,EAAE;AAPP,CApBc,EA6Bd;AACC;AACAC,EAAAA,SAAS,EAAE,MAAMR,MAFlB;AAGC;AACA;AACA;AACA;AACA;AACA;AACAU,EAAAA,WAAW,EAAE,CATd;AAUC;AACA;AACAJ,EAAAA,MAAM,EAAEN,MAZT;AAaC;AACAO,EAAAA,IAAI,EAAE;AAdP,CA7Bc,EA6Cd;AACC;AACAC,EAAAA,SAAS,EAAE,OAAOR,MAFnB;AAGC;AACA;AACAM,EAAAA,MAAM,EAAE,MAAML,IALf;AAMC;AACA;AACAM,EAAAA,IAAI,EAAE;AARP,CA7Cc,EAuDd;AACC;AACAC,EAAAA,SAAS,EAAE,OAAOR,MAFnB;AAGCW,EAAAA,oBAAoB,EAAE,OAAOX,MAH9B;AAIC;AACA;AACAM,EAAAA,MAAM,EAAEL,IANT;AAOC;AACAM,EAAAA,IAAI,EAAE;AARP,CAvDc,EAiEd;AACC;AACAC,EAAAA,SAAS,EAAG,OAAO,EAAR,GAAcN,GAF1B;AAGC;AACA;AACAI,EAAAA,MAAM,EAAEJ,GALT;AAMC;AACAK,EAAAA,IAAI,EAAE;AAPP,CAjEc,EA0Ed;AACC;AACAC,EAAAA,SAAS,EAAE,MAAMN,GAFlB;AAGC;AACA;AACAI,EAAAA,MAAM,EAAEH,IALT;AAMC;AACAI,EAAAA,IAAI,EAAE;AAPP,CA1Ec,EAmFd;AACC;AACAC,EAAAA,SAAS,EAAE,MAAML,IAFlB;AAGC;AACA;AACAG,EAAAA,MAAM,EAAEF,KALT;AAMC;AACAG,EAAAA,IAAI,EAAE;AAPP,CAnFc,EA4Fd;AACC;AACAC,EAAAA,SAAS,EAAE,OAAOJ,KAFnB;AAGC;AACA;AACAE,EAAAA,MAAM,EAAED,IALT;AAMC;AACAE,EAAAA,IAAI,EAAE;AAPP,CA5Fc,CAAf","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":["minute","hour","day","week","month","year","factor","unit","threshold","threshold_for_now","granularity","threshold_for_minute"],"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,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,GAAvB,EAA4BC,IAA5B,EAAkCC,KAAlC,EAAyCC,IAAzC,QAAqD,YAArD,C,CAEA;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;;AACA,eAAe,CACd;EACC;EACA;EACAC,MAAM,EAAE,CAHT;EAII;EAC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5 @@
1
- import getStep from './getStep';
2
- import steps from './approximate';
1
+ import getStep from './getStep.js';
2
+ import steps from './approximate.js';
3
3
  describe('steps/approximate', function () {
4
4
  it('should get step correctly', function () {
5
5
  var getStepFor = function getStepFor(secondsPassed) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/approximate.test.js"],"names":["getStep","steps","describe","it","getStepFor","secondsPassed","now","units","expect","unit","to","equal","factor","granularity","be","undefined"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,WAApB;AACA,OAAOC,KAAP,MAAkB,eAAlB;AAEAC,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AACnCC,EAAAA,EAAE,CAAC,2BAAD,EAA8B,YAAM;AACrC,QAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;AAAA,aAAmBL,OAAO,CAACC,KAAD,EAAQI,aAAR,EAAuB;AACnEC,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,OAAvB,CAA1B;AAAA,KAAnB;;AAcAC,IAAAA,MAAM,CAACJ,UAAU,CAAC,CAAD,CAAV,CAAcK,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;AACAH,IAAAA,MAAM,CAACJ,UAAU,CAAC,CAAD,CAAV,CAAcK,IAAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,KAApC;AACAH,IAAAA,MAAM,CAACJ,UAAU,CAAC,EAAD,CAAV,CAAeK,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,KAArC;AAEAH,IAAAA,MAAM,CAACJ,UAAU,CAAC,EAAD,CAAV,CAAeK,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;AACAH,IAAAA,MAAM,CAACJ,UAAU,CAAC,EAAD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,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":["getStep","steps","describe","it","getStepFor","secondsPassed","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,OAAOA,OAAP,MAAoB,cAApB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AAEAC,QAAQ,CAAC,mBAAD,EAAsB,YAAM;EACnCC,EAAE,CAAC,2BAAD,EAA8B,YAAM;IACrC,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;MAAA,OAAmBL,OAAO,CAACC,KAAD,EAAQI,aAAR,EAAuB;QACnEC,GAAG,EAAE,CAD8D;QAEnEC,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,QAHM,EAIN,MAJM,EAKN,KALM,EAMN,MANM,EAON,OAPM,EAQN,MARM;MAF4D,CAAvB,CAA1B;IAAA,CAAnB;;IAcAC,MAAM,CAACJ,UAAU,CAAC,CAA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AAf,CAAN,CAA2BC,EAA3B,CAA8BC,KAA9B,CAAoC,QAApC;IACAH,MAAM,CAACJ,UAAU,CAAC,EAAD,CAAV,CAAeK,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;IACAH,MAAM,CAACJ,UAAU,CAAC,EAAD,CAAV,CAAeK,IAAhB,CAAN,CAA4BC,EAA5B,CAA+BC,KAA/B,CAAqC,QAArC;EACA,CAlBC,CAAF;AAmBA,CA3DO,CAAR"}
@@ -1,10 +1,12 @@
1
- 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; }
1
+ 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; }
2
+
3
+ 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; }
2
4
 
3
5
  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; }
4
6
 
5
- import getStepDenominator from './getStepDenominator';
6
- import getStepMinTime from './getStepMinTime';
7
- import { getRoundFunction } from '../round';
7
+ import getStepDenominator from './getStepDenominator.js';
8
+ import getStepMinTime from './getStepMinTime.js';
9
+ import { getRoundFunction } from '../round.js';
8
10
  /**
9
11
  * Finds an appropriate `step` of `steps` for the time interval (in seconds).
10
12
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStep.js"],"names":["getStepDenominator","getStepMinTime","getRoundFunction","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,OAAOA,kBAAP,MAA+B,sBAA/B;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,SAASC,gBAAT,QAAiC,UAAjC;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAsBA,eAAe,SAASC,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,WAAe;AACjG;AACAN,EAAAA,KAAK,GAAGO,kBAAkB,CAACP,KAAD,EAAQK,KAAR,CAA1B;;AACA,MAAMG,IAAI,GAAGC,QAAQ,CAACT,KAAD,EAAQC,aAAR,EAAuB;AAAEC,IAAAA,GAAG,EAAHA,GAAF;AAAOC,IAAAA,MAAM,EAANA,MAAP;AAAeC,IAAAA,KAAK,EAALA;AAAf,GAAvB,CAArB;;AACA,MAAIE,WAAJ,EAAiB;AAChB,QAAIE,IAAJ,EAAU;AACT,UAAME,QAAQ,GAAGV,KAAK,CAACA,KAAK,CAACW,OAAN,CAAcH,IAAd,IAAsB,CAAvB,CAAtB;AACA,UAAMI,QAAQ,GAAGZ,KAAK,CAACA,KAAK,CAACW,OAAN,CAAcH,IAAd,IAAsB,CAA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AAT,CAAsBhB,KAAtB,EAA6BC,aAA7B,EAA4CoB,OAA5C,EAA4D;AAAA,MAAPN,CAAO,uEAAH,CAAG;AAC3D,MAAMO,OAAO,GAAGzB,cAAc,CAACG,KAAK,CAACe,CAAD,CAAN;AAC7BL,IAAAA,QAAQ,EAAEV,KAAK,CAACe,CAAC,GAAG,CAAL,CADc;AAE7BQ,IAAAA,SAAS,EAAEF,OAAO,CAACnB,GAAR,GAAcD,aAAa,GAAG;AAFZ,KAG1BoB,OAH0B,EAA9B,CAD2D,CAM3D;;AACA,MAAIC,OAAO,KAAKT,SAAhB,EAA2B;AAC1B,WAAOE,CAAC,GAAG,CAAX;AACA,GAT0D,CAU3D;AACA;;;AACA,MAAII,IAAI,CAACC,GAAL,CAASnB,aAAT,IAA0BqB,OAA9B,EAAuC;AACtC,WAAOP,CAAC,GAAG,CAAX;AACA,GAd0D,CAe3D;;;AACA,MAAIA,CAAC,KAAKf,KAAK,CAACc,MAAN,GAAe,CAAzB,EAA4B;AAC3B,WAAOC,CAAP;AACA,GAlB0D,CAmB3D;;;AACA,SAAOC,YAAY,CAAChB,KAAD,EAAQC,aAAR,EAAuBoB,OAAvB,EAAgCN,CAAC,GAAG,CAApC,CAAnB;AACA;AAED;;;;;;;;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":["getStepDenominator","getStepMinTime","getRoundFunction","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"],"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\n\t\t// (see \"twitter\" style for an example)\r\n\t\treturn true\r\n\t})\r\n}"],"mappings":";;;;;;AAAA,OAAOA,kBAAP,MAA+B,yBAA/B;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,SAASC,gBAAT,QAAiC,aAAjC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,OAAT,CAAiBC,KAAjB,EAAwBC,aAAxB,QAAmF;EAAA,IAA1CC,GAA0C,QAA1CA,GAA0C;EAAA,IAArCC,MAAqC,QAArCA,MAAqC;EAAA,IAA7BC,KAA6B,QAA7BA,KAA6B;EAA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B,EAAgCN,CAAC,GAAG,CAApC,CAAnB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASR,kBAAT,CAA4BP,KAA5B,EAAmCK,KAAnC,EAA0C;EACzC,OAAOL,KAAK,CAACwB,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,OAAOpB,KAAK,CAACM,OAAN,CAAcc,IAAd,KAAuB,CAA9B;IACA,CAP0C,CAQ3C;IACA;IACA;;;IACA,OAAO,IAAP;EACA,CAZM,CAAP;AAaA"}
@@ -1,5 +1,5 @@
1
- import getStep from './getStep';
2
- import round from './round';
1
+ import getStep from './getStep.js';
2
+ import round from './round.js';
3
3
  describe('getStep', function () {
4
4
  it('should return nothing if no time units are supported', function () {
5
5
  expect(getStep(round, 0, {
@@ -38,7 +38,7 @@ describe('getStep', function () {
38
38
  unit: 'second'
39
39
  }, {
40
40
  minTime: {
41
- default: 10
41
+ "default": 10
42
42
  },
43
43
  unit: 'minute'
44
44
  }], 5, {
@@ -49,7 +49,7 @@ describe('getStep', function () {
49
49
  unit: 'second'
50
50
  }, {
51
51
  minTime: {
52
- default: 10
52
+ "default": 10
53
53
  },
54
54
  unit: 'minute'
55
55
  }], 10, {
@@ -62,7 +62,7 @@ describe('getStep', function () {
62
62
  }, {
63
63
  minTime: {
64
64
  seconds: 20,
65
- default: 10
65
+ "default": 10
66
66
  },
67
67
  unit: 'minute'
68
68
  }], 10, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStep.test.js"],"names":["getStep","round","describe","it","expect","units","to","be","undefined","steps","slice","formatAs","should","equal","granularity","now","firstStep","splice","unshift","unit","minTime","default","id","seconds","threshold"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,WAApB;AACA,OAAOC,KAAP,MA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;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":["getStep","round","describe","it","expect","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,OAAOA,OAAP,MAAoB,cAApB;AACA,OAAOC,KAAP,MAAkB,YAAlB;AAEAC,QAAQ,CAAC,SAAD,EAAY,YAAM;EACzBC,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChEC,MAAM,CAACJ,OAAO,CAACC,KAAD,EAAQ,CAAR,EAAW;MAAEI,KAAK,EAAE,CAAC,aAAD;IAAT,CAAX,CAAR,CAAN,CAAsDC,EAAtD,CAAyDC,EAAzD,CAA4DC,SAA5D;EACA,CAFC,CAAF,CADyB,CAKzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAL,EAAE,CAAC,gFAAD,EAAmF,YAAM;IAC1F,IAAMM,KAAK,GAAGR,KAAK,CAACS,KAAN,EAAd;IAEAD,KAAK,CAAC,CAAD,CAAL,CAASE,QAAT,CAAkBC,MAAlB,CAAyBC,KAAzB,CAA+B,QAA/B;IACAJ,KAAK,CAAC,CAAD,CAAL,CAASK,WAAT,GAAuB,CAAvB;IAEAd,OAAO,CAACS,KAAD,EAAQ,IAAR,EAAc;MAAEM,GAAG,EAAE,CAAP;MAAUV,KAAK,EAAE,CAAC,KAAD,EAAQ,QAAR;IAAjB,CAAd,CAAP,CAA2DM,QAA3D,CAAoEC,MAApE,CAA2EC,KAA3E,CAAiF,KAAjF,EAN0F,CAQ1F;;IAEA,IAAMG,SAAS,GAAGP,KAAK,CAAC,CAAD,CAAvB;IACAA,KAAK,CA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1,4 @@
1
- import { getSecondsInUnit } from './units';
1
+ import { getSecondsInUnit } from './units.js';
2
2
  export default function getStepDenominator(step) {
3
3
  // `factor` is a legacy property.
4
4
  if (step.factor !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepDenominator.js"],"names":["getSecondsInUnit","getStepDenominator","step","factor","undefined","unit","formatAs"],"mappings":"AAAA,SAASA,gBAAT,QAAiC,SAAjC;AAEA,eAAe,SAASC,kBAAT,CAA4BC,IAA5B,EAAkC;AAChD;AACA,MAAIA,IAAI,CAACC,MAAL,KAAgBC,SAApB,EAA+B;AAC9B,WAAOF,IAAI,CAACC,MAAZ;AACA,GAJ+C,CAKhD;;;AACA,SAAOH,gBAAgB,CAACE,IAAI,CAACG,IAAL,IAAaH,IAAI,CAACI,QAAnB,CAAhB,IAAgD,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":["getSecondsInUnit","getStepDenominator","step","factor","undefined","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,SAASA,gBAAT,QAAiC,YAAjC;AAEA,eAAe,SAASC,kBAAT,CAA4BC,IAA5B,EAAkC;EAChD;EACA,IAAIA,IAAI,CAACC,MAAL,KAAgBC,SAApB,EAA+B;IAC9B,OAAOF,IAAI,CAACC,MAAZ;EACA,CAJ+C,CAKhD;;;EACA,OAAOH,gBAAgB,CAACE,IAAI,CAACG,IAAL,IAAaH,IAAI,CAACI,QAAnB,CAAhB,IAAgD,CAAvD;AACA"}
@@ -1,4 +1,4 @@
1
- import getStepDenominator from './getStepDenominator';
1
+ import getStepDenominator from './getStepDenominator.js';
2
2
  describe('getStepDenominator', function () {
3
3
  it('should support the older "unit" name', function () {
4
4
  getStepDenominator({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepDenominator.test.js"],"names":["getStepDenominator","describe","it","unit","should","equal","formatAs"],"mappings":"AAAA,OAAOA,kBAAP,MAA+B,sBAA/B;AAEAC,QAAQ,CAAC,oBAAD,EAAuB,YAAM;AACpCC,EAAAA,EAAE,CAAC,sCAAD,EAAyC,YAAM;AAChDF,IAAAA,kBAAkB,CAAC;AAAEG,MAAAA,IAAI,EAAE;AAAR,KAAD,CAAlB,CAAuCC,MAAvC,CAA8CC,KAA9C,CAAoD,EAApD;AACA,GAFC,CAAF;AAIAH,EAAAA,EAAE,CAAC,4CAAD,EAA+C,YAAM;AACtDF,IAAAA,kBAAkB,CAAC;AAAEM,MAAAA,QAAQ,EAAE;AAAZ,KAAD,CAAlB,CAA2CF,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":["getStepDenominator","describe","it","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,OAAOA,kBAAP,MAA+B,yBAA/B;AAEAC,QAAQ,CAAC,oBAAD,EAAuB,YAAM;EACpCC,EAAE,CAAC,sCAAD,EAAyC,YAAM;IAChDF,kBAAkB,CAAC;MAAEG,IAAI,EAAE;IAAR,CAAD,CAAlB,CAAuCC,MAAvC,CAA8CC,KAA9C,CAAoD,EAApD;EACA,CAFC,CAAF;EAIAH,EAAE,CAAC,4CAAD,EAA+C,YAAM;IACtDF,kBAAkB,CAAC;MAAEM,QAAQ,EAAE;IAAZ,CAAD,CAAlB,CAA2CF,MAA3C,CAAkDC,KAAlD,CAAwD,CAAxD;EACA,CAFC,CAAF;AAGA,CARO,CAAR"}
@@ -1,7 +1,7 @@
1
- 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); }
1
+ 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); }
2
2
 
3
- import { getSecondsInUnit } from './units';
4
- import { getDiffRatioToNextRoundedNumber } from '../round';
3
+ import { getSecondsInUnit } from './units.js';
4
+ import { getDiffRatioToNextRoundedNumber } from '../round.js';
5
5
  export default function getStepMinTime(step, _ref) {
6
6
  var prevStep = _ref.prevStep,
7
7
  timestamp = _ref.timestamp,
@@ -38,7 +38,7 @@ export default function getStepMinTime(step, _ref) {
38
38
  if (prevStep && prevStep.id && minTime[prevStep.id] !== undefined) {
39
39
  minTime = minTime[prevStep.id];
40
40
  } else {
41
- minTime = minTime.default;
41
+ minTime = minTime["default"];
42
42
  }
43
43
  }
44
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepMinTime.js"],"names":["getSecondsInUnit","getDiffRatioToNextRoundedNumber","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,SAASA,gBAAT,QAAiC,SAAjC;AACA,SAASC,+BAAT,QAAgD,UAAhD;AAEA,eAAe,SAASC,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,SAAh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,QAA9B,EAAwC;AACvCT,QAAAA,OAAO,GAAGM,kBAAiB,CAACZ,IAAI,CAACe,QAAN,EAAgBd,QAAQ,CAACc,QAAzB,EAAmC;AAAEV,UAAAA,KAAK,EAALA;AAAF,SAAnC,CAA3B;AACA;AACD,KAJD,MAIO;AACN;AACAC,MAAAA,OAAO,GAAG,CAAV;AACA;AACD,GApEC,CAqEF;;;AACA,MAAIA,OAAO,KAAKG,SAAhB,EAA2B;AAC1BQ,IAAAA,OAAO,CAACC,IAAR,CAAa,6DAA6DC,IAAI,CAACC,SAAL,CAAepB,IAAf,EAAqB,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,GAAGxB,gBAAgB,CAACgB,MAAD,CAArC,CADuD,CAEvD;AACA;AACA;AACA;AACA;AACA;;AACA,MAAIS,cAAJ;;AACA,MAAIR,QAAQ,KAAK,KAAjB,EAAwB;AACvBQ,IAAAA,cAAc,GAAGzB,gBAAgB,CAACgB,MAAD,CAAjC;AACA,GAFD,MAEO;AACNS,IAAAA,cAAc,GAAGzB,gBAAgB,CAACiB,QAAD,CAAjC;AACA;;AACD,MAAIO,YAAY,KAAKZ,SAAjB,IAA8Ba,cAAc,KAAKb,SAArD,EAAgE;AAC/D,WAAOY,YAAY,GAAGC,cAAc,IAAI,IAAIxB,+BAA+B,CAACO,KAAD,CAAvC,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":["getSecondsInUnit","getDiffRatioToNextRoundedNumber","getStepMinTime","step","prevStep","timestamp","now","future","round","minTime","id","unit","undefined","threshold","getMinTimeForUnit","toUnit","fromUnit","formatAs","test","console","warn","JSON","stringify","toUnitAmount","fromUnitAmount"],"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,SAASA,gBAAT,QAAiC,YAAjC;AACA,SAASC,+BAAT,QAAgD,aAAhD;AAEA,eAAe,SAASC,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,KAC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,KAAKX,SAAjB,IAA8BY,cAAc,KAAKZ,SAArD,EAAgE;IAC/D,OAAOW,YAAY,GAAGC,cAAc,IAAI,IAAIvB,+BAA+B,CAACO,KAAD,CAAvC,CAApC;EACA;AACD"}
@@ -1,4 +1,4 @@
1
- import getStepMinTime from './getStepMinTime';
1
+ import getStepMinTime from './getStepMinTime.js';
2
2
  describe('getStepMinTime', function () {
3
3
  it('should support `step.test()` function (returns true)', function () {
4
4
  getStepMinTime({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getStepMinTime.test.js"],"names":["getStepMinTime","describe","it","test","prevStep","minTime","should","equal"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,kBAA3B;AAEAC,QAAQ,CAAC,gBAAD,EAAmB,YAAM;AAChCC,EAAAA,EAAE,CAAC,sDAAD,EAAyD,YAAM;AAChEF,IAAAA,cAAc,CAAC;AACdG,MAAAA,IAAI,EAAE;AAAA,eAAM,IAAN;AAAA;AADQ,KAAD,EAEX;AACFC,MAAAA,QAAQ,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AADR,KAFW,CAAd,CAIGC,MAJH,CAIUC,KAJV,CAIgB,CAJhB;AAKA,GANC,CAAF;AAQAL,EAAAA,EAAE,CAAC,uDAAD,EAA0D,YAAM;AACjEF,IAAAA,cAAc,CAAC;AACdG,MAAAA,IAAI,EAAE;AAAA,eAAM,KAAN;AAAA;AADQ,KAAD,EAEX;AACFC,MAAAA,QAAQ,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AADR,KAFW,CAAd,CAIGC,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":["getStepMinTime","describe","it","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,OAAOA,cAAP,MAA2B,qBAA3B;AAEAC,QAAQ,CAAC,gBAAD,EAAmB,YAAM;EAChCC,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChEF,cAAc,CAAC;MACdG,IAAI,EAAE;QAAA,OAAM,IAAN;MAAA;IADQ,CAAD,EAEX;MACFC,QAAQ,EAAE;QAAEC,OAAO,EAAE;MAAX;IADR,CAFW,CAAd,CAIGC,MAJH,CAIUC,KAJV,CAIgB,CAJhB;EAKA,CANC,CAAF;EAQAL,EAAE,CAAC,uDAAD,EAA0D,YAAM;IACjEF,cAAc,CAAC;MACdG,IAAI,EAAE;QAAA,OAAM,KAAN;MAAA;IADQ,CAAD,EAEX;MACFC,QAAQ,EAAE;QAAEC,OAAO,EAAE;MAAX;IADR,CAFW,CAAd,CAIGC,MAJH,CAIUC,KAJV,CAIgB,gBAJhB;EAKA,CANC,CAAF;AAOA,CAhBO,CAAR"}
@@ -1,6 +1,6 @@
1
- import _getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit';
2
- import getStepMinTime from './getStepMinTime';
3
- import { getRoundFunction } from '../round'; // A thousand years is practically a metaphor for "infinity".
1
+ import _getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit.js';
2
+ import getStepMinTime from './getStepMinTime.js';
3
+ import { getRoundFunction } from '../round.js'; // A thousand years is practically a metaphor for "infinity".
4
4
 
5
5
  var YEAR = 365 * 24 * 60 * 60 * 1000;
6
6
  export var INFINITY = 1000 * YEAR;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../source/steps/getTimeToNextUpdate.js"],"names":["_getTimeToNextUpdateForUnit","getStepMinTime","getRoundFunction","YEAR","INFINITY","getTimeToNextUpdate","date","step","prevStep","nextStep","now","future","round","timestamp","getTime","getTimeToNextUpdateForUnit","unit","timeToStepChange","getTimeToStepChange","undefined","timeToNextUpdate","formatAs","Math","min","getStepChangesAt","currentOrNextStep","minTime","stepChangesAt"],"mappings":"AAAA,OAAOA,2BAAP,MAAwC,8BAAxC;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,SAASC,gBAAT,QAAiC,UAAjC,C,CAEA;;AACA,IAAMC,IAAI,GAAG,MAAM,EAAN,GAAW,EAAX,GAAgB,EAAhB,GAAqB,IAAlC;AACA,OAAO,IAAMC,QAAQ,GAAG,OAAOD,IAAxB;AAEP;;;;;;;;;;;;AAWA,eAAe,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,IAAl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GH,gBAAgB,CAACjB,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,QAAImB,aAAa,KAAKR,SAAtB,EAAiC;AAChC;AACA;;AACD,WAAOQ,aAAa,GAAGjB,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":["_getTimeToNextUpdateForUnit","getStepMinTime","getRoundFunction","YEAR","INFINITY","getTimeToNextUpdate","date","step","prevStep","nextStep","now","future","round","timestamp","getTime","getTimeToNextUpdateForUnit","unit","timeToStepChange","getTimeToStepChange","undefined","timeToNextUpdate","formatAs","Math","min","getStepChangesAt","currentOrNextStep","minTime","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,OAAOA,2BAAP,MAAwC,iCAAxC;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,SAASC,gBAAT,QAAiC,aAAjC,C,CAEA;;AACA,IAAMC,IAAI,GAAG,MAAM,EAAN,GAAW,EAAX,GAAgB,EAAhB,GAAqB,IAAlC;AACA,OAAO,IAAMC,QAAQ,GAAG,OAAOD,IAAxB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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T,CAA6BX,IAA7B,EAAmCM,SAAnC,SAKJ;EAAA,IAJFH,GAIE,SAJFA,GAIE;EAAA,IAHFC,MAGE,SAHFA,MAGE;EAAA,IAFFC,KAEE,SAFFA,KAEE;EAAA,IADFJ,QACE,SADFA,QACE;;EACF,IAAID,IAAJ,EAAU;IACT,IAAMoB,aAAa,GAAGH,gBAAgB,CAACjB,IAAD,EAAOM,SAAP,EAAkB;MACvDH,GAAG,EAAHA,GADuD;MAEvDC,MAAM,EAANA,MAFuD;MAGvDC,KAAK,EAALA,KAHuD;MAIvDJ,QAAQ,EAARA;IAJuD,CAAlB,CAAtC;;IAMA,IAAImB,aAAa,KAAKR,SAAtB,EAAiC;MAChC;IACA;;IACD,OAAOQ,aAAa,GAAGjB,GAAvB;EACA,CAXD,MAWO;IACN,IAAIC,MAAJ,EAAY;MACX;MACA;MACA,OAAOE,SAAS,GAAGH,GAAZ,GAAkB,CAAzB;IACA,CAJD,MAIO;MACN;MACA,OAAON,QAAP;IACA;EACD;AACD"}
@@ -1,4 +1,4 @@
1
- import getTimeToNextUpdate, { INFINITY, getStepChangesAt, getTimeToStepChange } from './getTimeToNextUpdate';
1
+ import getTimeToNextUpdate, { INFINITY, getStepChangesAt, getTimeToStepChange } from './getTimeToNextUpdate.js';
2
2
  describe('getTimeToNextUpdate', function () {
3
3
  it('should return infinity when there are no more steps, and it does not format as a unit (past)', function () {
4
4
  expect(getTimeToNextUpdate(-4 * 60 * 1000, {