javascript-time-ago 2.5.11 → 2.5.12

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 (433) hide show
  1. package/bundle/javascript-time-ago.js +1 -1
  2. package/bundle/javascript-time-ago.js.map +1 -1
  3. package/bundle/javascript-time-ago.min.js +1 -1
  4. package/bundle/javascript-time-ago.min.js.map +1 -1
  5. package/commonjs/LocaleDataStore.js +2 -5
  6. package/commonjs/LocaleDataStore.js.map +1 -1
  7. package/commonjs/PropTypes.js +12 -12
  8. package/commonjs/PropTypes.js.map +1 -1
  9. package/commonjs/TimeAgo.js +135 -190
  10. package/commonjs/TimeAgo.js.map +1 -1
  11. package/commonjs/TimeAgo.test.js +124 -130
  12. package/commonjs/TimeAgo.test.js.map +1 -1
  13. package/commonjs/cache.js +7 -25
  14. package/commonjs/cache.js.map +1 -1
  15. package/commonjs/cache.test.js +1 -3
  16. package/commonjs/cache.test.js.map +1 -1
  17. package/commonjs/isStyleObject.js +9 -9
  18. package/commonjs/isStyleObject.js.map +1 -1
  19. package/commonjs/isStyleObject.test.js +1 -3
  20. package/commonjs/isStyleObject.test.js.map +1 -1
  21. package/commonjs/locale.js +6 -19
  22. package/commonjs/locale.js.map +1 -1
  23. package/commonjs/locale.test.js +2 -11
  24. package/commonjs/locale.test.js.map +1 -1
  25. package/commonjs/round.js +2 -5
  26. package/commonjs/round.js.map +1 -1
  27. package/commonjs/steps/approximate.js +1 -4
  28. package/commonjs/steps/approximate.js.map +1 -1
  29. package/commonjs/steps/approximate.test.js +1 -6
  30. package/commonjs/steps/approximate.test.js.map +1 -1
  31. package/commonjs/steps/getStep.js +36 -53
  32. package/commonjs/steps/getStep.js.map +1 -1
  33. package/commonjs/steps/getStep.test.js +7 -7
  34. package/commonjs/steps/getStep.test.js.map +1 -1
  35. package/commonjs/steps/getStepDenominator.js +2 -5
  36. package/commonjs/steps/getStepDenominator.js.map +1 -1
  37. package/commonjs/steps/getStepDenominator.test.js +1 -3
  38. package/commonjs/steps/getStepDenominator.test.js.map +1 -1
  39. package/commonjs/steps/getStepMinTime.js +17 -32
  40. package/commonjs/steps/getStepMinTime.js.map +1 -1
  41. package/commonjs/steps/getStepMinTime.test.js +1 -3
  42. package/commonjs/steps/getStepMinTime.test.js.map +1 -1
  43. package/commonjs/steps/getTimeToNextUpdate.js +19 -41
  44. package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
  45. package/commonjs/steps/getTimeToNextUpdate.test.js +29 -25
  46. package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
  47. package/commonjs/steps/getTimeToNextUpdateForUnit.js +3 -12
  48. package/commonjs/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  49. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +1 -7
  50. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  51. package/commonjs/steps/helpers.js +1 -2
  52. package/commonjs/steps/helpers.js.map +1 -1
  53. package/commonjs/steps/helpers.test.js +0 -1
  54. package/commonjs/steps/helpers.test.js.map +1 -1
  55. package/commonjs/steps/index.js +1 -6
  56. package/commonjs/steps/index.js.map +1 -1
  57. package/commonjs/steps/renameLegacyProperties.js +6 -14
  58. package/commonjs/steps/renameLegacyProperties.js.map +1 -1
  59. package/commonjs/steps/renameLegacyProperties.test.js +1 -3
  60. package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
  61. package/commonjs/steps/round.js +1 -2
  62. package/commonjs/steps/round.js.map +1 -1
  63. package/commonjs/steps/round.test.js +1 -7
  64. package/commonjs/steps/round.test.js.map +1 -1
  65. package/commonjs/steps/units.js +10 -21
  66. package/commonjs/steps/units.js.map +1 -1
  67. package/commonjs/style/approximate.js +2 -6
  68. package/commonjs/style/approximate.js.map +1 -1
  69. package/commonjs/style/approximateTime.js +2 -6
  70. package/commonjs/style/approximateTime.js.map +1 -1
  71. package/commonjs/style/approximateTime.test.js +116 -75
  72. package/commonjs/style/approximateTime.test.js.map +1 -1
  73. package/commonjs/style/getStyleByName.js +3 -29
  74. package/commonjs/style/getStyleByName.js.map +1 -1
  75. package/commonjs/style/mini.js +9 -6
  76. package/commonjs/style/mini.js.map +1 -1
  77. package/commonjs/style/mini.test.js +15 -25
  78. package/commonjs/style/mini.test.js.map +1 -1
  79. package/commonjs/style/miniMinute.js +8 -13
  80. package/commonjs/style/miniMinute.js.map +1 -1
  81. package/commonjs/style/miniMinute.test.js +11 -17
  82. package/commonjs/style/miniMinute.test.js.map +1 -1
  83. package/commonjs/style/miniMinuteNow.js +8 -13
  84. package/commonjs/style/miniMinuteNow.js.map +1 -1
  85. package/commonjs/style/miniMinuteNow.test.js +11 -17
  86. package/commonjs/style/miniMinuteNow.test.js.map +1 -1
  87. package/commonjs/style/miniNow.js +8 -13
  88. package/commonjs/style/miniNow.js.map +1 -1
  89. package/commonjs/style/miniNow.test.js +11 -17
  90. package/commonjs/style/miniNow.test.js.map +1 -1
  91. package/commonjs/style/renameLegacyProperties.js +7 -13
  92. package/commonjs/style/renameLegacyProperties.js.map +1 -1
  93. package/commonjs/style/renameLegacyProperties.test.js +1 -4
  94. package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
  95. package/commonjs/style/round.js +2 -6
  96. package/commonjs/style/round.js.map +1 -1
  97. package/commonjs/style/round.test.js +51 -67
  98. package/commonjs/style/round.test.js.map +1 -1
  99. package/commonjs/style/roundMinute.js +8 -13
  100. package/commonjs/style/roundMinute.js.map +1 -1
  101. package/commonjs/style/roundMinute.test.js +20 -27
  102. package/commonjs/style/roundMinute.test.js.map +1 -1
  103. package/commonjs/style/twitter.js +34 -38
  104. package/commonjs/style/twitter.js.map +1 -1
  105. package/commonjs/style/twitter.test.js +49 -55
  106. package/commonjs/style/twitter.test.js.map +1 -1
  107. package/commonjs/style/twitterFirstMinute.js +10 -15
  108. package/commonjs/style/twitterFirstMinute.js.map +1 -1
  109. package/commonjs/style/twitterFirstMinute.test.js +16 -23
  110. package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
  111. package/commonjs/style/twitterMinute.js +8 -13
  112. package/commonjs/style/twitterMinute.js.map +1 -1
  113. package/commonjs/style/twitterMinute.test.js +20 -25
  114. package/commonjs/style/twitterMinute.test.js.map +1 -1
  115. package/commonjs/style/twitterMinuteNow.js +8 -13
  116. package/commonjs/style/twitterMinuteNow.js.map +1 -1
  117. package/commonjs/style/twitterMinuteNow.test.js +20 -25
  118. package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
  119. package/commonjs/style/twitterNow.js +8 -13
  120. package/commonjs/style/twitterNow.js.map +1 -1
  121. package/commonjs/style/twitterNow.test.js +18 -24
  122. package/commonjs/style/twitterNow.test.js.map +1 -1
  123. package/load-all-locales/index.cjs +32 -0
  124. package/load-all-locales/index.cjs.js +32 -0
  125. package/load-all-locales/index.js +64 -0
  126. package/locale/ak/package.json +16 -0
  127. package/locale/ak.json +267 -0
  128. package/locale/ak.json.d.ts +4 -0
  129. package/locale/ak.json.js +267 -0
  130. package/locale/bal-Latn/package.json +16 -0
  131. package/locale/bal-Latn.json +240 -0
  132. package/locale/bal-Latn.json.d.ts +4 -0
  133. package/locale/bal-Latn.json.js +240 -0
  134. package/locale/be-tarask/package.json +16 -0
  135. package/locale/be-tarask.json +259 -0
  136. package/locale/be-tarask.json.d.ts +4 -0
  137. package/locale/be-tarask.json.js +259 -0
  138. package/locale/blo/package.json +16 -0
  139. package/locale/blo.json +159 -0
  140. package/locale/blo.json.d.ts +4 -0
  141. package/locale/blo.json.js +159 -0
  142. package/locale/bn.json +5 -2
  143. package/locale/bn.json.js +5 -2
  144. package/locale/bs.json +8 -2
  145. package/locale/bs.json.js +8 -2
  146. package/locale/ccp.json +2 -8
  147. package/locale/ccp.json.js +2 -8
  148. package/locale/csw/package.json +16 -0
  149. package/locale/csw.json +180 -0
  150. package/locale/csw.json.d.ts +4 -0
  151. package/locale/csw.json.js +180 -0
  152. package/locale/cy.json +6 -12
  153. package/locale/cy.json.js +6 -12
  154. package/locale/doi/package.json +16 -0
  155. package/locale/doi.json +159 -0
  156. package/locale/doi.json.d.ts +4 -0
  157. package/locale/doi.json.js +159 -0
  158. package/locale/en-AU.json +12 -12
  159. package/locale/en-AU.json.js +12 -12
  160. package/locale/en-CZ/package.json +16 -0
  161. package/locale/en-CZ.json +219 -0
  162. package/locale/en-CZ.json.d.ts +4 -0
  163. package/locale/en-CZ.json.js +219 -0
  164. package/locale/en-ES/package.json +16 -0
  165. package/locale/en-ES.json +219 -0
  166. package/locale/en-ES.json.d.ts +4 -0
  167. package/locale/en-ES.json.js +219 -0
  168. package/locale/en-FR/package.json +16 -0
  169. package/locale/en-FR.json +219 -0
  170. package/locale/en-FR.json.d.ts +4 -0
  171. package/locale/en-FR.json.js +219 -0
  172. package/locale/en-GS/package.json +16 -0
  173. package/locale/en-GS.json +219 -0
  174. package/locale/en-GS.json.d.ts +4 -0
  175. package/locale/en-GS.json.js +219 -0
  176. package/locale/en-HU/package.json +16 -0
  177. package/locale/en-HU.json +219 -0
  178. package/locale/en-HU.json.d.ts +4 -0
  179. package/locale/en-HU.json.js +219 -0
  180. package/locale/en-ID/package.json +16 -0
  181. package/locale/en-ID.json +219 -0
  182. package/locale/en-ID.json.d.ts +4 -0
  183. package/locale/en-ID.json.js +219 -0
  184. package/locale/en-IT/package.json +16 -0
  185. package/locale/en-IT.json +219 -0
  186. package/locale/en-IT.json.d.ts +4 -0
  187. package/locale/en-IT.json.js +219 -0
  188. package/locale/en-NO/package.json +16 -0
  189. package/locale/en-NO.json +219 -0
  190. package/locale/en-NO.json.d.ts +4 -0
  191. package/locale/en-NO.json.js +219 -0
  192. package/locale/en-PL/package.json +16 -0
  193. package/locale/en-PL.json +219 -0
  194. package/locale/en-PL.json.d.ts +4 -0
  195. package/locale/en-PL.json.js +219 -0
  196. package/locale/en-PT/package.json +16 -0
  197. package/locale/en-PT.json +219 -0
  198. package/locale/en-PT.json.d.ts +4 -0
  199. package/locale/en-PT.json.js +219 -0
  200. package/locale/en-RO/package.json +16 -0
  201. package/locale/en-RO.json +219 -0
  202. package/locale/en-RO.json.d.ts +4 -0
  203. package/locale/en-RO.json.js +219 -0
  204. package/locale/en-SK/package.json +16 -0
  205. package/locale/en-SK.json +219 -0
  206. package/locale/en-SK.json.d.ts +4 -0
  207. package/locale/en-SK.json.js +219 -0
  208. package/locale/es-MX.json +12 -9
  209. package/locale/es-MX.json.js +12 -9
  210. package/locale/es-SV.json +2 -2
  211. package/locale/es-SV.json.js +2 -2
  212. package/locale/eu.json +24 -24
  213. package/locale/eu.json.js +24 -24
  214. package/locale/ha.json +119 -65
  215. package/locale/ha.json.js +119 -65
  216. package/locale/he.json +0 -6
  217. package/locale/he.json.js +0 -6
  218. package/locale/hi-Latn.json +2 -2
  219. package/locale/hi-Latn.json.js +2 -2
  220. package/locale/ht/package.json +16 -0
  221. package/locale/ht.json +207 -0
  222. package/locale/ht.json.d.ts +4 -0
  223. package/locale/ht.json.js +207 -0
  224. package/locale/id.json +1 -1
  225. package/locale/id.json.js +1 -1
  226. package/locale/ie/package.json +16 -0
  227. package/locale/ie.json +159 -0
  228. package/locale/ie.json.d.ts +4 -0
  229. package/locale/ie.json.js +159 -0
  230. package/locale/ig.json +17 -17
  231. package/locale/ig.json.js +17 -17
  232. package/locale/ii/package.json +16 -0
  233. package/locale/ii.json +165 -0
  234. package/locale/ii.json.d.ts +4 -0
  235. package/locale/ii.json.js +165 -0
  236. package/locale/is.json +4 -1
  237. package/locale/is.json.js +4 -1
  238. package/locale/kaa/package.json +16 -0
  239. package/locale/kaa.json +159 -0
  240. package/locale/kaa.json.d.ts +4 -0
  241. package/locale/kaa.json.js +159 -0
  242. package/locale/kok-Latn/package.json +16 -0
  243. package/locale/kok-Latn.json +159 -0
  244. package/locale/kok-Latn.json.d.ts +4 -0
  245. package/locale/kok-Latn.json.js +159 -0
  246. package/locale/kok.json +8 -8
  247. package/locale/kok.json.js +8 -8
  248. package/locale/ks.json +9 -9
  249. package/locale/ks.json.js +9 -9
  250. package/locale/ku.json +55 -46
  251. package/locale/ku.json.js +55 -46
  252. package/locale/lld/package.json +16 -0
  253. package/locale/lld.json +291 -0
  254. package/locale/lld.json.d.ts +4 -0
  255. package/locale/lld.json.js +291 -0
  256. package/locale/mi.json +22 -22
  257. package/locale/mi.json.js +22 -22
  258. package/locale/ms-Arab/package.json +16 -0
  259. package/locale/ms-Arab.json +159 -0
  260. package/locale/ms-Arab.json.d.ts +4 -0
  261. package/locale/ms-Arab.json.js +159 -0
  262. package/locale/nb.json +2 -2
  263. package/locale/nb.json.js +2 -2
  264. package/locale/ne.json +1 -1
  265. package/locale/ne.json.js +1 -1
  266. package/locale/nn.json +4 -4
  267. package/locale/nn.json.js +4 -4
  268. package/locale/no.json +2 -2
  269. package/locale/no.json.js +2 -2
  270. package/locale/nqo/package.json +16 -0
  271. package/locale/nqo.json +159 -0
  272. package/locale/nqo.json.d.ts +4 -0
  273. package/locale/nqo.json.js +159 -0
  274. package/locale/om/package.json +16 -0
  275. package/locale/om.json +213 -0
  276. package/locale/om.json.d.ts +4 -0
  277. package/locale/om.json.js +213 -0
  278. package/locale/or.json +1 -1
  279. package/locale/or.json.js +1 -1
  280. package/locale/qu.json +46 -46
  281. package/locale/qu.json.js +46 -46
  282. package/locale/rhg/package.json +16 -0
  283. package/locale/rhg.json +159 -0
  284. package/locale/rhg.json.d.ts +4 -0
  285. package/locale/rhg.json.js +159 -0
  286. package/locale/sl.json +12 -12
  287. package/locale/sl.json.js +12 -12
  288. package/locale/sr-Cyrl-BA.json +2 -2
  289. package/locale/sr-Cyrl-BA.json.js +2 -2
  290. package/locale/sr-Latn-BA.json +2 -2
  291. package/locale/sr-Latn-BA.json.js +2 -2
  292. package/locale/sv.json +1 -1
  293. package/locale/sv.json.js +1 -1
  294. package/locale/syr/package.json +16 -0
  295. package/locale/syr.json +303 -0
  296. package/locale/syr.json.d.ts +4 -0
  297. package/locale/syr.json.js +303 -0
  298. package/locale/ti.json +6 -6
  299. package/locale/ti.json.js +6 -6
  300. package/locale/tn/package.json +16 -0
  301. package/locale/tn.json +159 -0
  302. package/locale/tn.json.d.ts +4 -0
  303. package/locale/tn.json.js +159 -0
  304. package/locale/to.json +26 -26
  305. package/locale/to.json.js +26 -26
  306. package/locale/uk.json +1 -1
  307. package/locale/uk.json.js +1 -1
  308. package/locale/ur-IN.json +9 -6
  309. package/locale/ur-IN.json.js +9 -6
  310. package/locale/vec/package.json +16 -0
  311. package/locale/vec.json +267 -0
  312. package/locale/vec.json.d.ts +4 -0
  313. package/locale/vec.json.js +267 -0
  314. package/locale/xnr/package.json +16 -0
  315. package/locale/xnr.json +159 -0
  316. package/locale/xnr.json.d.ts +4 -0
  317. package/locale/xnr.json.js +159 -0
  318. package/locale/yo-BJ.json +17 -17
  319. package/locale/yo-BJ.json.js +17 -17
  320. package/locale/yo.json +17 -17
  321. package/locale/yo.json.js +17 -17
  322. package/modules/LocaleDataStore.js +2 -3
  323. package/modules/LocaleDataStore.js.map +1 -1
  324. package/modules/PropTypes.js +11 -7
  325. package/modules/PropTypes.js.map +1 -1
  326. package/modules/TimeAgo.js +135 -174
  327. package/modules/TimeAgo.js.map +1 -1
  328. package/modules/TimeAgo.test.js +126 -115
  329. package/modules/TimeAgo.test.js.map +1 -1
  330. package/modules/cache.js +6 -22
  331. package/modules/cache.js.map +1 -1
  332. package/modules/cache.test.js.map +1 -1
  333. package/modules/isStyleObject.js +9 -7
  334. package/modules/isStyleObject.js.map +1 -1
  335. package/modules/isStyleObject.test.js.map +1 -1
  336. package/modules/locale.js +6 -16
  337. package/modules/locale.js.map +1 -1
  338. package/modules/locale.test.js +0 -4
  339. package/modules/locale.test.js.map +1 -1
  340. package/modules/round.js +2 -3
  341. package/modules/round.js.map +1 -1
  342. package/modules/steps/approximate.js +6 -2
  343. package/modules/steps/approximate.js.map +1 -1
  344. package/modules/steps/approximate.test.js +0 -2
  345. package/modules/steps/approximate.test.js.map +1 -1
  346. package/modules/steps/getStep.js +36 -48
  347. package/modules/steps/getStep.js.map +1 -1
  348. package/modules/steps/getStep.test.js +6 -2
  349. package/modules/steps/getStep.test.js.map +1 -1
  350. package/modules/steps/getStepDenominator.js +2 -3
  351. package/modules/steps/getStepDenominator.js.map +1 -1
  352. package/modules/steps/getStepDenominator.test.js.map +1 -1
  353. package/modules/steps/getStepMinTime.js +17 -29
  354. package/modules/steps/getStepMinTime.js.map +1 -1
  355. package/modules/steps/getStepMinTime.test.js.map +1 -1
  356. package/modules/steps/getTimeToNextUpdate.js +19 -31
  357. package/modules/steps/getTimeToNextUpdate.js.map +1 -1
  358. package/modules/steps/getTimeToNextUpdate.test.js +27 -18
  359. package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
  360. package/modules/steps/getTimeToNextUpdateForUnit.js +4 -10
  361. package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  362. package/modules/steps/getTimeToNextUpdateForUnit.test.js +0 -4
  363. package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  364. package/modules/steps/helpers.js +1 -1
  365. package/modules/steps/helpers.js.map +1 -1
  366. package/modules/steps/helpers.test.js.map +1 -1
  367. package/modules/steps/index.js +2 -1
  368. package/modules/steps/index.js.map +1 -1
  369. package/modules/steps/renameLegacyProperties.js +6 -13
  370. package/modules/steps/renameLegacyProperties.js.map +1 -1
  371. package/modules/steps/renameLegacyProperties.test.js.map +1 -1
  372. package/modules/steps/round.js.map +1 -1
  373. package/modules/steps/round.test.js +0 -3
  374. package/modules/steps/round.test.js.map +1 -1
  375. package/modules/steps/units.js +5 -9
  376. package/modules/steps/units.js.map +1 -1
  377. package/modules/style/approximate.js +5 -1
  378. package/modules/style/approximate.js.map +1 -1
  379. package/modules/style/approximateTime.js +6 -2
  380. package/modules/style/approximateTime.js.map +1 -1
  381. package/modules/style/approximateTime.test.js +115 -70
  382. package/modules/style/approximateTime.test.js.map +1 -1
  383. package/modules/style/getStyleByName.js +4 -17
  384. package/modules/style/getStyleByName.js.map +1 -1
  385. package/modules/style/mini.js +8 -4
  386. package/modules/style/mini.js.map +1 -1
  387. package/modules/style/mini.test.js +14 -20
  388. package/modules/style/mini.test.js.map +1 -1
  389. package/modules/style/miniMinute.js +6 -6
  390. package/modules/style/miniMinute.js.map +1 -1
  391. package/modules/style/miniMinute.test.js +10 -12
  392. package/modules/style/miniMinute.test.js.map +1 -1
  393. package/modules/style/miniMinuteNow.js +6 -6
  394. package/modules/style/miniMinuteNow.js.map +1 -1
  395. package/modules/style/miniMinuteNow.test.js +10 -12
  396. package/modules/style/miniMinuteNow.test.js.map +1 -1
  397. package/modules/style/miniNow.js +6 -6
  398. package/modules/style/miniNow.js.map +1 -1
  399. package/modules/style/miniNow.test.js +10 -12
  400. package/modules/style/miniNow.test.js.map +1 -1
  401. package/modules/style/renameLegacyProperties.js +8 -10
  402. package/modules/style/renameLegacyProperties.js.map +1 -1
  403. package/modules/style/renameLegacyProperties.test.js +0 -1
  404. package/modules/style/renameLegacyProperties.test.js.map +1 -1
  405. package/modules/style/round.js +3 -2
  406. package/modules/style/round.js.map +1 -1
  407. package/modules/style/round.test.js +50 -62
  408. package/modules/style/round.test.js.map +1 -1
  409. package/modules/style/roundMinute.js +8 -7
  410. package/modules/style/roundMinute.js.map +1 -1
  411. package/modules/style/roundMinute.test.js +19 -22
  412. package/modules/style/roundMinute.test.js.map +1 -1
  413. package/modules/style/twitter.js +35 -32
  414. package/modules/style/twitter.js.map +1 -1
  415. package/modules/style/twitter.test.js +48 -50
  416. package/modules/style/twitter.test.js.map +1 -1
  417. package/modules/style/twitterFirstMinute.js +8 -7
  418. package/modules/style/twitterFirstMinute.js.map +1 -1
  419. package/modules/style/twitterFirstMinute.test.js +15 -18
  420. package/modules/style/twitterFirstMinute.test.js.map +1 -1
  421. package/modules/style/twitterMinute.js +6 -6
  422. package/modules/style/twitterMinute.js.map +1 -1
  423. package/modules/style/twitterMinute.test.js +19 -20
  424. package/modules/style/twitterMinute.test.js.map +1 -1
  425. package/modules/style/twitterMinuteNow.js +6 -6
  426. package/modules/style/twitterMinuteNow.js.map +1 -1
  427. package/modules/style/twitterMinuteNow.test.js +19 -20
  428. package/modules/style/twitterMinuteNow.test.js.map +1 -1
  429. package/modules/style/twitterNow.js +6 -6
  430. package/modules/style/twitterNow.js.map +1 -1
  431. package/modules/style/twitterNow.test.js +17 -19
  432. package/modules/style/twitterNow.test.js.map +1 -1
  433. package/package.json +261 -4
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = getTimeToNextUpdateForUnit;
7
-
8
7
  var _units = require("./units.js");
