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
@@ -12,8 +12,8 @@
12
12
  // }
13
13
  // }
14
14
  // }
15
- // Looks like this one won't be used in the next major version.
16
15
 
16
+ // Looks like this one won't be used in the next major version.
17
17
  /**
18
18
  * Converts value to a `Date`
19
19
  * @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;AACA,OAAO,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;AACA,OAAO,SAASA,OAAOA,CAACC,KAAK,EAAE;EAC9B,OAAOA,KAAK,YAAYC,IAAI,GAAGD,KAAK,GAAG,IAAIC,IAAI,CAACD,KAAK,CAAC;AACvD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.test.js","names":["getDate","describe","it","today","Date","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,SAASA,OAAT,QAAwB,cAAxB;AAEAC,QAAQ,CAAC,eAAD,EAAkB,YAAM;EAC/BC,EAAE,CAAC,8BAAD,EAAiC,YAAM;IACxC,IAAMC,KAAK,GAAG,IAAIC,IAAJ,EAAd;IACAJ,OAAO,CAACG,KAAK,CAACE,OAAN,EAAD,CAAP,CAAyBA,OAAzB,GAAmCC,MAAnC,CAA0CC,KAA1C,CAAgDJ,KAAK,CAACE,OAAN,EAAhD;IACAL,OAAO,CAACG,KAAD,CAAP,CAAeE,OAAf,GAAyBC,MAAzB,CAAgCC,KAAhC,CAAsCJ,KAAK,CAACE,OAAN,EAAtC;EACA,CAJC,CAAF;AAKA,CANO,CAAR"}
1
+ {"version":3,"file":"helpers.test.js","names":["getDate","describe","it","today","Date","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,SAASA,OAAO,QAAQ,cAAc;AAEtCC,QAAQ,CAAC,eAAe,EAAE,YAAM;EAC/BC,EAAE,CAAC,8BAA8B,EAAE,YAAM;IACxC,IAAMC,KAAK,GAAG,IAAIC,IAAI,CAAC,CAAC;IACxBJ,OAAO,CAACG,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC,CAACA,OAAO,CAAC,CAAC,CAACC,MAAM,CAACC,KAAK,CAACJ,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC;IAChEL,OAAO,CAACG,KAAK,CAAC,CAACE,OAAO,CAAC,CAAC,CAACC,MAAM,CAACC,KAAK,CAACJ,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC;EACvD,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  // "convenient" is a legacy name of "approximate" steps.
2
- export { default as approximate, default as convenient } from './approximate.js'; // "canonical" is a legacy name of "round" steps.
2
+ export { default as approximate, default as convenient } from './approximate.js';
3
3
 
4
+ // "canonical" is a legacy name of "round" steps.
4
5
  export { default as round, default as canonical } from './round.js';
5
6
  export { minute, hour, day, week, month, year } from './units.js';
6
7
  export { getDate } from './helpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","approximate","convenient","round","canonical","minute","hour","day","week","month","year","getDate"],"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":"AAAA;AACA,SAASA,OAAO,IAAIC,WAApB,EAAiCD,OAAO,IAAIE,UAA5C,QAA8D,kBAA9D,C,CAEA;;AACA,SAASF,OAAO,IAAIG,KAApB,EAA2BH,OAAO,IAAII,SAAtC,QAAuD,YAAvD;AAEA,SACCC,MADD,EAECC,IAFD,EAGCC,GAHD,EAICC,IAJD,EAKCC,KALD,EAMCC,IAND,QAOO,YAPP;AASA,SACCC,OADD,QAEO,cAFP"}
1
+ {"version":3,"file":"index.js","names":["default","approximate","convenient","round","canonical","minute","hour","day","week","month","year","getDate"],"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":"AAAA;AACA,SAASA,OAAO,IAAIC,WAAW,EAAED,OAAO,IAAIE,UAAU,QAAQ,kBAAkB;;AAEhF;AACA,SAASF,OAAO,IAAIG,KAAK,EAAEH,OAAO,IAAII,SAAS,QAAQ,YAAY;AAEnE,SACCC,MAAM,EACNC,IAAI,EACJC,GAAG,EACHC,IAAI,EACJC,KAAK,EACLC,IAAI,QACE,YAAY;AAEnB,SACCC,OAAO,QACD,cAAc","ignoreList":[]}
@@ -1,21 +1,17 @@
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 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; }
4
-
5
- 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; }
6
-
7
- 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; }
8
-
1
+ 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); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ 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); }
9
7
  // This function is only used for backwards compatibility
10
8
  // with legacy code that uses the older versions of this library.
11
9
  export default function (step_) {
12
10
  var step = _objectSpread({}, step_);
13
-
14
11
  if (step.minTime !== undefined) {
15
12
  if (_typeof(step.minTime) === 'object') {
16
13
  for (var _i = 0, _Object$keys = Object.keys(step.minTime); _i < _Object$keys.length; _i++) {
17
14
  var key = _Object$keys[_i];
18
-
19
15
  if (key === 'default') {
20
16
  step.threshold = step.minTime["default"];
21
17
  } else {
@@ -25,15 +21,12 @@ export default function (step_) {
25
21
  } else {
26
22
  step.threshold = step.minTime;
27
23
  }
28
-
29
24
  delete step.minTime;
30
25
  }
31
-
32
26
  if (step.formatAs) {
33
27
  step.unit = step.formatAs;
34
28
  delete step.formatAs;
35
29
  }
36
-
37
30
  return step;
38
31
  }
39
32
  //# 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;AACA,eAAe,UAASA,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":["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;AACA,eAAe,UAASA,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 +1 @@
1
- {"version":3,"file":"renameLegacyProperties.test.js","names":["renameLegacyProperties","describe","it","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,OAAOA,sBAAP,MAAmC,6BAAnC;AAEAC,QAAQ,CAAC,8BAAD,EAAiC,YAAM;EAC9CC,EAAE,CAAC,iCAAD,EAAoC,YAAM;IAC3CF,sBAAsB,CAAC;MACtBG,QAAQ,EAAE,KADY;MAEtBC,OAAO,EAAE;IAFa,CAAD,CAAtB,CAGGC,MAHH,CAGUC,IAHV,CAGeC,KAHf,CAGqB;MACpBC,IAAI,EAAE,KADc;MAEpBC,SAAS,EAAE;IAFS,CAHrB;EAOA,CARC,CAAF;EAUAP,EAAE,CAAC,sDAAD,EAAyD,YAAM;IAChEF,sBAAsB,CAAC;MACtBG,QAAQ,EAAE;IADY,CAAD,CAAtB,CAEGE,MAFH,CAEUC,IAFV,CAEeC,KAFf,CAEqB;MACpBC,IAAI,EAAE;IADc,CAFrB;EAKA,CANC,CAAF;EAQAN,EAAE,CAAC,0DAAD,EAA6D,YAAM;IACpEF,sBAAsB,CAAC;MACtBG,QAAQ,EAAE,KADY;MAEtBC,OAAO,EAAE;QACRM,IAAI,EAAE,CADE;QAER,WAAS;MAFD;IAFa,CAAD,CAAtB,CAMGL,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","describe","it","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,OAAOA,sBAAsB,MAAM,6BAA6B;AAEhEC,QAAQ,CAAC,8BAA8B,EAAE,YAAM;EAC9CC,EAAE,CAAC,iCAAiC,EAAE,YAAM;IAC3CF,sBAAsB,CAAC;MACtBG,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;EAEFP,EAAE,CAAC,sDAAsD,EAAE,YAAM;IAChEF,sBAAsB,CAAC;MACtBG,QAAQ,EAAE;IACX,CAAC,CAAC,CAACE,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC;MACpBC,IAAI,EAAE;IACP,CAAC,CAAC;EACH,CAAC,CAAC;EAEFN,EAAE,CAAC,0DAA0D,EAAE,YAAM;IACpEF,sBAAsB,CAAC;MACtBG,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":[]}
@@ -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;AACA,eAAe,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,CAAf"}
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;AACA,eAAe,CACd;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,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,CACD","ignoreList":[]}
@@ -8,7 +8,6 @@ describe('steps/round', function () {
8
8
  units: ['now', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year']
9
9
  });
10
10
  };
11
-
12
11
  expect(getStepFor(0).formatAs).to.equal('now');
13
12
  expect(getStepFor(0.9).formatAs).to.equal('now');
14
13
  expect(getStepFor(1).formatAs).to.equal('second');
@@ -26,7 +25,6 @@ describe('steps/round', function () {
26
25
  units: ['now', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year']
27
26
  });
28
27
  };
29
-
30
28
  expect(getStepFor(0).formatAs).to.equal('now');
31
29
  expect(getStepFor(0.49).formatAs).to.equal('now');
32
30
  expect(getStepFor(0.5).formatAs).to.equal('second');
@@ -45,7 +43,6 @@ describe('steps/round', function () {
45
43
  units: ['now', 'second', 'minute', 'hour', 'day', 'month', 'year']
46
44
  });
47
45
  };
48
-
49
46
  expect(getStepFor(7 * 24 * 60 * 60).formatAs).to.equal('day');
50
47
  });
51
48
  });
@@ -1 +1 @@
1
- {"version":3,"file":"round.test.js","names":["getStep","steps","describe","it","getStepFor","secondsPassed","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":"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"}
1
+ {"version":3,"file":"round.test.js","names":["getStep","steps","describe","it","getStepFor","secondsPassed","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":"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","ignoreList":[]}
@@ -5,37 +5,33 @@ export var hour = 60 * minute; // in seconds
5
5
  export var day = 24 * hour; // in seconds
6
6
 
7
7
  export var week = 7 * day; // in seconds
8
- // https://www.quora.com/What-is-the-average-number-of-days-in-a-month
9
8
 
9
+ // https://www.quora.com/What-is-the-average-number-of-days-in-a-month
10
10
  export var month = 30.44 * day; // in seconds
11
- // "400 years have 146097 days (taking into account leap year rules)"
12
11
 
12
+ // "400 years have 146097 days (taking into account leap year rules)"
13
13
  export var year = 146097 / 400 * day; // in seconds
14
14
 
15
15
  export function getSecondsInUnit(unit) {
16
16
  switch (unit) {
17
17
  case 'second':
18
18
  return 1;
19
-
20
19
  case 'minute':
21
20
  return minute;
22
-
23
21
  case 'hour':
24
22
  return hour;
25
-
26
23
  case 'day':
27
24
  return day;
28
-
29
25
  case 'week':
30
26
  return week;
31
-
32
27
  case 'month':
33
28
  return month;
34
-
35
29
  case 'year':
36
30
  return year;
37
31
  }
38
- } // export function getPreviousUnitFor(unit) {
32
+ }
33
+
34
+ // export function getPreviousUnitFor(unit) {
39
35
  // switch (unit) {
40
36
  // case 'second':
41
37
  // 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":"AAAA,OAAO,IAAMA,MAAM,GAAG,EAAf,C,CAAkB;;AAEzB,OAAO,IAAMC,IAAI,GAAG,KAAKD,MAAlB,C,CAAyB;;AAEhC,OAAO,IAAME,GAAG,GAAG,KAAKD,IAAjB,C,CAAsB;;AAE7B,OAAO,IAAME,IAAI,GAAG,IAAID,GAAjB,C,CAAqB;AAE5B;;AACA,OAAO,IAAME,KAAK,GAAG,QAAQF,GAAtB,C,CAA0B;AAEjC;;AACA,OAAO,IAAMG,IAAI,GAAI,SAAS,GAAV,GAAiBH,GAA9B,C,CAAkC;;AAEzC,OAAO,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","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":"AAAA,OAAO,IAAMA,MAAM,GAAG,EAAE,EAAC;;AAEzB,OAAO,IAAMC,IAAI,GAAG,EAAE,GAAGD,MAAM,EAAC;;AAEhC,OAAO,IAAME,GAAG,GAAG,EAAE,GAAGD,IAAI,EAAC;;AAE7B,OAAO,IAAME,IAAI,GAAG,CAAC,GAAGD,GAAG,EAAC;;AAE5B;AACA,OAAO,IAAME,KAAK,GAAG,KAAK,GAAGF,GAAG,EAAC;;AAEjC;AACA,OAAO,IAAMG,IAAI,GAAI,MAAM,GAAG,GAAG,GAAIH,GAAG,EAAC;;AAEzC,OAAO,SAASI,gBAAgBA,CAACC,IAAI,EAAE;EACtC,QAAQA,IAAI;IACX,KAAK,QAAQ;MACZ,OAAO,CAAC;IACT,KAAK,QAAQ;MACZ,OAAOP,MAAM;IACd,KAAK,MAAM;MACV,OAAOC,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":[]}
@@ -1,9 +1,13 @@
1
- import approximate from '../steps/approximate.js'; // "gradation" is a legacy name for "steps".
1
+ import approximate from '../steps/approximate.js';
2
+
3
+ // "gradation" is a legacy name for "steps".
2
4
  // It's here just for legacy compatibility.
3
5
  // Use "steps" name instead.
6
+
4
7
  // "flavour" is a legacy name for "labels".
5
8
  // It's here just for legacy compatibility.
6
9
  // Use "labels" name instead.
10
+
7
11
  // "units" is a legacy property.
8
12
  // It's here just for legacy compatibility.
9
13
  // Developers shouldn't need to use it in their custom styles.
@@ -1 +1 @@
1
- {"version":3,"file":"approximate.js","names":["approximate","gradation","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,OAAOA,WAAP,MAAwB,yBAAxB,C,CAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;AAEA,eAAe;EACdC,SAAS,EAAED,WADG;EAEdE,OAAO,EAAE,MAFK;EAGdC,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,MAHM,EAIN,KAJM,EAKN,MALM,EAMN,OANM,EAON,MAPM;AAHO,CAAf"}
1
+ {"version":3,"file":"approximate.js","names":["approximate","gradation","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,OAAOA,WAAW,MAAM,yBAAyB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,eAAe;EACdC,SAAS,EAAED,WAAW;EACtBE,OAAO,EAAE,MAAM;EACfC,KAAK,EAAE,CACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM;AAER,CAAC","ignoreList":[]}
@@ -1,12 +1,17 @@
1
- import approximate from '../steps/approximate.js'; // "gradation" is a legacy name for "steps".
1
+ import approximate from '../steps/approximate.js';
2
+
3
+ // "gradation" is a legacy name for "steps".
2
4
  // It's here just for legacy compatibility.
3
5
  // Use "steps" name instead.
6
+
4
7
  // "flavour" is a legacy name for "labels".
5
8
  // It's here just for legacy compatibility.
6
9
  // Use "labels" name instead.
10
+
7
11
  // "units" is a legacy property.
8
12
  // It's here just for legacy compatibility.
9
13
  // Developers shouldn't need to use it in their custom styles.
14
+
10
15
  // Similar to the default style but with "ago" omitted.
11
16
  //
12
17
  // just now
@@ -30,7 +35,6 @@ import approximate from '../steps/approximate.js'; // "gradation" is a legacy na
30
35
  // a year
31
36
  // 2 years
32
37
  //
33
-
34
38
  export default {
35
39
  gradation: approximate,
36
40
  flavour: 'long-time',
@@ -1 +1 @@
1
- {"version":3,"file":"approximateTime.js","names":["approximate","gradation","flavour","units"],"sources":["../../source/style/approximateTime.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\n// Similar to the default style but with \"ago\" omitted.\r\n//\r\n// just now\r\n// 5 minutes\r\n// 10 minutes\r\n// 15 minutes\r\n// 20 minutes\r\n// an hour\r\n// 2 hours\r\n// …\r\n// 20 hours\r\n// 1 day\r\n// 2 days\r\n// a week\r\n// 2 weeks\r\n// 3 weeks\r\n// a month\r\n// 2 months\r\n// 3 months\r\n// 4 months\r\n// a year\r\n// 2 years\r\n//\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long-time',\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,OAAOA,WAAP,MAAwB,yBAAxB,C,CAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;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,eAAe;EACdC,SAAS,EAAED,WADG;EAEdE,OAAO,EAAE,WAFK;EAGdC,KAAK,EAAE,CACN,KADM,EAEN,QAFM,EAGN,MAHM,EAIN,KAJM,EAKN,MALM,EAMN,OANM,EAON,MAPM;AAHO,CAAf"}
1
+ {"version":3,"file":"approximateTime.js","names":["approximate","gradation","flavour","units"],"sources":["../../source/style/approximateTime.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\n// Similar to the default style but with \"ago\" omitted.\r\n//\r\n// just now\r\n// 5 minutes\r\n// 10 minutes\r\n// 15 minutes\r\n// 20 minutes\r\n// an hour\r\n// 2 hours\r\n// …\r\n// 20 hours\r\n// 1 day\r\n// 2 days\r\n// a week\r\n// 2 weeks\r\n// 3 weeks\r\n// a month\r\n// 2 months\r\n// 3 months\r\n// 4 months\r\n// a year\r\n// 2 years\r\n//\r\nexport default {\r\n\tgradation: approximate,\r\n\tflavour: 'long-time',\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,OAAOA,WAAW,MAAM,yBAAyB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;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,eAAe;EACdC,SAAS,EAAED,WAAW;EACtBE,OAAO,EAAE,WAAW;EACpBC,KAAK,EAAE,CACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM;AAER,CAAC","ignoreList":[]}
@@ -1,9 +1,6 @@
1
- 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."); }
2
-
3
- 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); }
4
-
5
- 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; }
6
-
1
+ function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
7
4
  import TimeAgo from '../TimeAgo.js';
8
5
  import approximateTime from './approximateTime.js';
9
6
  import { day, month, year } from '../steps/units.js';
@@ -15,91 +12,139 @@ describe('style/approximate-time', function () {
15
12
  approximateScaleStepsTest(['только что', '1 минута', '2 минуты', '5 минут', '10 минут', '15 минут', '20 минут', '25 минут', '30 минут', '35 минут', '40 минут', '45 минут', '50 минут', '1 час', '2 часа', '3 часа', '4 часа', '5 часов', '6 часов', '7 часов', '8 часов', '9 часов', '10 часов', '11 часов', '12 часов', '13 часов', '14 часов', '15 часов', '16 часов', '17 часов', '18 часов', '19 часов', '20 часов', '1 день', '2 дня', '3 дня', '4 дня', '5 дней', '1 неделю', '2 недели', '3 недели', '1 месяц', '2 месяца', '3 месяца', '4 месяца', '5 месяцев', '6 месяцев', '7 месяцев', '8 месяцев', '9 месяцев', '9 месяцев', '10 месяцев', '1 год', '2 года', '3 года', '100 лет'], 'ru-RU');
16
13
  });
17
14
  });
18
-
19
15
  function approximateScaleStepsTest(labels, timeAgo) {
20
16
  if (typeof timeAgo === 'string') {
21
17
  timeAgo = new TimeAgo(timeAgo);
22
18
  }
23
-
24
19
  var now = Date.now();
25
-
26
20
  var elapsed = function elapsed(time) {
27
21
  return timeAgo.format(now - time * 1000, 'approximate-time', {
28
22
  now: now
29
23
  });
30
24
  };
31
-
32
25
  if (approximateScaleSteps.length !== labels.length) {
33
26
  throw new Error("Array length mismatch. Steps: ".concat(approximateScaleSteps.length, ", labels: ").concat(labels.length));
34
27
  }
35
-
36
28
  var i = 0;
37
-
38
29
  while (i < approximateScaleSteps.length) {
39
30
  for (var _iterator = _createForOfIteratorHelperLoose(approximateScaleSteps[i]), _step; !(_step = _iterator()).done;) {
40
31
  var time = _step.value;
41
32
  elapsed(time).should.equal(labels[i]);
42
33
  }
43
-
44
34
  i++;
45
35
  }
46
36
  }
47
-
48
- var approximateScaleSteps = [// 'just now':
49
- [0, 40.49], // '1 minute ago':
50
- [45.5, 1.49 * 60], // '2 minutes ago':
51
- [1.51 * 60, 2.49 * 60], // '5 minutes ago':
52
- [2.51 * 60, 7.49 * 60], // '10 minutes ago':
53
- [7.51 * 60, 12.49 * 60], // '15 minutes ago':
54
- [12.51 * 60, 17.49 * 60], // '20 minutes ago':
55
- [17.51 * 60, 22.49 * 60], // '25 minutes ago':
56
- [22.51 * 60, 27.49 * 60], // '30 minutes ago':
57
- [27.51 * 60, 32.49 * 60], // '35 minutes ago':
58
- [32.51 * 60, 37.49 * 60], // '40 minutes ago':
59
- [37.51 * 60, 42.49 * 60], // '45 minutes ago':
60
- [42.51 * 60, 47.49 * 60], // '50 minutes ago':
61
- [47.51 * 60, 52.49 * 60], // '1 hour ago':
62
- [55.01 * 60, 1.49 * 60 * 60], // '2 hours ago':
63
- [1.51 * 60 * 60, 2.49 * 60 * 60], // '3 hours ago':
64
- [2.51 * 60 * 60, 3.49 * 60 * 60], // '4 hours ago':
65
- [3.51 * 60 * 60, 4.49 * 60 * 60], // '5 hours ago':
66
- [4.51 * 60 * 60, 5.49 * 60 * 60], // '6 hours ago':
67
- [5.51 * 60 * 60, 6.49 * 60 * 60], // '7 hours ago':
68
- [6.51 * 60 * 60, 7.49 * 60 * 60], // '8 hours ago':
69
- [7.51 * 60 * 60, 8.49 * 60 * 60], // '9 hours ago':
70
- [8.51 * 60 * 60, 9.49 * 60 * 60], // '10 hours ago':
71
- [9.51 * 60 * 60, 10.49 * 60 * 60], // '11 hours ago':
72
- [10.51 * 60 * 60, 11.49 * 60 * 60], // '12 hours ago':
73
- [11.51 * 60 * 60, 12.49 * 60 * 60], // '13 hours ago':
74
- [12.51 * 60 * 60, 13.49 * 60 * 60], // '14 hours ago':
75
- [13.51 * 60 * 60, 14.49 * 60 * 60], // '15 hours ago':
76
- [14.51 * 60 * 60, 15.49 * 60 * 60], // '16 hours ago':
77
- [15.51 * 60 * 60, 16.49 * 60 * 60], // '17 hours ago':
78
- [16.51 * 60 * 60, 17.49 * 60 * 60], // '18 hours ago':
79
- [17.51 * 60 * 60, 18.49 * 60 * 60], // '19 hours ago':
80
- [18.51 * 60 * 60, 19.49 * 60 * 60], // '20 hours ago':
81
- [19.51 * 60 * 60, 20.49 * 60 * 60], // '1 day ago':
82
- [20.51 * 60 * 60, 1.49 * day], // '2 days ago':
83
- [1.51 * day, 2.49 * day], // '3 days ago':
84
- [2.51 * day, 3.49 * day], // '4 days ago':
85
- [3.51 * day, 4.49 * day], // '5 days ago':
86
- [4.51 * day, 5.49 * day], // '1 week ago':
87
- [5.51 * day, 1.49 * 7 * day], // '2 weeks ago':
88
- [1.51 * 7 * day, 2.49 * 7 * day], // '3 weeks ago':
89
- [2.51 * 7 * day, 3.49 * 7 * day], // '1 month ago':
90
- [3.51 * 7 * day, 1.49 * month], // '2 months ago':
91
- [1.51 * month, 2.49 * month], // '3 months ago':
92
- [2.51 * month, 3.49 * month], // '4 months ago':
93
- [3.51 * month, 4.49 * month], // '5 months ago':
94
- [4.51 * month, 5.49 * month], // '6 months ago':
95
- [5.51 * month, 6.49 * month], // '7 months ago':
96
- [6.51 * month, 7.49 * month], // '8 months ago':
97
- [7.51 * month, 8.49 * month], // '9 months ago':
98
- [8.51 * month, 8.99 * month], // '9 months ago':
99
- [9.01 * month, 9.49 * month], // '10 months ago':
100
- [9.51 * month, 10.49 * month], // '1 year ago':
101
- [10.51 * month, 1.49 * year], // '2 years ago':
102
- [1.51 * year, 2.49 * year], // '3 years ago':
103
- [2.51 * year, 3.49 * year], // '100 years ago':
37
+ var approximateScaleSteps = [
38
+ // 'just now':
39
+ [0, 40.49],
40
+ // '1 minute ago':
41
+ [45.5, 1.49 * 60],
42
+ // '2 minutes ago':
43
+ [1.51 * 60, 2.49 * 60],
44
+ // '5 minutes ago':
45
+ [2.51 * 60, 7.49 * 60],
46
+ // '10 minutes ago':
47
+ [7.51 * 60, 12.49 * 60],
48
+ // '15 minutes ago':
49
+ [12.51 * 60, 17.49 * 60],
50
+ // '20 minutes ago':
51
+ [17.51 * 60, 22.49 * 60],
52
+ // '25 minutes ago':
53
+ [22.51 * 60, 27.49 * 60],
54
+ // '30 minutes ago':
55
+ [27.51 * 60, 32.49 * 60],
56
+ // '35 minutes ago':
57
+ [32.51 * 60, 37.49 * 60],
58
+ // '40 minutes ago':
59
+ [37.51 * 60, 42.49 * 60],
60
+ // '45 minutes ago':
61
+ [42.51 * 60, 47.49 * 60],
62
+ // '50 minutes ago':
63
+ [47.51 * 60, 52.49 * 60],
64
+ // '1 hour ago':
65
+ [55.01 * 60, 1.49 * 60 * 60],
66
+ // '2 hours ago':
67
+ [1.51 * 60 * 60, 2.49 * 60 * 60],
68
+ // '3 hours ago':
69
+ [2.51 * 60 * 60, 3.49 * 60 * 60],
70
+ // '4 hours ago':
71
+ [3.51 * 60 * 60, 4.49 * 60 * 60],
72
+ // '5 hours ago':
73
+ [4.51 * 60 * 60, 5.49 * 60 * 60],
74
+ // '6 hours ago':
75
+ [5.51 * 60 * 60, 6.49 * 60 * 60],
76
+ // '7 hours ago':
77
+ [6.51 * 60 * 60, 7.49 * 60 * 60],
78
+ // '8 hours ago':
79
+ [7.51 * 60 * 60, 8.49 * 60 * 60],
80
+ // '9 hours ago':
81
+ [8.51 * 60 * 60, 9.49 * 60 * 60],
82
+ // '10 hours ago':
83
+ [9.51 * 60 * 60, 10.49 * 60 * 60],
84
+ // '11 hours ago':
85
+ [10.51 * 60 * 60, 11.49 * 60 * 60],
86
+ // '12 hours ago':
87
+ [11.51 * 60 * 60, 12.49 * 60 * 60],
88
+ // '13 hours ago':
89
+ [12.51 * 60 * 60, 13.49 * 60 * 60],
90
+ // '14 hours ago':
91
+ [13.51 * 60 * 60, 14.49 * 60 * 60],
92
+ // '15 hours ago':
93
+ [14.51 * 60 * 60, 15.49 * 60 * 60],
94
+ // '16 hours ago':
95
+ [15.51 * 60 * 60, 16.49 * 60 * 60],
96
+ // '17 hours ago':
97
+ [16.51 * 60 * 60, 17.49 * 60 * 60],
98
+ // '18 hours ago':
99
+ [17.51 * 60 * 60, 18.49 * 60 * 60],
100
+ // '19 hours ago':
101
+ [18.51 * 60 * 60, 19.49 * 60 * 60],
102
+ // '20 hours ago':
103
+ [19.51 * 60 * 60, 20.49 * 60 * 60],
104
+ // '1 day ago':
105
+ [20.51 * 60 * 60, 1.49 * day],
106
+ // '2 days ago':
107
+ [1.51 * day, 2.49 * day],
108
+ // '3 days ago':
109
+ [2.51 * day, 3.49 * day],
110
+ // '4 days ago':
111
+ [3.51 * day, 4.49 * day],
112
+ // '5 days ago':
113
+ [4.51 * day, 5.49 * day],
114
+ // '1 week ago':
115
+ [5.51 * day, 1.49 * 7 * day],
116
+ // '2 weeks ago':
117
+ [1.51 * 7 * day, 2.49 * 7 * day],
118
+ // '3 weeks ago':
119
+ [2.51 * 7 * day, 3.49 * 7 * day],
120
+ // '1 month ago':
121
+ [3.51 * 7 * day, 1.49 * month],
122
+ // '2 months ago':
123
+ [1.51 * month, 2.49 * month],
124
+ // '3 months ago':
125
+ [2.51 * month, 3.49 * month],
126
+ // '4 months ago':
127
+ [3.51 * month, 4.49 * month],
128
+ // '5 months ago':
129
+ [4.51 * month, 5.49 * month],
130
+ // '6 months ago':
131
+ [5.51 * month, 6.49 * month],
132
+ // '7 months ago':
133
+ [6.51 * month, 7.49 * month],
134
+ // '8 months ago':
135
+ [7.51 * month, 8.49 * month],
136
+ // '9 months ago':
137
+ [8.51 * month, 8.99 * month],
138
+ // '9 months ago':
139
+ [9.01 * month, 9.49 * month],
140
+ // '10 months ago':
141
+ [9.51 * month, 10.49 * month],
142
+ // '1 year ago':
143
+ [10.51 * month, 1.49 * year],
144
+ // '2 years ago':
145
+ [1.51 * year, 2.49 * year],
146
+ // '3 years ago':
147
+ [2.51 * year, 3.49 * year],
148
+ // '100 years ago':
104
149
  [99.51 * year, 100.49 * year]];
105
150
  //# sourceMappingURL=approximateTime.test.js.map