9
-
10
8
  var _round = require("../round.js");
11
-
12
9
  /**
13
10
  * Gets the time to next update for a step with a time unit defined.
14
11
  * @param {string} unit
@@ -19,20 +16,17 @@ var _round = require("../round.js");
19
16
  */
20
17
  function getTimeToNextUpdateForUnit(unit, timestamp, _ref) {
21
18
  var now = _ref.now,
22
- round = _ref.round;
23
-
19
+ round = _ref.round;
24
20
  // For some units, like "now", there's no defined amount of seconds in them.
25
21
  if (!(0, _units.getSecondsInUnit)(unit)) {
26
22
  // If there's no amount of seconds defined for this unit
27
23
  // then the update interval can't be determined reliably.
28
24
  return;
29
25
  }
30
-
31
26
  var unitDenominator = (0, _units.getSecondsInUnit)(unit) * 1000;
32
27
  var future = timestamp > now;
33
28
  var preciseAmount = Math.abs(timestamp - now);
34
29
  var roundedAmount = (0, _round.getRoundFunction)(round)(preciseAmount / unitDenominator) * unitDenominator;
35
-
36
30
  if (future) {
37
31
  if (roundedAmount > 0) {
38
32
  // Amount decreases with time.
@@ -42,16 +36,13 @@ function getTimeToNextUpdateForUnit(unit, timestamp, _ref) {
42
36
  // when "future" changes to "past".
43
37
  return preciseAmount - roundedAmount + 1;
44
38
  }
45
- } // Amount increases with time.
46
-
47
-
39
+ }
40
+ // Amount increases with time.
48
41
  return -(preciseAmount - roundedAmount) + getDiffToNextRoundedNumber(round, unitDenominator);
49
42
  }
50
-
51
43
  function getDiffToNextRoundedNumber(round, unitDenominator) {
52
44
  return (0, _round.getDiffRatioToNextRoundedNumber)(round) * unitDenominator;
53
45
  }
54
-
55
46
  function getDiffToPreviousRoundedNumber(round, unitDenominator) {
56
47
  return (1 - (0, _round.getDiffRatioToNextRoundedNumber)(round)) * unitDenominator + 1;
57
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getTimeToNextUpdateForUnit.js","names":["getTimeToNextUpdateForUnit","unit","timestamp","now","round","getSecondsInUnit","unitDenominator","future","preciseAmount","Math","abs","roundedAmount","getRoundFunction","getDiffToPreviousRoundedNumber","getDiffToNextRoundedNumber","getDiffRatioToNextRoundedNumber"],"sources":["../../source/steps/getTimeToNextUpdateForUnit.js"],"sourcesContent":["import { getSecondsInUnit } from './units.js'\r\nimport { getRoundFunction, getDiffRatioToNextRoundedNumber } from '../round.js'\r\n\r\n/**\r\n * Gets the time to next update for a step with a time unit defined.\r\n * @param {string} unit\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {number} options.now\r\n * @param {string} [options.round] — (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdateForUnit(unit, timestamp, { now, round }) {\r\n\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\tif (!getSecondsInUnit(unit)) {\r\n\t\t// If there's no amount of seconds defined for this unit\r\n\t\t// then the update interval can't be determined reliably.\r\n\t\treturn\r\n\t}\r\n\tconst unitDenominator = getSecondsInUnit(unit) * 1000\r\n\tconst future = timestamp > now\r\n\tconst preciseAmount = Math.abs(timestamp - now)\r\n\tconst roundedAmount = getRoundFunction(round)(preciseAmount / unitDenominator) * unitDenominator\r\n\tif (future) {\r\n\t\tif (roundedAmount > 0) {\r\n\t\t\t// Amount decreases with time.\r\n\t\t\treturn (preciseAmount - roundedAmount) +\r\n\t\t\t\tgetDiffToPreviousRoundedNumber(round, unitDenominator)\r\n\t\t} else {\r\n\t\t\t// Refresh right after the zero point,\r\n\t\t\t// when \"future\" changes to \"past\".\r\n\t\t\treturn (preciseAmount - roundedAmount) + 1\r\n\t\t}\r\n\t}\r\n \t// Amount increases with time.\r\n\treturn -(preciseAmount - roundedAmount) + getDiffToNextRoundedNumber(round, unitDenominator)\r\n}\r\n\r\nfunction getDiffToNextRoundedNumber(round, unitDenominator) {\r\n\treturn getDiffRatioToNextRoundedNumber(round) * unitDenominator\r\n}\r\n\r\nfunction getDiffToPreviousRoundedNumber(round, unitDenominator) {\r\n\treturn (1 - getDiffRatioToNextRoundedNumber(round)) * unitDenominator + 1\r\n}"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,0BAAT,CAAoCC,IAApC,EAA0CC,SAA1C,QAAqE;EAAA,IAAdC,GAAc,QAAdA,GAAc;EAAA,IAATC,KAAS,QAATA,KAAS;;EACnF;EACA,IAAI,CAAC,IAAAC,uBAAA,EAAiBJ,IAAjB,CAAL,EAA6B;IAC5B;IACA;IACA;EACA;;EACD,IAAMK,eAAe,GAAG,IAAAD,uBAAA,EAAiBJ,IAAjB,IAAyB,IAAjD;EACA,IAAMM,MAAM,GAAGL,SAAS,GAAGC,GAA3B;EACA,IAAMK,aAAa,GAAGC,IAAI,CAACC,GAAL,CAASR,SAAS,GAAGC,GAArB,CAAtB;EACA,IAAMQ,aAAa,GAAG,IAAAC,uBAAA,EAAiBR,KAAjB,EAAwBI,aAAa,GAAGF,eAAxC,IAA2DA,eAAjF;;EACA,IAAIC,MAAJ,EAAY;IACX,IAAII,aAAa,GAAG,CAApB,EAAuB;MACtB;MACA,OAAQH,aAAa,GAAGG,aAAjB,GACNE,8BAA8B,CAACT,KAAD,EAAQE,eAAR,CAD/B;IAEA,CAJD,MAIO;MACN;MACA;MACA,OAAQE,aAAa,GAAGG,aAAjB,GAAkC,CAAzC;IACA;EACD,CArBkF,CAsBlF;;;EACD,OAAO,EAAEH,aAAa,GAAGG,aAAlB,IAAmCG,0BAA0B,CAACV,KAAD,EAAQE,eAAR,CAApE;AACA;;AAED,SAASQ,0BAAT,CAAoCV,KAApC,EAA2CE,eAA3C,EAA4D;EAC3D,OAAO,IAAAS,sCAAA,EAAgCX,KAAhC,IAAyCE,eAAhD;AACA;;AAED,SAASO,8BAAT,CAAwCT,KAAxC,EAA+CE,eAA/C,EAAgE;EAC/D,OAAO,CAAC,IAAI,IAAAS,sCAAA,EAAgCX,KAAhC,CAAL,IAA+CE,eAA/C,GAAiE,CAAxE;AACA"}
1
+ {"version":3,"file":"getTimeToNextUpdateForUnit.js","names":["_units","require","_round","getTimeToNextUpdateForUnit","unit","timestamp","_ref","now","round","getSecondsInUnit","unitDenominator","future","preciseAmount","Math","abs","roundedAmount","getRoundFunction","getDiffToPreviousRoundedNumber","getDiffToNextRoundedNumber","getDiffRatioToNextRoundedNumber"],"sources":["../../source/steps/getTimeToNextUpdateForUnit.js"],"sourcesContent":["import { getSecondsInUnit } from './units.js'\r\nimport { getRoundFunction, getDiffRatioToNextRoundedNumber } from '../round.js'\r\n\r\n/**\r\n * Gets the time to next update for a step with a time unit defined.\r\n * @param {string} unit\r\n * @param {number} date — The date passed to `.format()`, converted to a timestamp.\r\n * @param {number} options.now\r\n * @param {string} [options.round] — (undocumented) Rounding mechanism.\r\n * @return {number} [timeToNextUpdate]\r\n */\r\nexport default function getTimeToNextUpdateForUnit(unit, timestamp, { now, round }) {\r\n\t// For some units, like \"now\", there's no defined amount of seconds in them.\r\n\tif (!getSecondsInUnit(unit)) {\r\n\t\t// If there's no amount of seconds defined for this unit\r\n\t\t// then the update interval can't be determined reliably.\r\n\t\treturn\r\n\t}\r\n\tconst unitDenominator = getSecondsInUnit(unit) * 1000\r\n\tconst future = timestamp > now\r\n\tconst preciseAmount = Math.abs(timestamp - now)\r\n\tconst roundedAmount = getRoundFunction(round)(preciseAmount / unitDenominator) * unitDenominator\r\n\tif (future) {\r\n\t\tif (roundedAmount > 0) {\r\n\t\t\t// Amount decreases with time.\r\n\t\t\treturn (preciseAmount - roundedAmount) +\r\n\t\t\t\tgetDiffToPreviousRoundedNumber(round, unitDenominator)\r\n\t\t} else {\r\n\t\t\t// Refresh right after the zero point,\r\n\t\t\t// when \"future\" changes to \"past\".\r\n\t\t\treturn (preciseAmount - roundedAmount) + 1\r\n\t\t}\r\n\t}\r\n \t// Amount increases with time.\r\n\treturn -(preciseAmount - roundedAmount) + getDiffToNextRoundedNumber(round, unitDenominator)\r\n}\r\n\r\nfunction getDiffToNextRoundedNumber(round, unitDenominator) {\r\n\treturn getDiffRatioToNextRoundedNumber(round) * unitDenominator\r\n}\r\n\r\nfunction getDiffToPreviousRoundedNumber(round, unitDenominator) {\r\n\treturn (1 - getDiffRatioToNextRoundedNumber(round)) * unitDenominator + 1\r\n}"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,0BAA0BA,CAACC,IAAI,EAAEC,SAAS,EAAAC,IAAA,EAAkB;EAAA,IAAdC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;EAC/E;EACA,IAAI,CAAC,IAAAC,uBAAgB,EAACL,IAAI,CAAC,EAAE;IAC5B;IACA;IACA;EACD;EACA,IAAMM,eAAe,GAAG,IAAAD,uBAAgB,EAACL,IAAI,CAAC,GAAG,IAAI;EACrD,IAAMO,MAAM,GAAGN,SAAS,GAAGE,GAAG;EAC9B,IAAMK,aAAa,GAAGC,IAAI,CAACC,GAAG,CAACT,SAAS,GAAGE,GAAG,CAAC;EAC/C,IAAMQ,aAAa,GAAG,IAAAC,uBAAgB,EAACR,KAAK,CAAC,CAACI,aAAa,GAAGF,eAAe,CAAC,GAAGA,eAAe;EAChG,IAAIC,MAAM,EAAE;IACX,IAAII,aAAa,GAAG,CAAC,EAAE;MACtB;MACA,OAAQH,aAAa,GAAGG,aAAa,GACpCE,8BAA8B,CAACT,KAAK,EAAEE,eAAe,CAAC;IACxD,CAAC,MAAM;MACN;MACA;MACA,OAAQE,aAAa,GAAGG,aAAa,GAAI,CAAC;IAC3C;EACD;EACC;EACD,OAAO,EAAEH,aAAa,GAAGG,aAAa,CAAC,GAAGG,0BAA0B,CAACV,KAAK,EAAEE,eAAe,CAAC;AAC7F;AAEA,SAASQ,0BAA0BA,CAACV,KAAK,EAAEE,eAAe,EAAE;EAC3D,OAAO,IAAAS,sCAA+B,EAACX,KAAK,CAAC,GAAGE,eAAe;AAChE;AAEA,SAASO,8BAA8BA,CAACT,KAAK,EAAEE,eAAe,EAAE;EAC/D,OAAO,CAAC,CAAC,GAAG,IAAAS,sCAA+B,EAACX,KAAK,CAAC,IAAIE,eAAe,GAAG,CAAC;AAC1E","ignoreList":[]}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _getTimeToNextUpdateForUnit = _interopRequireDefault(require("./getTimeToNextUpdateForUnit.js"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6
-
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
7
5
  describe('getTimeToNextUpdateForUnit', function () {
8
6
  it('should return undefined for unknown units', function () {
9
7
  expect((0, _getTimeToNextUpdateForUnit["default"])('now', 0, {})).to.be.undefined;
@@ -22,7 +20,6 @@ describe('getTimeToNextUpdateForUnit', function () {
22
20
  now: 0
23
21
  }).should.equal(expected * 1000 + (addOneMs ? 1 : 0));
24
22
  };
25
-
26
23
  test(9, 0.5);
27
24
  test(9.1, 0.6);
28
25
  test(9.4, 0.9);
@@ -44,7 +41,6 @@ describe('getTimeToNextUpdateForUnit', function () {
44
41
  now: 0
45
42
  }).should.equal(expected * 1000);
46
43
  };
47
-
48
44
  test(10, 0.5);
49
45
  test(9.9, 0.6);
50
46
  test(9.5, 1);
@@ -66,7 +62,6 @@ describe('getTimeToNextUpdateForUnit', function () {
66
62
  round: 'floor'
67
63
  }).should.equal(expected * 1000 + (addOneMs ? 1 : 0));
68
64
  };
69
-
70
65
  test(9, 0);
71
66
  test(9.1, 0.1);
72
67
  test(9.4, 0.4);
@@ -88,7 +83,6 @@ describe('getTimeToNextUpdateForUnit', function () {
88
83
  round: 'floor'
89
84
  }).should.equal(expected * 1000);
90
85
  };
91
-
92
86
  test(10, 1);
93
87
  test(9.9, 0.1);
94
88
  test(9.5, 0.5);
@@ -1 +1 @@
1
- {"version":3,"file":"getTimeToNextUpdateForUnit.test.js","names":["describe","it","expect","getTimeToNextUpdateForUnit","to","be","undefined","Date","now","should","equal","test","seconds","expected","addOneMs","round"],"sources":["../../source/steps/getTimeToNextUpdateForUnit.test.js"],"sourcesContent":["import getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit.js'\r\n\r\ndescribe('getTimeToNextUpdateForUnit', () => {\r\n\tit('should return undefined for unknown units', () => {\r\n\t\texpect(getTimeToNextUpdateForUnit('now', 0, {})).to.be.undefined\r\n\t})\r\n\r\n\tit('should support Date argument', () => {\r\n\t\tgetTimeToNextUpdateForUnit('second', new Date(0), {\r\n\t\t\t// future: false,\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(500)\r\n\t})\r\n\r\n\tit('should get time to next update for unit (future)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', seconds * 1000, {\r\n\t\t\t\t// future: true,\r\n\t\t\t\tnow: 0\r\n\t\t\t}).should.equal(expected * 1000 + (addOneMs ? 1 : 0))\r\n\t\t}\r\n\r\n\t\ttest(9, 0.5)\r\n\t\ttest(9.1, 0.6)\r\n\t\ttest(9.4, 0.9)\r\n\t\ttest(9.5, 0)\r\n\t\ttest(9.9, 0.4)\r\n\t\ttest(10, 0.5)\r\n\r\n\t\ttest(1.1, 0.6)\r\n\t\ttest(1, 0.5)\r\n\t\ttest(0.9, 0.4)\r\n\t\ttest(0.5, 0)\r\n\t\ttest(0.4, 0.4)\r\n\t\ttest(0, 0.5, false)\r\n\t})\r\n\r\n\tit('should get time to next update for unit (past)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', -1 * seconds * 1000, {\r\n\t\t\t\t// future: false,\r\n\t\t\t\tnow: 0\r\n\t\t\t}).should.equal(expected * 1000)\r\n\t\t}\r\n\r\n\t\ttest(10, 0.5)\r\n\t\ttest(9.9, 0.6)\r\n\t\ttest(9.5, 1)\r\n\t\ttest(9.4, 0.1)\r\n\t\ttest(9.1, 0.4)\r\n\t\ttest(9, 0.5)\r\n\r\n\t\ttest(0, 0.5, false)\r\n\t\ttest(0.5, 1, false)\r\n\t\ttest(0.9, 0.6, false)\r\n\t\ttest(1, 0.5, false)\r\n\t\ttest(1.1, 0.4, false)\r\n\t})\r\n\r\n\tit('should support \"floor\" rounding (future)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', seconds * 1000, {\r\n\t\t\t\t// future: true,\r\n\t\t\t\tnow: 0,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}).should.equal(expected * 1000 + (addOneMs ? 1 : 0))\r\n\t\t}\r\n\r\n\t\ttest(9, 0)\r\n\t\ttest(9.1, 0.1)\r\n\t\ttest(9.4, 0.4)\r\n\t\ttest(9.5, 0.5)\r\n\t\ttest(9.9, 0.9)\r\n\t\ttest(10, 0)\r\n\r\n\t\ttest(1.1, 0.1)\r\n\t\ttest(1, 0)\r\n\t\ttest(0.9, 0.9)\r\n\t\ttest(0.5, 0.5)\r\n\t\ttest(0.1, 0.1)\r\n\t\ttest(0, 1, false)\r\n\t})\r\n\r\n\tit('should support \"floor\" rounding (past)', () => {\r\n\t\tconst test = (seconds, expected) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', -1 * seconds * 1000, {\r\n\t\t\t\t// future: false,\r\n\t\t\t\tnow: 0,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}).should.equal(expected * 1000)\r\n\t\t}\r\n\r\n\t\ttest(10, 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QACAJ,GAAG,EAAE,CAFoD;QAGzDO,KAAK,EAAE;MAHkD,CAA1D,EAIGN,MAJH,CAIUC,KAJV,CAIgBG,QAAQ,GAAG,IAJ3B;IAKA,CAND;;IAQAF,IAAI,CAAC,EAAD,EAAK,CAAL,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,CAAD,EAAI,CAAJ,CAAJ;IAEAA,IAAI,CAAC,CAAD,EAAI,CAAJ,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;IACAA,IAAI,CAAC,CAAD,EAAI,CAAJ,CAAJ;IACAA,IAAI,CAAC,GAAD,EAAM,GAAN,CAAJ;EACA,CArBC,CAAF;AAsBA,CAvGO,CAAR"}
1
+ {"version":3,"file":"getTimeToNextUpdateForUnit.test.js","names":["_getTimeToNextUpdateForUnit","_interopRequireDefault","require","e","__esModule","describe","it","expect","getTimeToNextUpdateForUnit","to","be","undefined","Date","now","should","equal","test","seconds","expected","addOneMs","arguments","length","round"],"sources":["../../source/steps/getTimeToNextUpdateForUnit.test.js"],"sourcesContent":["import getTimeToNextUpdateForUnit from './getTimeToNextUpdateForUnit.js'\r\n\r\ndescribe('getTimeToNextUpdateForUnit', () => {\r\n\tit('should return undefined for unknown units', () => {\r\n\t\texpect(getTimeToNextUpdateForUnit('now', 0, {})).to.be.undefined\r\n\t})\r\n\r\n\tit('should support Date argument', () => {\r\n\t\tgetTimeToNextUpdateForUnit('second', new Date(0), {\r\n\t\t\t// future: false,\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(500)\r\n\t})\r\n\r\n\tit('should get time to next update for unit (future)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', seconds * 1000, {\r\n\t\t\t\t// future: true,\r\n\t\t\t\tnow: 0\r\n\t\t\t}).should.equal(expected * 1000 + (addOneMs ? 1 : 0))\r\n\t\t}\r\n\r\n\t\ttest(9, 0.5)\r\n\t\ttest(9.1, 0.6)\r\n\t\ttest(9.4, 0.9)\r\n\t\ttest(9.5, 0)\r\n\t\ttest(9.9, 0.4)\r\n\t\ttest(10, 0.5)\r\n\r\n\t\ttest(1.1, 0.6)\r\n\t\ttest(1, 0.5)\r\n\t\ttest(0.9, 0.4)\r\n\t\ttest(0.5, 0)\r\n\t\ttest(0.4, 0.4)\r\n\t\ttest(0, 0.5, false)\r\n\t})\r\n\r\n\tit('should get time to next update for unit (past)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', -1 * seconds * 1000, {\r\n\t\t\t\t// future: false,\r\n\t\t\t\tnow: 0\r\n\t\t\t}).should.equal(expected * 1000)\r\n\t\t}\r\n\r\n\t\ttest(10, 0.5)\r\n\t\ttest(9.9, 0.6)\r\n\t\ttest(9.5, 1)\r\n\t\ttest(9.4, 0.1)\r\n\t\ttest(9.1, 0.4)\r\n\t\ttest(9, 0.5)\r\n\r\n\t\ttest(0, 0.5, false)\r\n\t\ttest(0.5, 1, false)\r\n\t\ttest(0.9, 0.6, false)\r\n\t\ttest(1, 0.5, false)\r\n\t\ttest(1.1, 0.4, false)\r\n\t})\r\n\r\n\tit('should support \"floor\" rounding (future)', () => {\r\n\t\tconst test = (seconds, expected, addOneMs = true) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', seconds * 1000, {\r\n\t\t\t\t// future: true,\r\n\t\t\t\tnow: 0,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}).should.equal(expected * 1000 + (addOneMs ? 1 : 0))\r\n\t\t}\r\n\r\n\t\ttest(9, 0)\r\n\t\ttest(9.1, 0.1)\r\n\t\ttest(9.4, 0.4)\r\n\t\ttest(9.5, 0.5)\r\n\t\ttest(9.9, 0.9)\r\n\t\ttest(10, 0)\r\n\r\n\t\ttest(1.1, 0.1)\r\n\t\ttest(1, 0)\r\n\t\ttest(0.9, 0.9)\r\n\t\ttest(0.5, 0.5)\r\n\t\ttest(0.1, 0.1)\r\n\t\ttest(0, 1, false)\r\n\t})\r\n\r\n\tit('should support \"floor\" rounding (past)', () => {\r\n\t\tconst test = (seconds, expected) => {\r\n\t\t\tgetTimeToNextUpdateForUnit('second', -1 * seconds * 1000, {\r\n\t\t\t\t// future: false,\r\n\t\t\t\tnow: 0,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}).should.equal(expected * 1000)\r\n\t\t}\r\n\r\n\t\ttest(10, 1)\r\n\t\ttest(9.9, 0.1)\r\n\t\ttest(9.5, 0.5)\r\n\t\ttest(9.4, 0.6)\r\n\t\ttest(9.1, 0.9)\r\n\t\ttest(9, 1)\r\n\r\n\t\ttest(0, 1)\r\n\t\ttest(0.5, 0.5)\r\n\t\ttest(0.9, 0.1)\r\n\t\ttest(1, 1)\r\n\t\ttest(1.1, 0.9)\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,2BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAExEE,QAAQ,CAAC,4BAA4B,EAAE,YAAM;EAC5CC,EAAE,CAAC,2CAA2C,EAAE,YAAM;IACrDC,MAAM,CAAC,IAAAC,sCAA0B,EAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAACC,EAAE,CAACC,EAAE,CAACC,SAAS;EACjE,CAAC,CAAC;EAEFL,EAAE,CAAC,8BAA8B,EAAE,YAAM;IACxC,IAAAE,sCAA0B,EAAC,QAAQ,EAAE,IAAII,IAAI,CAAC,CAAC,CAAC,EAAE;MACjD;MACAC,GAAG,E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C,GAAG,EAAE,GAAG,CAAC;IACdA,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;IACVA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;EACf,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getDate = getDate;
7
-
8
7
  // Looks like this one's deprecated.
9
8
  // /**
10
9
  // * Returns a step corresponding to the unit.
@@ -19,8 +18,8 @@ exports.getDate = getDate;
19
18
  // }
20
19
  // }
21
20
  // }
22
- // Looks like this one won't be used in the next major version.
23
21
 
22
+ // Looks like this one won't be used in the next major version.
24
23
  /**
25
24
  * Converts value to a `Date`
26
25
  * @param {(number|Date)} value
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["getDate","value","Date"],"sources":["../../source/steps/helpers.js"],"sourcesContent":["// Looks like this one's deprecated.\r\n// /**\r\n// * Returns a step corresponding to the unit.\r\n// * @param {Object[]} steps\r\n// * @param {string} unit\r\n// * @return {?Object}\r\n// */\r\n// export function getStepForUnit(steps, unit) {\r\n// \tfor (const step of steps) {\r\n// \t\tif (step.unit === unit) {\r\n// \t\t\treturn step\r\n// \t\t}\r\n// \t}\r\n// }\r\n\r\n// Looks like this one won't be used in the next major version.\r\n/**\r\n * Converts value to a `Date`\r\n * @param {(number|Date)} value\r\n * @return {Date}\r\n */\r\nexport function getDate(value) {\r\n\treturn value instanceof Date ? value : new Date(value)\r\n}"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAT,CAAiBC,KAAjB,EAAwB;EAC9B,OAAOA,KAAK,YAAYC,IAAjB,GAAwBD,KAAxB,GAAgC,IAAIC,IAAJ,CAASD,KAAT,CAAvC;AACA"}
1
+ {"version":3,"file":"helpers.js","names":["getDate","value","Date"],"sources":["../../source/steps/helpers.js"],"sourcesContent":["// Looks like this one's deprecated.\r\n// /**\r\n// * Returns a step corresponding to the unit.\r\n// * @param {Object[]} steps\r\n// * @param {string} unit\r\n// * @return {?Object}\r\n// */\r\n// export function getStepForUnit(steps, unit) {\r\n// \tfor (const step of steps) {\r\n// \t\tif (step.unit === unit) {\r\n// \t\t\treturn step\r\n// \t\t}\r\n// \t}\r\n// }\r\n\r\n// Looks like this one won't be used in the next major version.\r\n/**\r\n * Converts value to a `Date`\r\n * @param {(number|Date)} value\r\n * @return {Date}\r\n */\r\nexport function getDate(value) {\r\n\treturn value instanceof Date ? value : new Date(value)\r\n}"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAACC,KAAK,EAAE;EAC9B,OAAOA,KAAK,YAAYC,IAAI,GAAGD,KAAK,GAAG,IAAIC,IAAI,CAACD,KAAK,CAAC;AACvD","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _helpers = require("./helpers.js");
4
-
5
4
  describe('steps/helpers', function () {
6
5
  it('should convert value to Date', function () {
7
6
  var today = new Date();
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.test.js","names":["describe","it","today","Date","getDate","getTime","should","equal"],"sources":["../../source/steps/helpers.test.js"],"sourcesContent":["import { getDate } from './helpers.js'\r\n\r\ndescribe('steps/helpers', () => {\r\n\tit('should convert value to Date', () => {\r\n\t\tconst today = new Date()\r\n\t\tgetDate(today.getTime()).getTime().should.equal(today.getTime())\r\n\t\tgetDate(today).getTime().should.equal(today.getTime())\r\n\t})\r\n})"],"mappings":";;AAAA;;AAEAA,QAAQ,CAAC,eAAD,EAAkB,YAAM;EAC/BC,EAAE,CAAC,8BAAD,EAAiC,YAAM;IACxC,IAAMC,KAAK,GAAG,IAAIC,IAAJ,EAAd;IACA,IAAAC,gBAAA,EAAQF,KAAK,CAACG,OAAN,EAAR,EAAyBA,OAAzB,GAAmCC,MAAnC,CAA0CC,KAA1C,CAAgDL,KAAK,CAACG,OAAN,EAAhD;IACA,IAAAD,gBAAA,EAAQF,KAAR,EAAeG,OAAf,GAAyBC,MAAzB,CAAgCC,KAAhC,CAAsCL,KAAK,CAACG,OAAN,EAAtC;EACA,CAJC,CAAF;AAKA,CANO,CAAR"}
1
+ {"version":3,"file":"helpers.test.js","names":["_helpers","require","describe","it","today","Date","getDate","getTime","should","equal"],"sources":["../../source/steps/helpers.test.js"],"sourcesContent":["import { getDate } from './helpers.js'\r\n\r\ndescribe('steps/helpers', () => {\r\n\tit('should convert value to Date', () => {\r\n\t\tconst today = new Date()\r\n\t\tgetDate(today.getTime()).getTime().should.equal(today.getTime())\r\n\t\tgetDate(today).getTime().should.equal(today.getTime())\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,eAAe,EAAE,YAAM;EAC/BC,EAAE,CAAC,8BAA8B,EAAE,YAAM;IACxC,IAAMC,KAAK,GAAG,IAAIC,IAAI,CAAC,CAAC;IACxB,IAAAC,gBAAO,EAACF,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC,CAACA,OAAO,CAAC,CAAC,CAACC,MAAM,CAACC,KAAK,CAACL,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;IAChE,IAAAD,gBAAO,EAACF,KAAK,CAAC,CAACG,OAAO,CAAC,CAAC,CAACC,MAAM,CAACC,KAAK,CAACL,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;EACvD,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -69,14 +69,9 @@ Object.defineProperty(exports, "year", {
69
69
  return _units.year;
70
70
  }
71
71
  });
72
-
73
72
  var _approximate = _interopRequireDefault(require("./approximate.js"));
74
-
75
73
  var _round = _interopRequireDefault(require("./round.js"));
76
-
77
74
  var _units = require("./units.js");
78
-
79
75
  var _helpers = require("./helpers.js");
80
-
81
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
76
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
82
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../source/steps/index.js"],"sourcesContent":["// \"convenient\" is a legacy name of \"approximate\" steps.\r\nexport { default as approximate, default as convenient } from './approximate.js'\r\n\r\n// \"canonical\" is a legacy name of \"round\" steps.\r\nexport { default as round, default as canonical } from './round.js'\r\n\r\nexport {\r\n\tminute,\r\n\thour,\r\n\tday,\r\n\tweek,\r\n\tmonth,\r\n\tyear\r\n} from './units.js'\r\n\r\nexport {\r\n\tgetDate\r\n} from './helpers.js'"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAGA;;AAEA;;AASA"}
1
+ {"version":3,"file":"index.js","names":["_approximate","_interopRequireDefault","require","_round","_units","_helpers","e","__esModule"],"sources":["../../source/steps/index.js"],"sourcesContent":["// \"convenient\" is a legacy name of \"approximate\" steps.\r\nexport { default as approximate, default as convenient } from './approximate.js'\r\n\r\n// \"canonical\" is a legacy name of \"round\" steps.\r\nexport { default as round, default as canonical } from './round.js'\r\n\r\nexport {\r\n\tminute,\r\n\thour,\r\n\tday,\r\n\tweek,\r\n\tmonth,\r\n\tyear\r\n} from './units.js'\r\n\r\nexport {\r\n\tgetDate\r\n} from './helpers.js'"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AASA,IAAAG,QAAA,GAAAH,OAAA;AAEqB,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA","ignoreList":[]}
@@ -4,25 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = _default;
7
-
8
- 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); }
9
-
10
- 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; }
11
-
12
- 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; }
13
-
14
- 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; }
15
-
7
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
13
  // This function is only used for backwards compatibility
17
14
  // with legacy code that uses the older versions of this library.
18
15
  function _default(step_) {
19
16
  var step = _objectSpread({}, step_);
20
-
21
17
  if (step.minTime !== undefined) {
22
18
  if (_typeof(step.minTime) === 'object') {
23
19
  for (var _i = 0, _Object$keys = Object.keys(step.minTime); _i < _Object$keys.length; _i++) {
24
20
  var key = _Object$keys[_i];
25
-
26
21
  if (key === 'default') {
27
22
  step.threshold = step.minTime["default"];
28
23
  } else {
@@ -32,15 +27,12 @@ function _default(step_) {
32
27
  } else {
33
28
  step.threshold = step.minTime;
34
29
  }
35
-
36
30
  delete step.minTime;
37
31
  }
38
-
39
32
  if (step.formatAs) {
40
33
  step.unit = step.formatAs;
41
34
  delete step.formatAs;
42
35
  }
43
-
44
36
  return step;
45
37
  }
46
38
  //# sourceMappingURL=renameLegacyProperties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renameLegacyProperties.js","names":["step_","step","minTime","undefined","Object","keys","key","threshold","formatAs","unit"],"sources":["../../source/steps/renameLegacyProperties.js"],"sourcesContent":["// This function is only used for backwards compatibility\r\n// with legacy code that uses the older versions of this library.\r\nexport default function(step_) {\r\n\tconst step = { ...step_ }\r\n\tif (step.minTime !== undefined) {\r\n\t\tif (typeof step.minTime === 'object') {\r\n\t\t\tfor (const key of Object.keys(step.minTime)) {\r\n\t\t\t\tif (key === 'default') {\r\n\t\t\t\t\tstep.threshold = step.minTime.default\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstep[`threshold_for_${key}`] = step.minTime[key]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tstep.threshold = step.minTime\r\n\t\t}\r\n\t\tdelete step.minTime\r\n\t}\r\n\tif (step.formatAs) {\r\n\t\tstep.unit = step.formatAs\r\n\t\tdelete step.formatAs\r\n\t}\r\n\treturn step\r\n}"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACe,kBAASA,KAAT,EAAgB;EAC9B,IAAMC,IAAI,qBAAQD,KAAR,CAAV;;EACA,IAAIC,IAAI,CAACC,OAAL,KAAiBC,SAArB,EAAgC;IAC/B,IAAI,QAAOF,IAAI,CAACC,OAAZ,MAAwB,QAA5B,EAAsC;MACrC,gCAAkBE,MAAM,CAACC,IAAP,CAAYJ,IAAI,CAACC,OAAjB,CAAlB,kCAA6C;QAAxC,IAAMI,GAAG,mBAAT;;QACJ,IAAIA,GAAG,KAAK,SAAZ,EAAuB;UACtBL,IAAI,CAACM,SAAL,GAAiBN,IAAI,CAACC,OAAL,WAAjB;QACA,CAFD,MAEO;UACND,IAAI,yBAAkBK,GAAlB,EAAJ,GAA+BL,IAAI,CAACC,OAAL,CAAaI,GAAb,CAA/B;QACA;MACD;IACD,CARD,MAQO;MACNL,IAAI,CAACM,SAAL,GAAiBN,IAAI,CAACC,OAAtB;IACA;;IACD,OAAOD,IAAI,CAACC,OAAZ;EACA;;EACD,IAAID,IAAI,CAACO,QAAT,EAAmB;IAClBP,IAAI,CAACQ,IAAL,GAAYR,IAAI,CAACO,QAAjB;IACA,OAAOP,IAAI,CAACO,QAAZ;EACA;;EACD,OAAOP,IAAP;AACA"}
1
+ {"version":3,"file":"renameLegacyProperties.js","names":["_default","step_","step","_objectSpread","minTime","undefined","_typeof","_i","_Object$keys","Object","keys","length","key","threshold","concat","formatAs","unit"],"sources":["../../source/steps/renameLegacyProperties.js"],"sourcesContent":["// This function is only used for backwards compatibility\r\n// with legacy code that uses the older versions of this library.\r\nexport default function(step_) {\r\n\tconst step = { ...step_ }\r\n\tif (step.minTime !== undefined) {\r\n\t\tif (typeof step.minTime === 'object') {\r\n\t\t\tfor (const key of Object.keys(step.minTime)) {\r\n\t\t\t\tif (key === 'default') {\r\n\t\t\t\t\tstep.threshold = step.minTime.default\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstep[`threshold_for_${key}`] = step.minTime[key]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tstep.threshold = step.minTime\r\n\t\t}\r\n\t\tdelete step.minTime\r\n\t}\r\n\tif (step.formatAs) {\r\n\t\tstep.unit = step.formatAs\r\n\t\tdelete step.formatAs\r\n\t}\r\n\treturn step\r\n}"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACe,SAAAA,SAASC,KAAK,EAAE;EAC9B,IAAMC,IAAI,GAAAC,aAAA,KAAQF,KAAK,CAAE;EACzB,IAAIC,IAAI,CAACE,OAAO,KAAKC,SAAS,EAAE;IAC/B,IAAIC,OAAA,CAAOJ,IAAI,CAACE,OAAO,MAAK,QAAQ,EAAE;MACrC,SAAAG,EAAA,MAAAC,YAAA,GAAkBC,MAAM,CAACC,IAAI,CAACR,IAAI,CAACE,OAAO,CAAC,EAAAG,EAAA,GAAAC,YAAA,CAAAG,MAAA,EAAAJ,EAAA,IAAE;QAAxC,IAAMK,GAAG,GAAAJ,YAAA,CAAAD,EAAA;QACb,IAAIK,GAAG,KAAK,SAAS,EAAE;UACtBV,IAAI,CAACW,SAAS,GAAGX,IAAI,CAACE,OAAO,WAAQ;QACtC,CAAC,MAAM;UACNF,IAAI,kBAAAY,MAAA,CAAkBF,GAAG,EAAG,GAAGV,IAAI,CAACE,OAAO,CAACQ,GAAG,CAAC;QACjD;MACD;IACD,CAAC,MAAM;MACNV,IAAI,CAACW,SAAS,GAAGX,IAAI,CAACE,OAAO;IAC9B;IACA,OAAOF,IAAI,CAACE,OAAO;EACpB;EACA,IAAIF,IAAI,CAACa,QAAQ,EAAE;IAClBb,IAAI,CAACc,IAAI,GAAGd,IAAI,CAACa,QAAQ;IACzB,OAAOb,IAAI,CAACa,QAAQ;EACrB;EACA,OAAOb,IAAI;AACZ","ignoreList":[]}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _renameLegacyProperties = _interopRequireDefault(require("./renameLegacyProperties.js"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6
-
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
7
5
  describe('steps/renameLegacyProperties', function () {
8
6
  it('should rename legacy properties', function () {
9
7
  (0, _renameLegacyProperties["default"])({
@@ -1 +1 @@
1
- {"version":3,"file":"renameLegacyProperties.test.js","names":["describe","it","renameLegacyProperties","formatAs","minTime","should","deep","equal","unit","threshold","week","threshold_for_week"],"sources":["../../source/steps/renameLegacyProperties.test.js"],"sourcesContent":["import renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\ndescribe('steps/renameLegacyProperties', () => {\r\n\tit('should rename legacy properties', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now',\r\n\t\t\tminTime: 1\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now',\r\n\t\t\tthreshold: 1\r\n\t\t})\r\n\t})\r\n\r\n\tit('should rename legacy properties (minTime: undefined)', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now'\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should rename legacy properties (`minTime` is an object)', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now',\r\n\t\t\tminTime: {\r\n\t\t\t\tweek: 2,\r\n\t\t\t\tdefault: 1\r\n\t\t\t}\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now',\r\n\t\t\tthreshold: 1,\r\n\t\t\tthreshold_for_week: 2\r\n\t\t})\r\n\t})\r\n})"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,8BAAD,EAAiC,YAAM;EAC9CC,EAAE,CAAC,iCAAD,EAAoC,YAAM;IAC3C,IAAAC,kCAAA,EAAuB;MACtBC,QAAQ,EAAE,KADY;MAEtBC,OAAO,EAAE;IAFa,CAAvB,EAGGC,MAHH,CAGUC,IAHV,CAGeC,KAHf,CAGqB;MACpBC,IAAI,EAAE,KADc;MAEpBC,SAAS,EAAE;IAFS,CAHrB;EAOA,CARC,CAAF;EAUAR,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChE,IAAAC,kCAAA,EAAuB;MACtBC,QAAQ,EAAE;IADY,CAAvB,EAEGE,MAFH,CAEUC,IAFV,CAEeC,KAFf,CAEqB;MACpBC,IAAI,EAAE;IADc,CAFrB;EAKA,CANC,CAAF;EAQAP,EAAE,CAAC,0DAAD,EAA6D,YAAM;IACpE,IAAAC,kCAAA,EAAuB;MACtBC,QAAQ,EAAE,KADY;MAEtBC,OAAO,EAAE;QACRM,IAAI,EAAE,CADE;QAER,WAAS;MAFD;IAFa,CAAvB,EAMGL,MANH,CAMUC,IANV,CAMeC,KANf,CAMqB;MACpBC,IAAI,EAAE,KADc;MAEpBC,SAAS,EAAE,CAFS;MAGpBE,kBAAkB,EAAE;IAHA,CANrB;EAWA,CAZC,CAAF;AAaA,CAhCO,CAAR"}
1
+ {"version":3,"file":"renameLegacyProperties.test.js","names":["_renameLegacyProperties","_interopRequireDefault","require","e","__esModule","describe","it","renameLegacyProperties","formatAs","minTime","should","deep","equal","unit","threshold","week","threshold_for_week"],"sources":["../../source/steps/renameLegacyProperties.test.js"],"sourcesContent":["import renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\ndescribe('steps/renameLegacyProperties', () => {\r\n\tit('should rename legacy properties', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now',\r\n\t\t\tminTime: 1\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now',\r\n\t\t\tthreshold: 1\r\n\t\t})\r\n\t})\r\n\r\n\tit('should rename legacy properties (minTime: undefined)', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now'\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should rename legacy properties (`minTime` is an object)', () => {\r\n\t\trenameLegacyProperties({\r\n\t\t\tformatAs: 'now',\r\n\t\t\tminTime: {\r\n\t\t\t\tweek: 2,\r\n\t\t\t\tdefault: 1\r\n\t\t\t}\r\n\t\t}).should.deep.equal({\r\n\t\t\tunit: 'now',\r\n\t\t\tthreshold: 1,\r\n\t\t\tthreshold_for_week: 2\r\n\t\t})\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAEhEE,QAAQ,CAAC,8BAA8B,EAAE,YAAM;EAC9CC,EAAE,CAAC,iCAAiC,EAAE,YAAM;IAC3C,IAAAC,kCAAsB,EAAC;MACtBC,QAAQ,EAAE,KAAK;MACfC,OAAO,EAAE;IACV,CAAC,CAAC,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC;MACpBC,IAAI,EAAE,KAAK;MACXC,SAAS,EAAE;IACZ,CAAC,CAAC;EACH,CAAC,CAAC;EAEFR,EAAE,CAAC,sDAAsD,EAAE,YAAM;IAChE,IAAAC,kCAAsB,EAAC;MACtBC,QAAQ,EAAE;IACX,CAAC,CAAC,CAACE,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC;MACpBC,IAAI,EAAE;IACP,CAAC,CAAC;EACH,CAAC,CAAC;EAEFP,EAAE,CAAC,0DAA0D,EAAE,YAAM;IACpE,IAAAC,kCAAsB,EAAC;MACtBC,QAAQ,EAAE,KAAK;MACfC,OAAO,EAAE;QACRM,IAAI,EAAE,CAAC;QACP,WAAS;MACV;IACD,CAAC,CAAC,CAACL,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC;MACpBC,IAAI,EAAE,KAAK;MACXC,SAAS,EAAE,CAAC;MACZE,kBAAkB,EAAE;IACrB,CAAC,CAAC;EACH,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -32,7 +32,7 @@ exports["default"] = void 0;
32
32
  // 1 year ago
33
33
  // 2 years ago
34
34
  // …
35
- var _default = [{
35
+ var _default = exports["default"] = [{
36
36
  formatAs: 'now'
37
37
  }, {
38
38
  formatAs: 'second'
@@ -49,5 +49,4 @@ var _default = [{
49
49
  }, {
50
50
  formatAs: 'year'
51
51
  }];
52
- exports["default"] = _default;
53
52
  //# sourceMappingURL=round.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"round.js","names":["formatAs"],"sources":["../../source/steps/round.js"],"sourcesContent":["// just now\r\n// 1 second ago\r\n// 2 seconds ago\r\n// …\r\n// 59 seconds ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 6 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// …\r\n// 3 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\tformatAs: 'now'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'day'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'week'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'month'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'year'\r\n\t}\r\n]"],"mappings":";;;;;;AAAA;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;AACA;AACA;eACe,CACd;EACCA,QAAQ,EAAE;AADX,CADc,EAId;EACCA,QAAQ,EAAE;AADX,CAJc,EAOd;EACCA,QAAQ,EAAE;AADX,CAPc,EAUd;EACCA,QAAQ,EAAE;AADX,CAVc,EAad;EACCA,QAAQ,EAAE;AADX,CAbc,EAgBd;EACCA,QAAQ,EAAE;AADX,CAhBc,EAmBd;EACCA,QAAQ,EAAE;AADX,CAnBc,EAsBd;EACCA,QAAQ,EAAE;AADX,CAtBc,C"}
1
+ {"version":3,"file":"round.js","names":["_default","exports","formatAs"],"sources":["../../source/steps/round.js"],"sourcesContent":["// just now\r\n// 1 second ago\r\n// 2 seconds ago\r\n// …\r\n// 59 seconds ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 6 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// …\r\n// 3 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\nexport default [\r\n\t{\r\n\t\tformatAs: 'now'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'day'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'week'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'month'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'year'\r\n\t}\r\n]"],"mappings":";;;;;;AAAA;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;AACA;AACA;AAAA,IAAAA,QAAA,GAAAC,OAAA,cACe,CACd;EACCC,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,CACD","ignoreList":[]}
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _getStep = _interopRequireDefault(require("./getStep.js"));
4
-
5
4
  var _round = _interopRequireDefault(require("./round.js"));
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
-
5
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
6
  describe('steps/round', function () {
10
7
  it('should get step correctly (round: "floor")', function () {
11
8
  var getStepFor = function getStepFor(secondsPassed) {
@@ -14,7 +11,6 @@ describe('steps/round', function () {
14
11
  units: ['now', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year']
15
12
  });
16
13
  };
17
-
18
14
  expect(getStepFor(0).formatAs).to.equal('now');
19
15
  expect(getStepFor(0.9).formatAs).to.equal('now');
20
16
  expect(getStepFor(1).formatAs).to.equal('second');
@@ -32,7 +28,6 @@ describe('steps/round', function () {
32
28
  units: ['now', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year']
33
29
  });
34
30
  };
35
-
36
31
  expect(getStepFor(0).formatAs).to.equal('now');
37
32
  expect(getStepFor(0.49).formatAs).to.equal('now');
38
33
  expect(getStepFor(0.5).formatAs).to.equal('second');
@@ -51,7 +46,6 @@ describe('steps/round', function () {
51
46
  units: ['now', 'second', 'minute', 'hour', 'day', 'month', 'year']
52
47
  });
53
48
  };
54
-
55
49
  expect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('day');
56
50
  });
57
51
  });
@@ -1 +1 @@
1
- {"version":3,"file":"round.test.js","names":["describe","it","getStepFor","secondsPassed","getStep","steps","round","units","expect","formatAs","to","equal"],"sources":["../../source/steps/round.test.js"],"sourcesContent":["import getStep from './getStep.js'\r\nimport steps from './round.js'\r\n\r\ndescribe('steps/round', () => {\r\n\tit('should get step correctly (round: \"floor\")', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tround: 'floor',\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).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.9).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(1).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(59.9).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60 - 1).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(24 * 60 * 60).formatAs).to.equal('day')\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('week')\r\n\t})\r\n\r\n\tit('should get step correctly (round: \"round\")', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tround: 'round',\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).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.49).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.5).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(1).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(59.4).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(59.4 * 60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(23.49 * 60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(23.5 * 60 * 60).formatAs).to.equal('day')\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('week')\r\n\t})\r\n\r\n\tit('should use \"day\"s when \"week\"s are not allowed', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\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'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('day')\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,aAAD,EAAgB,YAAM;EAC7BC,EAAE,CAAC,4CAAD,EAA+C,YAAM;IACtD,IAAMC,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,EAAN,CAAV,CAAoBO,QAArB,CAAN,CAAqCC,EAArC,CAAwCC,KAAxC,CAA8C,MAA9C;IACAH,MAAM,CAACN,UAAU,CAAC,QAAQ,EAAR,GAAa,EAAd,CAAV,CAA4BO,QAA7B,CAAN,CAA6CC,EAA7C,CAAgDC,KAAhD,CAAsD,MAAtD;IACAH,MAAM,CAACN,UAAU,CAAC,OAAO,EAAP,GAAY,EAAb,CAAV,CAA2BO,QAA5B,CAAN,CAA4CC,EAA5C,CAA+CC,KAA/C,CAAqD,KAArD;IACAH,MAAM,CAACN,UAAU,CAAC,IAAI,EAAJ,GAAS,EAAT,GAAc,EAAf,CAAV,CAA6BO,QAA9B,CAAN,CAA8CC,EAA9C,CAAiDC,KAAjD,CAAuD,MAAvD;EACA,CA1BC,CAAF;EA4BAV,EAAE,CAAC,gDAAD,EAAmD,YAAM;IAC1D,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,aAAD;MAAA,OAAmB,IAAAC,mBAAA,EAAQC,iBAAR,EAAeF,aAAf,EAA8B;QACnEI,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,QAHM,EAIN,MAJM,EAKN,KALM,EAMN,OANM,EAON,MAPM;MAD4D,CAA9B,CAAnB;IAAA,CAAnB;;IAYAC,MAAM,CAACN,UAAU,CAAC,IAAI,EAAJ,GAAS,EAAT,GAAc,EAAf,CAAV,CAA6BO,QAA9B,CAAN,CAA8CC,EAA9C,CAAiDC,KAAjD,CAAuD,KAAvD;EACA,CAdC,CAAF;AAeA,CAtEO,CAAR"}
1
+ {"version":3,"file":"round.test.js","names":["_getStep","_interopRequireDefault","require","_round","e","__esModule","describe","it","getStepFor","secondsPassed","getStep","steps","round","units","expect","formatAs","to","equal"],"sources":["../../source/steps/round.test.js"],"sourcesContent":["import getStep from './getStep.js'\r\nimport steps from './round.js'\r\n\r\ndescribe('steps/round', () => {\r\n\tit('should get step correctly (round: \"floor\")', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tround: 'floor',\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).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.9).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(1).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(59.9).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60 - 1).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(24 * 60 * 60).formatAs).to.equal('day')\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('week')\r\n\t})\r\n\r\n\tit('should get step correctly (round: \"round\")', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\r\n\t\t\tround: 'round',\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).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.49).formatAs).to.equal('now')\r\n\t\texpect(getStepFor(0.5).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(1).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(59.4).formatAs).to.equal('second')\r\n\t\texpect(getStepFor(60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(59.4 * 60).formatAs).to.equal('minute')\r\n\t\texpect(getStepFor(60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(23.49 * 60 * 60).formatAs).to.equal('hour')\r\n\t\texpect(getStepFor(23.5 * 60 * 60).formatAs).to.equal('day')\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('week')\r\n\t})\r\n\r\n\tit('should use \"day\"s when \"week\"s are not allowed', () => {\r\n\t\tconst getStepFor = (secondsPassed) => getStep(steps, secondsPassed, {\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'month',\r\n\t\t\t\t'year'\r\n\t\t\t]\r\n\t\t})\r\n\r\n\t\texpect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('day')\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA8B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAE9BE,QAAQ,CAAC,aAAa,EAAE,YAAM;EAC7BC,EAAE,CAAC,4CAA4C,EAAE,YAAM;IACtD,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,aAAa;MAAA,OAAK,IAAAC,mBAAO,EAACC,iBAAK,EAAEF,aAAa,EAAE;QACnEG,KAAK,EAAE,OAAO;QACdC,KAAK,EAAE,CACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM;MAER,CAAC,CAAC;IAAA;IAEFC,MAAM,CAACN,UAAU,CAAC,CAAC,CAAC,CAACO,QAAQ,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;IAC9CH,MAAM,CAACN,UAAU,CAAC,GAAG,CAAC,CAACO,QAAQ,CAAC,CAACC,EAAE,CAACC,KAAK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AAC;EAEFV,EAAE,CAAC,gDAAgD,EAAE,YAAM;IAC1D,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,aAAa;MAAA,OAAK,IAAAC,mBAAO,EAACC,iBAAK,EAAEF,aAAa,EAAE;QACnEI,KAAK,EAAE,CACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,MAAM;MAER,CAAC,CAAC;IAAA;IAEFC,MAAM,CAACN,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAACO,QAAQ,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;EAC9D,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -6,51 +6,40 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.day = void 0;
7
7
  exports.getSecondsInUnit = getSecondsInUnit;
8
8
  exports.year = exports.week = exports.month = exports.minute = exports.hour = void 0;
9
- var minute = 60; // in seconds
9
+ var minute = exports.minute = 60; // in seconds
10
10
 
11
- exports.minute = minute;
12
- var hour = 60 * minute; // in seconds
11
+ var hour = exports.hour = 60 * minute; // in seconds
13
12
 
14
- exports.hour = hour;
15
- var day = 24 * hour; // in seconds
13
+ var day = exports.day = 24 * hour; // in seconds
14
+
15
+ var week = exports.week = 7 * day; // in seconds
16
16
 
17
- exports.day = day;
18
- var week = 7 * day; // in seconds
19
17
  // https://www.quora.com/What-is-the-average-number-of-days-in-a-month
18
+ var month = exports.month = 30.44 * day; // in seconds
20
19
 
21
- exports.week = week;
22
- var month = 30.44 * day; // in seconds
23
20
  // "400 years have 146097 days (taking into account leap year rules)"
24
-
25
- exports.month = month;
26
- var year = 146097 / 400 * day; // in seconds
27
-
28
- exports.year = year;
21
+ var year = exports.year = 146097 / 400 * day; // in seconds
29
22
 
30
23
  function getSecondsInUnit(unit) {
31
24
  switch (unit) {
32
25
  case 'second':
33
26
  return 1;
34
-
35
27
  case 'minute':
36
28
  return minute;
37
-
38
29
  case 'hour':
39
30
  return hour;
40
-
41
31
  case 'day':
42
32
  return day;
43
-
44
33
  case 'week':
45
34
  return week;
46
-
47
35
  case 'month':
48
36
  return month;
49
-
50
37
  case 'year':
51
38
  return year;
52
39
  }
53
- } // export function getPreviousUnitFor(unit) {
40
+ }
41
+
42
+ // export function getPreviousUnitFor(unit) {
54
43
  // switch (unit) {
55
44
  // case 'second':
56
45
  // return 'now'
@@ -1 +1 @@
1
- {"version":3,"file":"units.js","names":["minute","hour","day","week","month","year","getSecondsInUnit","unit"],"sources":["../../source/steps/units.js"],"sourcesContent":["export const minute = 60 // in seconds\r\n\r\nexport const hour = 60 * minute // in seconds\r\n\r\nexport const day = 24 * hour // in seconds\r\n\r\nexport const week = 7 * day // in seconds\r\n\r\n// https://www.quora.com/What-is-the-average-number-of-days-in-a-month\r\nexport const month = 30.44 * day // in seconds\r\n\r\n// \"400 years have 146097 days (taking into account leap year rules)\"\r\nexport const year = (146097 / 400) * day // in seconds\r\n\r\nexport function getSecondsInUnit(unit) {\r\n\tswitch (unit) {\r\n\t\tcase 'second':\r\n\t\t\treturn 1\r\n\t\tcase 'minute':\r\n\t\t\treturn minute\r\n\t\tcase 'hour':\r\n\t\t\treturn hour\r\n\t\tcase 'day':\r\n\t\t\treturn day\r\n\t\tcase 'week':\r\n\t\t\treturn week\r\n\t\tcase 'month':\r\n\t\t\treturn month\r\n\t\tcase 'year':\r\n\t\t\treturn year\r\n\t}\r\n}\r\n\r\n// export function getPreviousUnitFor(unit) {\r\n// \tswitch (unit) {\r\n// \t\tcase 'second':\r\n// \t\t\treturn 'now'\r\n// \t\tcase 'minute':\r\n// \t\t\treturn 'second'\r\n// \t\tcase 'hour':\r\n// \t\t\treturn 'minute'\r\n// \t\tcase 'day':\r\n// \t\t\treturn 'hour'\r\n// \t\tcase 'week':\r\n// \t\t\treturn 'day'\r\n// \t\tcase 'month':\r\n// \t\t\treturn 'week'\r\n// \t\tcase 'year':\r\n// \t\t\treturn 'month'\r\n// \t}\r\n// }"],"mappings":";;;;;;;;AAAO,IAAMA,MAAM,GAAG,EAAf,C,CAAkB;;;AAElB,IAAMC,IAAI,GAAG,KAAKD,MAAlB,C,CAAyB;;;AAEzB,IAAME,GAAG,GAAG,KAAKD,IAAjB,C,CAAsB;;;AAEtB,IAAME,IAAI,GAAG,IAAID,GAAjB,C,CAAqB;AAE5B;;;AACO,IAAME,KAAK,GAAG,QAAQF,GAAtB,C,CAA0B;AAEjC;;;AACO,IAAMG,IAAI,GAAI,SAAS,GAAV,GAAiBH,GAA9B,C,CAAkC;;;;AAElC,SAASI,gBAAT,CAA0BC,IAA1B,EAAgC;EACtC,QAAQA,IAAR;IACC,KAAK,QAAL;MACC,OAAO,CAAP;;IACD,KAAK,QAAL;MACC,OAAOP,MAAP;;IACD,KAAK,MAAL;MACC,OAAOC,IAAP;;IACD,KAAK,KAAL;MACC,OAAOC,GAAP;;IACD,KAAK,MAAL;MACC,OAAOC,IAAP;;IACD,KAAK,OAAL;MACC,OAAOC,KAAP;;IACD,KAAK,MAAL;MACC,OAAOC,IAAP;EAdF;AAgBA,C,CAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"units.js","names":["minute","exports","hour","day","week","month","year","getSecondsInUnit","unit"],"sources":["../../source/steps/units.js"],"sourcesContent":["export const minute = 60 // in seconds\r\n\r\nexport const hour = 60 * minute // in seconds\r\n\r\nexport const day = 24 * hour // in seconds\r\n\r\nexport const week = 7 * day // in seconds\r\n\r\n// https://www.quora.com/What-is-the-average-number-of-days-in-a-month\r\nexport const month = 30.44 * day // in seconds\r\n\r\n// \"400 years have 146097 days (taking into account leap year rules)\"\r\nexport const year = (146097 / 400) * day // in seconds\r\n\r\nexport function getSecondsInUnit(unit) {\r\n\tswitch (unit) {\r\n\t\tcase 'second':\r\n\t\t\treturn 1\r\n\t\tcase 'minute':\r\n\t\t\treturn minute\r\n\t\tcase 'hour':\r\n\t\t\treturn hour\r\n\t\tcase 'day':\r\n\t\t\treturn day\r\n\t\tcase 'week':\r\n\t\t\treturn week\r\n\t\tcase 'month':\r\n\t\t\treturn month\r\n\t\tcase 'year':\r\n\t\t\treturn year\r\n\t}\r\n}\r\n\r\n// export function getPreviousUnitFor(unit) {\r\n// \tswitch (unit) {\r\n// \t\tcase 'second':\r\n// \t\t\treturn 'now'\r\n// \t\tcase 'minute':\r\n// \t\t\treturn 'second'\r\n// \t\tcase 'hour':\r\n// \t\t\treturn 'minute'\r\n// \t\tcase 'day':\r\n// \t\t\treturn 'hour'\r\n// \t\tcase 'week':\r\n// \t\t\treturn 'day'\r\n// \t\tcase 'month':\r\n// \t\t\treturn 'week'\r\n// \t\tcase 'year':\r\n// \t\t\treturn 'month'\r\n// \t}\r\n// }"],"mappings":";;;;;;;;AAAO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,EAAE,EAAC;;AAElB,IAAME,IAAI,GAAAD,OAAA,CAAAC,IAAA,GAAG,EAAE,GAAGF,MAAM,EAAC;;AAEzB,IAAMG,GAAG,GAAAF,OAAA,CAAAE,GAAA,GAAG,EAAE,GAAGD,IAAI,EAAC;;AAEtB,IAAME,IAAI,GAAAH,OAAA,CAAAG,IAAA,GAAG,CAAC,GAAGD,GAAG,EAAC;;AAE5B;AACO,IAAME,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAG,KAAK,GAAGF,GAAG,EAAC;;AAEjC;AACO,IAAMG,IAAI,GAAAL,OAAA,CAAAK,IAAA,GAAI,MAAM,GAAG,GAAG,GAAIH,GAAG,EAAC;;AAElC,SAASI,gBAAgBA,CAACC,IAAI,EAAE;EACtC,QAAQA,IAAI;IACX,KAAK,QAAQ;MACZ,OAAO,CAAC;IACT,KAAK,QAAQ;MACZ,OAAOR,MAAM;IACd,KAAK,MAAM;MACV,OAAOE,IAAI;IACZ,KAAK,KAAK;MACT,OAAOC,GAAG;IACX,KAAK,MAAM;MACV,OAAOC,IAAI;IACZ,KAAK,OAAO;MACX,OAAOC,KAAK;IACb,KAAK,MAAM;MACV,OAAOC,IAAI;EACb;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _approximate = _interopRequireDefault(require("../steps/approximate.js"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
9
  // "gradation" is a legacy name for "steps".
13
10
  // It's here just for legacy compatibility.
14
11
  // Use "steps" name instead.
@@ -18,10 +15,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
18
15
  // "units" is a legacy property.
19
16
  // It's here just for legacy compatibility.
20
17
  // Developers shouldn't need to use it in their custom styles.
21
- var _default = {
18
+ var _default = exports["default"] = {
22
19
  gradation: _approximate["default"],
23
20
  flavour: 'long',
24
21
  units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
25
22
  };
26
- exports["default"] = _default;
27
23
  //# sourceMappingURL=approximate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approximate.js","names":["gradation","approximate","flavour","units"],"sources":["../../source/style/approximate.js"],"sourcesContent":["import approximate from '../steps/approximate.js'\r\n\r\n// \"gradation\" is a legacy name for \"steps\".\r\n// It's here just for legacy compatibility.\r\n// Use \"steps\" name instead.\r\n\r\n// \"flavour\" is a legacy name for \"labels\".\r\n// It's here just for legacy compatibility.\r\n// Use \"labels\" name instead.\r\n\r\n// \"units\" is a legacy property.\r\n// It's here just for legacy compatibility.\r\n// Developers shouldn't need to use it in their custom styles.\r\n\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long',\r\n\tunits: [\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;eAEe;EACdA,SAAS,EAAEC,uBADG;EAEdC,OAAO,EAAE,MAFK;EAGdC,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,MAHM,EAIN,KAJM,EAKN,MALM,EAMN,OANM,EAON,MAPM;AAHO,C"}
1
+ {"version":3,"file":"approximate.js","names":["_approximate","_interopRequireDefault","require","e","__esModule","_default","exports","gradation","approximate","flavour","units"],"sources":["../../source/style/approximate.js"],"sourcesContent":["import approximate from '../steps/approximate.js'\r\n\r\n// \"gradation\" is a legacy name for \"steps\".\r\n// It's here just for legacy compatibility.\r\n// Use \"steps\" name instead.\r\n\r\n// \"flavour\" is a legacy name for \"labels\".\r\n// It's here just for legacy compatibility.\r\n// Use \"labels\" name instead.\r\n\r\n// \"units\" is a legacy property.\r\n// It's here just for legacy compatibility.\r\n// Developers shouldn't need to use it in their custom styles.\r\n\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long',\r\n\tunits: [\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAEjD;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA,IAAAE,QAAA,GAAAC,OAAA,cAEe;EACdC,SAAS,EAAEC,uBAAW;EACtBC,OAAO,EAAE,MAAM;EACfC,KAAK,EAAE,CACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM;AAER,CAAC","ignoreList":[]}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _approximate = _interopRequireDefault(require("../steps/approximate.js"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
9
  // "gradation" is a legacy name for "steps".
13
10
  // It's here just for legacy compatibility.
14
11
  // Use "steps" name instead.
@@ -41,10 +38,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
41
38
  // a year
42
39
  // 2 years
43
40
  //
44
- var _default = {
41
+ var _default = exports["default"] = {
45
42
  gradation: _approximate["default"],
46
43
  flavour: 'long-time',
47
44
  units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
48
45
  };
49
- exports["default"] = _default;
50
46
  //# sourceMappingURL=approximateTime.js.map