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.
- package/bundle/javascript-time-ago.js +1 -1
- package/bundle/javascript-time-ago.js.map +1 -1
- package/bundle/javascript-time-ago.min.js +1 -1
- package/bundle/javascript-time-ago.min.js.map +1 -1
- package/commonjs/LocaleDataStore.js +2 -5
- package/commonjs/LocaleDataStore.js.map +1 -1
- package/commonjs/PropTypes.js +12 -12
- package/commonjs/PropTypes.js.map +1 -1
- package/commonjs/TimeAgo.js +135 -190
- package/commonjs/TimeAgo.js.map +1 -1
- package/commonjs/TimeAgo.test.js +124 -130
- package/commonjs/TimeAgo.test.js.map +1 -1
- package/commonjs/cache.js +7 -25
- package/commonjs/cache.js.map +1 -1
- package/commonjs/cache.test.js +1 -3
- package/commonjs/cache.test.js.map +1 -1
- package/commonjs/isStyleObject.js +9 -9
- package/commonjs/isStyleObject.js.map +1 -1
- package/commonjs/isStyleObject.test.js +1 -3
- package/commonjs/isStyleObject.test.js.map +1 -1
- package/commonjs/locale.js +6 -19
- package/commonjs/locale.js.map +1 -1
- package/commonjs/locale.test.js +2 -11
- package/commonjs/locale.test.js.map +1 -1
- package/commonjs/round.js +2 -5
- package/commonjs/round.js.map +1 -1
- package/commonjs/steps/approximate.js +1 -4
- package/commonjs/steps/approximate.js.map +1 -1
- package/commonjs/steps/approximate.test.js +1 -6
- package/commonjs/steps/approximate.test.js.map +1 -1
- package/commonjs/steps/getStep.js +36 -53
- package/commonjs/steps/getStep.js.map +1 -1
- package/commonjs/steps/getStep.test.js +7 -7
- package/commonjs/steps/getStep.test.js.map +1 -1
- package/commonjs/steps/getStepDenominator.js +2 -5
- package/commonjs/steps/getStepDenominator.js.map +1 -1
- package/commonjs/steps/getStepDenominator.test.js +1 -3
- package/commonjs/steps/getStepDenominator.test.js.map +1 -1
- package/commonjs/steps/getStepMinTime.js +17 -32
- package/commonjs/steps/getStepMinTime.js.map +1 -1
- package/commonjs/steps/getStepMinTime.test.js +1 -3
- package/commonjs/steps/getStepMinTime.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.js +19 -41
- package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.test.js +29 -25
- package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdateForUnit.js +3 -12
- package/commonjs/steps/getTimeToNextUpdateForUnit.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +1 -7
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/commonjs/steps/helpers.js +1 -2
- package/commonjs/steps/helpers.js.map +1 -1
- package/commonjs/steps/helpers.test.js +0 -1
- package/commonjs/steps/helpers.test.js.map +1 -1
- package/commonjs/steps/index.js +1 -6
- package/commonjs/steps/index.js.map +1 -1
- package/commonjs/steps/renameLegacyProperties.js +6 -14
- package/commonjs/steps/renameLegacyProperties.js.map +1 -1
- package/commonjs/steps/renameLegacyProperties.test.js +1 -3
- package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/steps/round.js +1 -2
- package/commonjs/steps/round.js.map +1 -1
- package/commonjs/steps/round.test.js +1 -7
- package/commonjs/steps/round.test.js.map +1 -1
- package/commonjs/steps/units.js +10 -21
- package/commonjs/steps/units.js.map +1 -1
- package/commonjs/style/approximate.js +2 -6
- package/commonjs/style/approximate.js.map +1 -1
- package/commonjs/style/approximateTime.js +2 -6
- package/commonjs/style/approximateTime.js.map +1 -1
- package/commonjs/style/approximateTime.test.js +116 -75
- package/commonjs/style/approximateTime.test.js.map +1 -1
- package/commonjs/style/getStyleByName.js +3 -29
- package/commonjs/style/getStyleByName.js.map +1 -1
- package/commonjs/style/mini.js +9 -6
- package/commonjs/style/mini.js.map +1 -1
- package/commonjs/style/mini.test.js +15 -25
- package/commonjs/style/mini.test.js.map +1 -1
- package/commonjs/style/miniMinute.js +8 -13
- package/commonjs/style/miniMinute.js.map +1 -1
- package/commonjs/style/miniMinute.test.js +11 -17
- package/commonjs/style/miniMinute.test.js.map +1 -1
- package/commonjs/style/miniMinuteNow.js +8 -13
- package/commonjs/style/miniMinuteNow.js.map +1 -1
- package/commonjs/style/miniMinuteNow.test.js +11 -17
- package/commonjs/style/miniMinuteNow.test.js.map +1 -1
- package/commonjs/style/miniNow.js +8 -13
- package/commonjs/style/miniNow.js.map +1 -1
- package/commonjs/style/miniNow.test.js +11 -17
- package/commonjs/style/miniNow.test.js.map +1 -1
- package/commonjs/style/renameLegacyProperties.js +7 -13
- package/commonjs/style/renameLegacyProperties.js.map +1 -1
- package/commonjs/style/renameLegacyProperties.test.js +1 -4
- package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/style/round.js +2 -6
- package/commonjs/style/round.js.map +1 -1
- package/commonjs/style/round.test.js +51 -67
- package/commonjs/style/round.test.js.map +1 -1
- package/commonjs/style/roundMinute.js +8 -13
- package/commonjs/style/roundMinute.js.map +1 -1
- package/commonjs/style/roundMinute.test.js +20 -27
- package/commonjs/style/roundMinute.test.js.map +1 -1
- package/commonjs/style/twitter.js +34 -38
- package/commonjs/style/twitter.js.map +1 -1
- package/commonjs/style/twitter.test.js +49 -55
- package/commonjs/style/twitter.test.js.map +1 -1
- package/commonjs/style/twitterFirstMinute.js +10 -15
- package/commonjs/style/twitterFirstMinute.js.map +1 -1
- package/commonjs/style/twitterFirstMinute.test.js +16 -23
- package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinute.js +8 -13
- package/commonjs/style/twitterMinute.js.map +1 -1
- package/commonjs/style/twitterMinute.test.js +20 -25
- package/commonjs/style/twitterMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinuteNow.js +8 -13
- package/commonjs/style/twitterMinuteNow.js.map +1 -1
- package/commonjs/style/twitterMinuteNow.test.js +20 -25
- package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
- package/commonjs/style/twitterNow.js +8 -13
- package/commonjs/style/twitterNow.js.map +1 -1
- package/commonjs/style/twitterNow.test.js +18 -24
- package/commonjs/style/twitterNow.test.js.map +1 -1
- package/load-all-locales/index.cjs +32 -0
- package/load-all-locales/index.cjs.js +32 -0
- package/load-all-locales/index.js +64 -0
- package/locale/ak/package.json +16 -0
- package/locale/ak.json +267 -0
- package/locale/ak.json.d.ts +4 -0
- package/locale/ak.json.js +267 -0
- package/locale/bal-Latn/package.json +16 -0
- package/locale/bal-Latn.json +240 -0
- package/locale/bal-Latn.json.d.ts +4 -0
- package/locale/bal-Latn.json.js +240 -0
- package/locale/be-tarask/package.json +16 -0
- package/locale/be-tarask.json +259 -0
- package/locale/be-tarask.json.d.ts +4 -0
- package/locale/be-tarask.json.js +259 -0
- package/locale/blo/package.json +16 -0
- package/locale/blo.json +159 -0
- package/locale/blo.json.d.ts +4 -0
- package/locale/blo.json.js +159 -0
- package/locale/bn.json +5 -2
- package/locale/bn.json.js +5 -2
- package/locale/bs.json +8 -2
- package/locale/bs.json.js +8 -2
- package/locale/ccp.json +2 -8
- package/locale/ccp.json.js +2 -8
- package/locale/csw/package.json +16 -0
- package/locale/csw.json +180 -0
- package/locale/csw.json.d.ts +4 -0
- package/locale/csw.json.js +180 -0
- package/locale/cy.json +6 -12
- package/locale/cy.json.js +6 -12
- package/locale/doi/package.json +16 -0
- package/locale/doi.json +159 -0
- package/locale/doi.json.d.ts +4 -0
- package/locale/doi.json.js +159 -0
- package/locale/en-AU.json +12 -12
- package/locale/en-AU.json.js +12 -12
- package/locale/en-CZ/package.json +16 -0
- package/locale/en-CZ.json +219 -0
- package/locale/en-CZ.json.d.ts +4 -0
- package/locale/en-CZ.json.js +219 -0
- package/locale/en-ES/package.json +16 -0
- package/locale/en-ES.json +219 -0
- package/locale/en-ES.json.d.ts +4 -0
- package/locale/en-ES.json.js +219 -0
- package/locale/en-FR/package.json +16 -0
- package/locale/en-FR.json +219 -0
- package/locale/en-FR.json.d.ts +4 -0
- package/locale/en-FR.json.js +219 -0
- package/locale/en-GS/package.json +16 -0
- package/locale/en-GS.json +219 -0
- package/locale/en-GS.json.d.ts +4 -0
- package/locale/en-GS.json.js +219 -0
- package/locale/en-HU/package.json +16 -0
- package/locale/en-HU.json +219 -0
- package/locale/en-HU.json.d.ts +4 -0
- package/locale/en-HU.json.js +219 -0
- package/locale/en-ID/package.json +16 -0
- package/locale/en-ID.json +219 -0
- package/locale/en-ID.json.d.ts +4 -0
- package/locale/en-ID.json.js +219 -0
- package/locale/en-IT/package.json +16 -0
- package/locale/en-IT.json +219 -0
- package/locale/en-IT.json.d.ts +4 -0
- package/locale/en-IT.json.js +219 -0
- package/locale/en-NO/package.json +16 -0
- package/locale/en-NO.json +219 -0
- package/locale/en-NO.json.d.ts +4 -0
- package/locale/en-NO.json.js +219 -0
- package/locale/en-PL/package.json +16 -0
- package/locale/en-PL.json +219 -0
- package/locale/en-PL.json.d.ts +4 -0
- package/locale/en-PL.json.js +219 -0
- package/locale/en-PT/package.json +16 -0
- package/locale/en-PT.json +219 -0
- package/locale/en-PT.json.d.ts +4 -0
- package/locale/en-PT.json.js +219 -0
- package/locale/en-RO/package.json +16 -0
- package/locale/en-RO.json +219 -0
- package/locale/en-RO.json.d.ts +4 -0
- package/locale/en-RO.json.js +219 -0
- package/locale/en-SK/package.json +16 -0
- package/locale/en-SK.json +219 -0
- package/locale/en-SK.json.d.ts +4 -0
- package/locale/en-SK.json.js +219 -0
- package/locale/es-MX.json +12 -9
- package/locale/es-MX.json.js +12 -9
- package/locale/es-SV.json +2 -2
- package/locale/es-SV.json.js +2 -2
- package/locale/eu.json +24 -24
- package/locale/eu.json.js +24 -24
- package/locale/ha.json +119 -65
- package/locale/ha.json.js +119 -65
- package/locale/he.json +0 -6
- package/locale/he.json.js +0 -6
- package/locale/hi-Latn.json +2 -2
- package/locale/hi-Latn.json.js +2 -2
- package/locale/ht/package.json +16 -0
- package/locale/ht.json +207 -0
- package/locale/ht.json.d.ts +4 -0
- package/locale/ht.json.js +207 -0
- package/locale/id.json +1 -1
- package/locale/id.json.js +1 -1
- package/locale/ie/package.json +16 -0
- package/locale/ie.json +159 -0
- package/locale/ie.json.d.ts +4 -0
- package/locale/ie.json.js +159 -0
- package/locale/ig.json +17 -17
- package/locale/ig.json.js +17 -17
- package/locale/ii/package.json +16 -0
- package/locale/ii.json +165 -0
- package/locale/ii.json.d.ts +4 -0
- package/locale/ii.json.js +165 -0
- package/locale/is.json +4 -1
- package/locale/is.json.js +4 -1
- package/locale/kaa/package.json +16 -0
- package/locale/kaa.json +159 -0
- package/locale/kaa.json.d.ts +4 -0
- package/locale/kaa.json.js +159 -0
- package/locale/kok-Latn/package.json +16 -0
- package/locale/kok-Latn.json +159 -0
- package/locale/kok-Latn.json.d.ts +4 -0
- package/locale/kok-Latn.json.js +159 -0
- package/locale/kok.json +8 -8
- package/locale/kok.json.js +8 -8
- package/locale/ks.json +9 -9
- package/locale/ks.json.js +9 -9
- package/locale/ku.json +55 -46
- package/locale/ku.json.js +55 -46
- package/locale/lld/package.json +16 -0
- package/locale/lld.json +291 -0
- package/locale/lld.json.d.ts +4 -0
- package/locale/lld.json.js +291 -0
- package/locale/mi.json +22 -22
- package/locale/mi.json.js +22 -22
- package/locale/ms-Arab/package.json +16 -0
- package/locale/ms-Arab.json +159 -0
- package/locale/ms-Arab.json.d.ts +4 -0
- package/locale/ms-Arab.json.js +159 -0
- package/locale/nb.json +2 -2
- package/locale/nb.json.js +2 -2
- package/locale/ne.json +1 -1
- package/locale/ne.json.js +1 -1
- package/locale/nn.json +4 -4
- package/locale/nn.json.js +4 -4
- package/locale/no.json +2 -2
- package/locale/no.json.js +2 -2
- package/locale/nqo/package.json +16 -0
- package/locale/nqo.json +159 -0
- package/locale/nqo.json.d.ts +4 -0
- package/locale/nqo.json.js +159 -0
- package/locale/om/package.json +16 -0
- package/locale/om.json +213 -0
- package/locale/om.json.d.ts +4 -0
- package/locale/om.json.js +213 -0
- package/locale/or.json +1 -1
- package/locale/or.json.js +1 -1
- package/locale/qu.json +46 -46
- package/locale/qu.json.js +46 -46
- package/locale/rhg/package.json +16 -0
- package/locale/rhg.json +159 -0
- package/locale/rhg.json.d.ts +4 -0
- package/locale/rhg.json.js +159 -0
- package/locale/sl.json +12 -12
- package/locale/sl.json.js +12 -12
- package/locale/sr-Cyrl-BA.json +2 -2
- package/locale/sr-Cyrl-BA.json.js +2 -2
- package/locale/sr-Latn-BA.json +2 -2
- package/locale/sr-Latn-BA.json.js +2 -2
- package/locale/sv.json +1 -1
- package/locale/sv.json.js +1 -1
- package/locale/syr/package.json +16 -0
- package/locale/syr.json +303 -0
- package/locale/syr.json.d.ts +4 -0
- package/locale/syr.json.js +303 -0
- package/locale/ti.json +6 -6
- package/locale/ti.json.js +6 -6
- package/locale/tn/package.json +16 -0
- package/locale/tn.json +159 -0
- package/locale/tn.json.d.ts +4 -0
- package/locale/tn.json.js +159 -0
- package/locale/to.json +26 -26
- package/locale/to.json.js +26 -26
- package/locale/uk.json +1 -1
- package/locale/uk.json.js +1 -1
- package/locale/ur-IN.json +9 -6
- package/locale/ur-IN.json.js +9 -6
- package/locale/vec/package.json +16 -0
- package/locale/vec.json +267 -0
- package/locale/vec.json.d.ts +4 -0
- package/locale/vec.json.js +267 -0
- package/locale/xnr/package.json +16 -0
- package/locale/xnr.json +159 -0
- package/locale/xnr.json.d.ts +4 -0
- package/locale/xnr.json.js +159 -0
- package/locale/yo-BJ.json +17 -17
- package/locale/yo-BJ.json.js +17 -17
- package/locale/yo.json +17 -17
- package/locale/yo.json.js +17 -17
- package/modules/LocaleDataStore.js +2 -3
- package/modules/LocaleDataStore.js.map +1 -1
- package/modules/PropTypes.js +11 -7
- package/modules/PropTypes.js.map +1 -1
- package/modules/TimeAgo.js +135 -174
- package/modules/TimeAgo.js.map +1 -1
- package/modules/TimeAgo.test.js +126 -115
- package/modules/TimeAgo.test.js.map +1 -1
- package/modules/cache.js +6 -22
- package/modules/cache.js.map +1 -1
- package/modules/cache.test.js.map +1 -1
- package/modules/isStyleObject.js +9 -7
- package/modules/isStyleObject.js.map +1 -1
- package/modules/isStyleObject.test.js.map +1 -1
- package/modules/locale.js +6 -16
- package/modules/locale.js.map +1 -1
- package/modules/locale.test.js +0 -4
- package/modules/locale.test.js.map +1 -1
- package/modules/round.js +2 -3
- package/modules/round.js.map +1 -1
- package/modules/steps/approximate.js +6 -2
- package/modules/steps/approximate.js.map +1 -1
- package/modules/steps/approximate.test.js +0 -2
- package/modules/steps/approximate.test.js.map +1 -1
- package/modules/steps/getStep.js +36 -48
- package/modules/steps/getStep.js.map +1 -1
- package/modules/steps/getStep.test.js +6 -2
- package/modules/steps/getStep.test.js.map +1 -1
- package/modules/steps/getStepDenominator.js +2 -3
- package/modules/steps/getStepDenominator.js.map +1 -1
- package/modules/steps/getStepDenominator.test.js.map +1 -1
- package/modules/steps/getStepMinTime.js +17 -29
- package/modules/steps/getStepMinTime.js.map +1 -1
- package/modules/steps/getStepMinTime.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.js +19 -31
- package/modules/steps/getTimeToNextUpdate.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.test.js +27 -18
- package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.js +4 -10
- package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.test.js +0 -4
- package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/modules/steps/helpers.js +1 -1
- package/modules/steps/helpers.js.map +1 -1
- package/modules/steps/helpers.test.js.map +1 -1
- package/modules/steps/index.js +2 -1
- package/modules/steps/index.js.map +1 -1
- package/modules/steps/renameLegacyProperties.js +6 -13
- package/modules/steps/renameLegacyProperties.js.map +1 -1
- package/modules/steps/renameLegacyProperties.test.js.map +1 -1
- package/modules/steps/round.js.map +1 -1
- package/modules/steps/round.test.js +0 -3
- package/modules/steps/round.test.js.map +1 -1
- package/modules/steps/units.js +5 -9
- package/modules/steps/units.js.map +1 -1
- package/modules/style/approximate.js +5 -1
- package/modules/style/approximate.js.map +1 -1
- package/modules/style/approximateTime.js +6 -2
- package/modules/style/approximateTime.js.map +1 -1
- package/modules/style/approximateTime.test.js +115 -70
- package/modules/style/approximateTime.test.js.map +1 -1
- package/modules/style/getStyleByName.js +4 -17
- package/modules/style/getStyleByName.js.map +1 -1
- package/modules/style/mini.js +8 -4
- package/modules/style/mini.js.map +1 -1
- package/modules/style/mini.test.js +14 -20
- package/modules/style/mini.test.js.map +1 -1
- package/modules/style/miniMinute.js +6 -6
- package/modules/style/miniMinute.js.map +1 -1
- package/modules/style/miniMinute.test.js +10 -12
- package/modules/style/miniMinute.test.js.map +1 -1
- package/modules/style/miniMinuteNow.js +6 -6
- package/modules/style/miniMinuteNow.js.map +1 -1
- package/modules/style/miniMinuteNow.test.js +10 -12
- package/modules/style/miniMinuteNow.test.js.map +1 -1
- package/modules/style/miniNow.js +6 -6
- package/modules/style/miniNow.js.map +1 -1
- package/modules/style/miniNow.test.js +10 -12
- package/modules/style/miniNow.test.js.map +1 -1
- package/modules/style/renameLegacyProperties.js +8 -10
- package/modules/style/renameLegacyProperties.js.map +1 -1
- package/modules/style/renameLegacyProperties.test.js +0 -1
- package/modules/style/renameLegacyProperties.test.js.map +1 -1
- package/modules/style/round.js +3 -2
- package/modules/style/round.js.map +1 -1
- package/modules/style/round.test.js +50 -62
- package/modules/style/round.test.js.map +1 -1
- package/modules/style/roundMinute.js +8 -7
- package/modules/style/roundMinute.js.map +1 -1
- package/modules/style/roundMinute.test.js +19 -22
- package/modules/style/roundMinute.test.js.map +1 -1
- package/modules/style/twitter.js +35 -32
- package/modules/style/twitter.js.map +1 -1
- package/modules/style/twitter.test.js +48 -50
- package/modules/style/twitter.test.js.map +1 -1
- package/modules/style/twitterFirstMinute.js +8 -7
- package/modules/style/twitterFirstMinute.js.map +1 -1
- package/modules/style/twitterFirstMinute.test.js +15 -18
- package/modules/style/twitterFirstMinute.test.js.map +1 -1
- package/modules/style/twitterMinute.js +6 -6
- package/modules/style/twitterMinute.js.map +1 -1
- package/modules/style/twitterMinute.test.js +19 -20
- package/modules/style/twitterMinute.test.js.map +1 -1
- package/modules/style/twitterMinuteNow.js +6 -6
- package/modules/style/twitterMinuteNow.js.map +1 -1
- package/modules/style/twitterMinuteNow.test.js +19 -20
- package/modules/style/twitterMinuteNow.test.js.map +1 -1
- package/modules/style/twitterNow.js +6 -6
- package/modules/style/twitterNow.js.map +1 -1
- package/modules/style/twitterNow.test.js +17 -19
- package/modules/style/twitterNow.test.js.map +1 -1
- package/package.json +261 -4
|
@@ -4,36 +4,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _index = require("../steps/index.js");
|
|
9
|
-
|
|
10
8
|
var _locale = require("../locale.js");
|
|
11
|
-
|
|
12
9
|
var _renameLegacyProperties = _interopRequireDefault(require("./renameLegacyProperties.js"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
11
|
// For compatibility with the old versions of this library.
|
|
12
|
+
|
|
17
13
|
// Twitter-style relative date/time formatting.
|
|
18
14
|
// ("1m", "2h", "Mar 3", "Apr 4, 2012").
|
|
19
15
|
//
|
|
20
16
|
// Seconds, minutes or hours are shown for shorter intervals,
|
|
21
17
|
// and longer intervals are formatted using full date format.
|
|
18
|
+
|
|
22
19
|
var steps = [{
|
|
23
20
|
formatAs: 'second'
|
|
24
21
|
}, {
|
|
25
22
|
formatAs: 'minute'
|
|
26
23
|
}, {
|
|
27
24
|
formatAs: 'hour'
|
|
28
|
-
}];
|
|
29
|
-
// for various locales (is a global variable).
|
|
25
|
+
}];
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
// A cache for `Intl.DateTimeFormat` formatters
|
|
28
|
+
// for various locales (is a global variable).
|
|
29
|
+
var formatters = {};
|
|
32
30
|
|
|
31
|
+
// Starting from day intervals, output month and day.
|
|
33
32
|
var monthAndDay = {
|
|
34
33
|
minTime: function minTime(timestamp, _ref) {
|
|
35
34
|
var future = _ref.future,
|
|
36
|
-
|
|
35
|
+
getMinTimeForUnit = _ref.getMinTimeForUnit;
|
|
37
36
|
// Returns `23.5 * 60 * 60` when `round` is "round",
|
|
38
37
|
// and `24 * 60 * 60` when `round` is "floor".
|
|
39
38
|
return getMinTimeForUnit('day');
|
|
@@ -44,27 +43,24 @@ var monthAndDay = {
|
|
|
44
43
|
formatters[locale] = {};
|
|
45
44
|
}
|
|
46
45
|
/* istanbul ignore else */
|
|
47
|
-
|
|
48
|
-
|
|
49
46
|
if (!formatters[locale].dayMonth) {
|
|
50
47
|
// "Apr 11" (MMMd)
|
|
51
48
|
formatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {
|
|
52
49
|
month: 'short',
|
|
53
50
|
day: 'numeric'
|
|
54
51
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
}
|
|
53
|
+
// Output month and day.
|
|
58
54
|
return formatters[locale].dayMonth.format((0, _index.getDate)(value));
|
|
59
55
|
}
|
|
60
|
-
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// If the `date` happened/happens outside of current year,
|
|
61
59
|
// then output day, month and year.
|
|
62
60
|
// The interval should be such that the `date` lies outside of the current year.
|
|
63
|
-
|
|
64
61
|
var yearMonthAndDay = {
|
|
65
62
|
minTime: function minTime(timestamp, _ref2) {
|
|
66
63
|
var future = _ref2.future;
|
|
67
|
-
|
|
68
64
|
if (future) {
|
|
69
65
|
// January 1, 00:00, of the `date`'s year is right after
|
|
70
66
|
// the maximum `now` for formatting a future date:
|
|
@@ -73,8 +69,8 @@ var yearMonthAndDay = {
|
|
|
73
69
|
// After that, it's hours, minutes, seconds, and after that it's no longer `future`.
|
|
74
70
|
// The date is right after the maximum `now` for formatting a future date,
|
|
75
71
|
// so subtract 1 millisecond from it.
|
|
76
|
-
var maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1;
|
|
77
|
-
|
|
72
|
+
var maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1;
|
|
73
|
+
// Return `minTime` (in seconds).
|
|
78
74
|
return (timestamp - maxFittingNow) / 1000;
|
|
79
75
|
} else {
|
|
80
76
|
// January 1, 00:00, of the year following the `date`'s year
|
|
@@ -82,8 +78,8 @@ var yearMonthAndDay = {
|
|
|
82
78
|
// When `now` is before that date, the `date` is formatted as "day/month" (another step),
|
|
83
79
|
// When `now` is equal to or after that date, the `date` is formatted as "day/month/year" (this step).
|
|
84
80
|
// After that, it's hours, minutes, seconds, and after that it's no longer `future`.
|
|
85
|
-
var minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime();
|
|
86
|
-
|
|
81
|
+
var minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime();
|
|
82
|
+
// Return `minTime` (in seconds).
|
|
87
83
|
return (minFittingNow - timestamp) / 1000;
|
|
88
84
|
}
|
|
89
85
|
},
|
|
@@ -93,8 +89,6 @@ var yearMonthAndDay = {
|
|
|
93
89
|
formatters[locale] = {};
|
|
94
90
|
}
|
|
95
91
|
/* istanbul ignore else */
|
|
96
|
-
|
|
97
|
-
|
|
98
92
|
if (!formatters[locale].dayMonthYear) {
|
|
99
93
|
// "Apr 11, 2017" (yMMMd)
|
|
100
94
|
formatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {
|
|
@@ -102,19 +96,19 @@ var yearMonthAndDay = {
|
|
|
102
96
|
month: 'short',
|
|
103
97
|
day: 'numeric'
|
|
104
98
|
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
}
|
|
100
|
+
// Output day, month and year.
|
|
108
101
|
return formatters[locale].dayMonthYear.format((0, _index.getDate)(value));
|
|
109
102
|
}
|
|
110
|
-
};
|
|
111
|
-
// then longer time intervals will be formatted as dates.
|
|
103
|
+
};
|
|
112
104
|
|
|
105
|
+
// If `Intl.DateTimeFormat` is supported,
|
|
106
|
+
// then longer time intervals will be formatted as dates.
|
|
113
107
|
/* istanbul ignore else */
|
|
114
|
-
|
|
115
108
|
if ((0, _locale.intlDateTimeFormatSupported)()) {
|
|
116
109
|
steps.push(monthAndDay, yearMonthAndDay);
|
|
117
|
-
}
|
|
110
|
+
}
|
|
111
|
+
// Otherwise, if `Intl.DateTimeFormat` is not supported,
|
|
118
112
|
// which could be the case when using Internet Explorer,
|
|
119
113
|
// then simply mimick "round" steps.
|
|
120
114
|
else {
|
|
@@ -128,20 +122,22 @@ else {
|
|
|
128
122
|
formatAs: 'year'
|
|
129
123
|
});
|
|
130
124
|
}
|
|
131
|
-
|
|
132
|
-
var _default = {
|
|
125
|
+
var _default = exports["default"] = {
|
|
133
126
|
steps: steps,
|
|
134
|
-
labels: [
|
|
135
|
-
|
|
136
|
-
'
|
|
127
|
+
labels: [
|
|
128
|
+
// "mini" labels are only defined for a few languages.
|
|
129
|
+
'mini',
|
|
130
|
+
// "short-time" labels are only defined for a few languages.
|
|
131
|
+
'short-time',
|
|
132
|
+
// "narrow" and "short" labels are defined for all languages.
|
|
137
133
|
// "narrow" labels can sometimes be weird (like "+5d."),
|
|
138
134
|
// but "short" labels have the " ago" part, so "narrow" seem
|
|
139
135
|
// more appropriate.
|
|
140
136
|
// "short" labels would have been more appropriate if they
|
|
141
137
|
// didn't have the " ago" part, hence the "short-time" above.
|
|
142
|
-
'narrow',
|
|
138
|
+
'narrow',
|
|
139
|
+
// Since "narrow" labels are always present, "short" element
|
|
143
140
|
// of this array can be removed.
|
|
144
141
|
'short']
|
|
145
142
|
};
|
|
146
|
-
exports["default"] = _default;
|
|
147
143
|
//# sourceMappingURL=twitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitter.js","names":["steps","formatAs","formatters","monthAndDay","minTime","timestamp","future","getMinTimeForUnit","format","value","locale","dayMonth","Intl","DateTimeFormat","month","day","getDate","yearMonthAndDay","maxFittingNow","Date","getFullYear","getTime","minFittingNow","dayMonthYear","year","intlDateTimeFormatSupported","push","labels"],"sources":["../../source/style/twitter.js"],"sourcesContent":["import { day, getDate } from '../steps/index.js'\r\nimport { intlDateTimeFormatSupported } from '../locale.js'\r\n\r\n// For compatibility with the old versions of this library.\r\nimport renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\n// Twitter-style relative date/time formatting.\r\n// (\"1m\", \"2h\", \"Mar 3\", \"Apr 4, 2012\").\r\n//\r\n// Seconds, minutes or hours are shown for shorter intervals,\r\n// and longer intervals are formatted using full date format.\r\n\r\nconst steps = [\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]\r\n\r\n// A cache for `Intl.DateTimeFormat` formatters\r\n// for various locales (is a global variable).\r\nconst formatters = {}\r\n\r\n// Starting from day intervals, output month and day.\r\nconst monthAndDay = {\r\n\tminTime(timestamp, { future, getMinTimeForUnit }) {\r\n\t\t// Returns `23.5 * 60 * 60` when `round` is \"round\",\r\n\t\t// and `24 * 60 * 60` when `round` is \"floor\".\r\n\t\treturn getMinTimeForUnit('day')\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonth) {\r\n\t\t\t// \"Apr 11\" (MMMd)\r\n\t\t\tformatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output month and day.\r\n\t\treturn formatters[locale].dayMonth.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If the `date` happened/happens outside of current year,\r\n// then output day, month and year.\r\n// The interval should be such that the `date` lies outside of the current year.\r\nconst yearMonthAndDay = {\r\n\tminTime(timestamp, { future }) {\r\n\t\tif (future) {\r\n\t\t\t// January 1, 00:00, of the `date`'s year is right after\r\n\t\t\t// the maximum `now` for formatting a future date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month/year\" (this step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month\" (another step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\t// The date is right after the maximum `now` for formatting a future date,\r\n\t\t\t// so subtract 1 millisecond from it.\r\n\t\t\tconst maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (timestamp - maxFittingNow) / 1000\r\n\t\t} else {\r\n\t\t\t// January 1, 00:00, of the year following the `date`'s year\r\n\t\t\t// is the minimum `now` for formatting a past date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month\" (another step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month/year\" (this step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\tconst minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime()\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (minFittingNow - timestamp) / 1000\r\n\t\t}\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore if */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonthYear) {\r\n\t\t\t// \"Apr 11, 2017\" (yMMMd)\r\n\t\t\tformatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tyear: 'numeric',\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output day, month and year.\r\n\t\treturn formatters[locale].dayMonthYear.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If `Intl.DateTimeFormat` is supported,\r\n// then longer time intervals will be formatted as dates.\r\n/* istanbul ignore else */\r\nif (intlDateTimeFormatSupported()) {\r\n\tsteps.push(monthAndDay, yearMonthAndDay)\r\n}\r\n// Otherwise, if `Intl.DateTimeFormat` is not supported,\r\n// which could be the case when using Internet Explorer,\r\n// then simply mimick \"round\" steps.\r\nelse {\r\n\tsteps.push(\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'week'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t)\r\n}\r\n\r\nexport default {\r\n\tsteps,\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}"],"mappings":"
|
|
1
|
+
{"version":3,"file":"twitter.js","names":["_index","require","_locale","_renameLegacyProperties","_interopRequireDefault","e","__esModule","steps","formatAs","formatters","monthAndDay","minTime","timestamp","_ref","future","getMinTimeForUnit","format","value","locale","dayMonth","Intl","DateTimeFormat","month","day","getDate","yearMonthAndDay","_ref2","maxFittingNow","Date","getFullYear","getTime","minFittingNow","dayMonthYear","year","intlDateTimeFormatSupported","push","_default","exports","labels"],"sources":["../../source/style/twitter.js"],"sourcesContent":["import { day, getDate } from '../steps/index.js'\r\nimport { intlDateTimeFormatSupported } from '../locale.js'\r\n\r\n// For compatibility with the old versions of this library.\r\nimport renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\n// Twitter-style relative date/time formatting.\r\n// (\"1m\", \"2h\", \"Mar 3\", \"Apr 4, 2012\").\r\n//\r\n// Seconds, minutes or hours are shown for shorter intervals,\r\n// and longer intervals are formatted using full date format.\r\n\r\nconst steps = [\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]\r\n\r\n// A cache for `Intl.DateTimeFormat` formatters\r\n// for various locales (is a global variable).\r\nconst formatters = {}\r\n\r\n// Starting from day intervals, output month and day.\r\nconst monthAndDay = {\r\n\tminTime(timestamp, { future, getMinTimeForUnit }) {\r\n\t\t// Returns `23.5 * 60 * 60` when `round` is \"round\",\r\n\t\t// and `24 * 60 * 60` when `round` is \"floor\".\r\n\t\treturn getMinTimeForUnit('day')\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonth) {\r\n\t\t\t// \"Apr 11\" (MMMd)\r\n\t\t\tformatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output month and day.\r\n\t\treturn formatters[locale].dayMonth.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If the `date` happened/happens outside of current year,\r\n// then output day, month and year.\r\n// The interval should be such that the `date` lies outside of the current year.\r\nconst yearMonthAndDay = {\r\n\tminTime(timestamp, { future }) {\r\n\t\tif (future) {\r\n\t\t\t// January 1, 00:00, of the `date`'s year is right after\r\n\t\t\t// the maximum `now` for formatting a future date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month/year\" (this step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month\" (another step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\t// The date is right after the maximum `now` for formatting a future date,\r\n\t\t\t// so subtract 1 millisecond from it.\r\n\t\t\tconst maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (timestamp - maxFittingNow) / 1000\r\n\t\t} else {\r\n\t\t\t// January 1, 00:00, of the year following the `date`'s year\r\n\t\t\t// is the minimum `now` for formatting a past date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month\" (another step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month/year\" (this step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\tconst minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime()\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (minFittingNow - timestamp) / 1000\r\n\t\t}\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore if */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonthYear) {\r\n\t\t\t// \"Apr 11, 2017\" (yMMMd)\r\n\t\t\tformatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tyear: 'numeric',\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output day, month and year.\r\n\t\treturn formatters[locale].dayMonthYear.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If `Intl.DateTimeFormat` is supported,\r\n// then longer time intervals will be formatted as dates.\r\n/* istanbul ignore else */\r\nif (intlDateTimeFormatSupported()) {\r\n\tsteps.push(monthAndDay, yearMonthAndDay)\r\n}\r\n// Otherwise, if `Intl.DateTimeFormat` is not supported,\r\n// which could be the case when using Internet Explorer,\r\n// then simply mimick \"round\" steps.\r\nelse {\r\n\tsteps.push(\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'week'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t)\r\n}\r\n\r\nexport default {\r\n\tsteps,\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AADhE;;AAGA;AACA;AACA;AACA;AACA;;AAEA,IAAME,KAAK,GAAG,CACb;EACCC,QAAQ,EAAE;AACX,CAA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AA,cAEc;EACd9B,KAAK,EAALA,KAAK;EACL+B,MAAM,EAAE;EACP;EACA,MAAM;EACN;EACA,YAAY;EACZ;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,OAAO;AAET,CAAC","ignoreList":[]}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _twitter = _interopRequireDefault(require("./twitter.js"));
|
|
4
|
-
|
|
5
4
|
var _TimeAgo = _interopRequireDefault(require("../TimeAgo.js"));
|
|
6
|
-
|
|
7
5
|
var _index = require("../steps/index.js");
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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); }
|
|
17
13
|
describe('style/twitter', function () {
|
|
18
14
|
it('should fallback from "mini" to "narrow"', function () {
|
|
19
15
|
var timeAgo = new _TimeAgo["default"]('ccp');
|
|
@@ -21,30 +17,27 @@ describe('style/twitter', function () {
|
|
|
21
17
|
});
|
|
22
18
|
it('should format Twitter style relative time (English) (round: "round")', function () {
|
|
23
19
|
var timeAgo = new _TimeAgo["default"]('en');
|
|
24
|
-
|
|
25
20
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
26
21
|
return timeAgo.format(-secondsPassed * 1000, _objectSpread({
|
|
27
22
|
now: 0
|
|
28
23
|
}, _twitter["default"]));
|
|
29
24
|
};
|
|
30
|
-
|
|
31
25
|
formatDatePastBy(0.49).should.equal('0s');
|
|
32
26
|
formatDatePastBy(0.5).should.equal('1s');
|
|
33
27
|
formatDatePastBy(59.49).should.equal('59s');
|
|
34
28
|
formatDatePastBy(59.5).should.equal('1m');
|
|
35
29
|
formatDatePastBy(1.49 * _index.minute).should.equal('1m');
|
|
36
|
-
formatDatePastBy(1.5 * _index.minute).should.equal('2m');
|
|
37
|
-
|
|
30
|
+
formatDatePastBy(1.5 * _index.minute).should.equal('2m');
|
|
31
|
+
// โฆ
|
|
38
32
|
formatDatePastBy(59.49 * _index.minute).should.equal('59m');
|
|
39
33
|
formatDatePastBy(59.5 * _index.minute).should.equal('1h');
|
|
40
34
|
formatDatePastBy(1.49 * _index.hour).should.equal('1h');
|
|
41
|
-
formatDatePastBy(1.5 * _index.hour).should.equal('2h');
|
|
42
|
-
|
|
35
|
+
formatDatePastBy(1.5 * _index.hour).should.equal('2h');
|
|
36
|
+
// โฆ
|
|
43
37
|
formatDatePastBy(23.49 * _index.hour).should.equal('23h');
|
|
44
38
|
});
|
|
45
39
|
it('should format Twitter style relative time (English) (round: "floor")', function () {
|
|
46
40
|
var timeAgo = new _TimeAgo["default"]('en');
|
|
47
|
-
|
|
48
41
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
49
42
|
return timeAgo.format(-secondsPassed * 1000, _objectSpread(_objectSpread({
|
|
50
43
|
now: 0
|
|
@@ -52,7 +45,6 @@ describe('style/twitter', function () {
|
|
|
52
45
|
round: 'floor'
|
|
53
46
|
}));
|
|
54
47
|
};
|
|
55
|
-
|
|
56
48
|
formatDatePastBy(0).should.equal('0s');
|
|
57
49
|
formatDatePastBy(0.9).should.equal('0s');
|
|
58
50
|
formatDatePastBy(1).should.equal('1s');
|
|
@@ -61,49 +53,47 @@ describe('style/twitter', function () {
|
|
|
61
53
|
formatDatePastBy(1.9 * _index.minute).should.equal('1m');
|
|
62
54
|
formatDatePastBy(2 * _index.minute).should.equal('2m');
|
|
63
55
|
formatDatePastBy(2.9 * _index.minute).should.equal('2m');
|
|
64
|
-
formatDatePastBy(3 * _index.minute).should.equal('3m');
|
|
65
|
-
|
|
56
|
+
formatDatePastBy(3 * _index.minute).should.equal('3m');
|
|
57
|
+
// โฆ
|
|
66
58
|
formatDatePastBy(59.9 * _index.minute).should.equal('59m');
|
|
67
59
|
formatDatePastBy(60 * _index.minute).should.equal('1h');
|
|
68
60
|
formatDatePastBy(1.9 * _index.hour).should.equal('1h');
|
|
69
61
|
formatDatePastBy(2 * _index.hour).should.equal('2h');
|
|
70
62
|
formatDatePastBy(2.9 * _index.hour).should.equal('2h');
|
|
71
|
-
formatDatePastBy(3 * _index.hour).should.equal('3h');
|
|
72
|
-
|
|
63
|
+
formatDatePastBy(3 * _index.hour).should.equal('3h');
|
|
64
|
+
// โฆ
|
|
73
65
|
formatDatePastBy(23.9 * _index.hour).should.equal('23h');
|
|
74
66
|
});
|
|
75
67
|
it('should format Twitter style relative time (English) (absolute dates)', function () {
|
|
76
|
-
var timeAgo = new _TimeAgo["default"]('en');
|
|
68
|
+
var timeAgo = new _TimeAgo["default"]('en');
|
|
77
69
|
|
|
70
|
+
// April 10th, 2016, 12:00.
|
|
78
71
|
var now = new Date(2016, 3, 10, 12, 0).getTime();
|
|
79
|
-
|
|
80
72
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
81
73
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
82
74
|
now: now
|
|
83
75
|
}, _twitter["default"]));
|
|
84
76
|
};
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
formatDatePastBy(_index.day + 2 * _index.minute + _index.hour).should.equal('Apr 9');
|
|
78
|
+
// โฆ
|
|
87
79
|
// `month` is about 30.5 days.
|
|
88
|
-
|
|
89
80
|
formatDatePastBy(_index.month * 3).should.equal('Jan 10');
|
|
90
81
|
formatDatePastBy(_index.month * 4).should.equal('Dec 10, 2015');
|
|
91
|
-
formatDatePastBy(_index.year).should.equal('Apr 11, 2015');
|
|
92
|
-
// `month` is about 30.5 days.
|
|
82
|
+
formatDatePastBy(_index.year).should.equal('Apr 11, 2015');
|
|
93
83
|
|
|
84
|
+
// Test future dates.
|
|
85
|
+
// `month` is about 30.5 days.
|
|
94
86
|
formatDatePastBy(-1 * _index.month * 8).should.equal('Dec 10');
|
|
95
87
|
formatDatePastBy(-1 * _index.month * 9).should.equal('Jan 9, 2017');
|
|
96
88
|
});
|
|
97
89
|
it('should format Twitter style relative time (Russian)', function () {
|
|
98
90
|
var timeAgo = new _TimeAgo["default"]('ru');
|
|
99
91
|
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
|
100
|
-
|
|
101
92
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
102
93
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
103
94
|
now: now
|
|
104
95
|
}, _twitter["default"]));
|
|
105
96
|
};
|
|
106
|
-
|
|
107
97
|
formatDatePastBy(0).should.equal('0 ั');
|
|
108
98
|
formatDatePastBy(1).should.equal('1 ั');
|
|
109
99
|
formatDatePastBy(_index.minute).should.equal('1 ะผะธะฝ');
|
|
@@ -114,13 +104,11 @@ describe('style/twitter', function () {
|
|
|
114
104
|
it('should format Twitter style relative time (Korean)', function () {
|
|
115
105
|
var timeAgo = new _TimeAgo["default"]('ko');
|
|
116
106
|
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
|
117
|
-
|
|
118
107
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
119
108
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
120
109
|
now: now
|
|
121
110
|
}, _twitter["default"]));
|
|
122
111
|
};
|
|
123
|
-
|
|
124
112
|
formatDatePastBy(_index.minute).should.equal('1๋ถ');
|
|
125
113
|
formatDatePastBy(_index.hour).should.equal('1์๊ฐ');
|
|
126
114
|
formatDatePastBy(_index.day + 62 * _index.minute).should.equal('4์ 9์ผ');
|
|
@@ -129,13 +117,11 @@ describe('style/twitter', function () {
|
|
|
129
117
|
it('should format Twitter style relative time (German)', function () {
|
|
130
118
|
var timeAgo = new _TimeAgo["default"]('de');
|
|
131
119
|
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
|
132
|
-
|
|
133
120
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
134
121
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
135
122
|
now: now
|
|
136
123
|
}, _twitter["default"]));
|
|
137
124
|
};
|
|
138
|
-
|
|
139
125
|
formatDatePastBy(_index.minute).should.equal('1 Min.');
|
|
140
126
|
formatDatePastBy(_index.hour).should.equal('1 Std.');
|
|
141
127
|
formatDatePastBy(_index.day + 62 * _index.minute).should.equal('9. Apr.');
|
|
@@ -144,13 +130,11 @@ describe('style/twitter', function () {
|
|
|
144
130
|
it('should format Twitter style relative time (French)', function () {
|
|
145
131
|
var timeAgo = new _TimeAgo["default"]('fr');
|
|
146
132
|
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
|
147
|
-
|
|
148
133
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
149
134
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
150
135
|
now: now
|
|
151
136
|
}, _twitter["default"]));
|
|
152
137
|
};
|
|
153
|
-
|
|
154
138
|
formatDatePastBy(_index.minute).should.equal('1 min.');
|
|
155
139
|
formatDatePastBy(_index.hour).should.equal('1 h');
|
|
156
140
|
formatDatePastBy(_index.day + 62 * _index.minute).should.equal('9 avr.');
|
|
@@ -159,18 +143,18 @@ describe('style/twitter', function () {
|
|
|
159
143
|
it('should format Twitter style relative time (Chinese)', function () {
|
|
160
144
|
var timeAgo = new _TimeAgo["default"]('zh');
|
|
161
145
|
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
|
162
|
-
|
|
163
146
|
var formatDatePastBy = function formatDatePastBy(secondsPassed) {
|
|
164
147
|
return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
|
|
165
148
|
now: now
|
|
166
149
|
}, _twitter["default"]));
|
|
167
150
|
};
|
|
168
|
-
|
|
169
151
|
formatDatePastBy(_index.minute).should.equal('1ๅ้');
|
|
170
152
|
formatDatePastBy(_index.hour).should.equal('1ๅฐๆถ');
|
|
171
153
|
formatDatePastBy(_index.day + 62 * _index.minute).should.equal('4ๆ9ๆฅ');
|
|
172
154
|
formatDatePastBy(_index.year).should.equal('2015ๅนด4ๆ11ๆฅ');
|
|
173
|
-
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// This test won't pass because `Intl.DateTimeFormat` is read at
|
|
174
158
|
// initialization time, not at run time.
|
|
175
159
|
// it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {
|
|
176
160
|
// const DateTimeFormat = Intl.DateTimeFormat
|
|
@@ -188,14 +172,12 @@ describe('style/twitter', function () {
|
|
|
188
172
|
});
|
|
189
173
|
it('should round as "floor"', function () {
|
|
190
174
|
var timeAgo = new _TimeAgo["default"]('en');
|
|
191
|
-
|
|
192
175
|
var test = function test(time, result) {
|
|
193
176
|
return timeAgo.format(time, 'twitter', {
|
|
194
177
|
round: 'floor',
|
|
195
178
|
now: 0
|
|
196
179
|
}).should.equal(result);
|
|
197
180
|
};
|
|
198
|
-
|
|
199
181
|
test(2001, '2s');
|
|
200
182
|
test(2000, '2s');
|
|
201
183
|
test(1999, '1s');
|
|
@@ -211,51 +193,63 @@ describe('style/twitter', function () {
|
|
|
211
193
|
test(-2001, '2s');
|
|
212
194
|
});
|
|
213
195
|
it('should get time to next update (round: "floor")', function () {
|
|
214
|
-
var timeAgo = new _TimeAgo["default"]('en');
|
|
196
|
+
var timeAgo = new _TimeAgo["default"]('en');
|
|
215
197
|
|
|
216
|
-
|
|
198
|
+
// April 10th, 2018, 12:00.
|
|
199
|
+
var date = new Date(2018, 3, 10, 12, 0);
|
|
217
200
|
|
|
201
|
+
// April 10th, 2016, 12:00 (two years earlier).
|
|
218
202
|
var now = new Date(2016, 3, 10, 12, 0).getTime();
|
|
219
203
|
timeAgo.format(date, 'twitter', {
|
|
220
204
|
now: now,
|
|
221
205
|
getTimeToNextUpdate: true
|
|
222
|
-
}).should.deep.equal(['Apr 10, 2018',
|
|
223
|
-
|
|
206
|
+
}).should.deep.equal(['Apr 10, 2018',
|
|
207
|
+
// Updates on Jan 1st, 2018, 00:00.
|
|
208
|
+
new Date(2018, 0, 1).getTime() - now]);
|
|
224
209
|
|
|
210
|
+
// 1st, 2018, 00:00.
|
|
225
211
|
now = new Date(2018, 0, 1).getTime();
|
|
226
212
|
timeAgo.format(date, 'twitter', {
|
|
227
213
|
now: now,
|
|
228
214
|
getTimeToNextUpdate: true,
|
|
229
215
|
round: 'floor'
|
|
230
|
-
}).should.deep.equal(['Apr 10',
|
|
231
|
-
|
|
216
|
+
}).should.deep.equal(['Apr 10',
|
|
217
|
+
// Updates after April 9th, 2018, 12:00.
|
|
218
|
+
new Date(2018, 3, 9, 12, 0).getTime() + 1 - now]);
|
|
232
219
|
|
|
220
|
+
// After April 9th, 2018, 12:00.
|
|
233
221
|
now = new Date(2018, 3, 9, 12, 0).getTime() + 1;
|
|
234
222
|
timeAgo.format(date, 'twitter', {
|
|
235
223
|
now: now,
|
|
236
224
|
getTimeToNextUpdate: true,
|
|
237
225
|
round: 'floor'
|
|
238
|
-
}).should.deep.equal(['23h',
|
|
226
|
+
}).should.deep.equal(['23h',
|
|
227
|
+
// Updates in an hour.
|
|
239
228
|
60 * 60 * 1000]);
|
|
240
229
|
});
|
|
241
230
|
it('should get time to next update (round: "round")', function () {
|
|
242
|
-
var timeAgo = new _TimeAgo["default"]('en');
|
|
231
|
+
var timeAgo = new _TimeAgo["default"]('en');
|
|
243
232
|
|
|
233
|
+
// April 10th, 2018, 12:00.
|
|
244
234
|
var date = new Date(2018, 3, 10, 12, 0);
|
|
245
|
-
var now;
|
|
235
|
+
var now;
|
|
246
236
|
|
|
237
|
+
// 1st, 2018, 00:00.
|
|
247
238
|
now = new Date(2018, 0, 1).getTime();
|
|
248
239
|
timeAgo.format(date, 'twitter', {
|
|
249
240
|
now: now,
|
|
250
241
|
getTimeToNextUpdate: true
|
|
251
|
-
}).should.deep.equal(['Apr 10',
|
|
252
|
-
|
|
242
|
+
}).should.deep.equal(['Apr 10',
|
|
243
|
+
// Updates after April 9th, 2018, 11:30.
|
|
244
|
+
new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1 - now]);
|
|
253
245
|
|
|
246
|
+
// After April 9th, 2018, 12:00.
|
|
254
247
|
now = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1;
|
|
255
248
|
timeAgo.format(date, 'twitter', {
|
|
256
249
|
now: now,
|
|
257
250
|
getTimeToNextUpdate: true
|
|
258
|
-
}).should.deep.equal(['23h',
|
|
251
|
+
}).should.deep.equal(['23h',
|
|
252
|
+
// Updates in an hour.
|
|
259
253
|
60 * 60 * 1000]);
|
|
260
254
|
});
|
|
261
255
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitter.test.js","names":["describe","it","timeAgo","TimeAgo","format","Date","now","hour","should","include","formatDatePastBy","secondsPassed","twitter","equal","minute","round","getTime","day","month","year","test","time","result","date","getTimeToNextUpdate","deep"],"sources":["../../source/style/twitter.test.js"],"sourcesContent":["import twitter from './twitter.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitter', () => {\r\n\tit('should fallback from \"mini\" to \"narrow\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('ccp')\r\n\t\ttimeAgo.format(Date.now() - 3 * hour * 1000, 'twitter').should.include(' ๐๐ฎ๐๐ด๐ ๐๐๐ฌ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter })\r\n\r\n\t\tformatDatePastBy(0.49).should.equal('0s')\r\n\t\tformatDatePastBy(0.5).should.equal('1s')\r\n\t\tformatDatePastBy(59.49).should.equal('59s')\r\n\t\tformatDatePastBy(59.5).should.equal('1m')\r\n\t\tformatDatePastBy(1.49 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(1.5 * minute).should.equal('2m')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(59.49 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(59.5 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.49 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(1.5 * hour).should.equal('2h')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(23.49 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter, round: 'floor' })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0s')\r\n\t\tformatDatePastBy(0.9).should.equal('0s')\r\n\t\tformatDatePastBy(1).should.equal('1s')\r\n\t\tformatDatePastBy(59.9).should.equal('59s')\r\n\t\tformatDatePastBy(60).should.equal('1m')\r\n\t\tformatDatePastBy(1.9 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(2 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(2.9 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(3 * minute).should.equal('3m')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(59.9 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(60 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.9 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(2 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(2.9 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(3 * hour).should.equal('3h')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(23.9 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (absolute dates)', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016, 12:00.\r\n\t\tconst now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9')\r\n\t\t// โฆ\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(month * 3).should.equal('Jan 10')\r\n\t\tformatDatePastBy(month * 4).should.equal('Dec 10, 2015')\r\n\t\tformatDatePastBy(year).should.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(-1 * month * 8).should.equal('Dec 10')\r\n\t\tformatDatePastBy(-1 * month * 9).should.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Russian)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ru')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0 ั')\r\n\t\tformatDatePastBy(1).should.equal('1 ั')\r\n\t\tformatDatePastBy(minute).should.equal('1 ะผะธะฝ')\r\n\t\tformatDatePastBy(hour).should.equal('1 ั')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 ะฐะฟั.')\r\n\t\tformatDatePastBy(year).should.equal('11 ะฐะฟั. 2015 ะณ.')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Korean)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ko')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1๋ถ')\r\n\t\tformatDatePastBy(hour).should.equal('1์๊ฐ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4์ 9์ผ')\r\n\t\tformatDatePastBy(year).should.equal('2015๋
4์ 11์ผ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (German)', () => {\r\n\t\tconst timeAgo = new TimeAgo('de')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 Min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 Std.')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9. Apr.')\r\n\t\tformatDatePastBy(year).should.equal('11. Apr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (French)', () => {\r\n\t\tconst timeAgo = new TimeAgo('fr')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 h')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 avr.')\r\n\t\tformatDatePastBy(year).should.equal('11 avr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Chinese)', () => {\r\n\t\tconst timeAgo = new TimeAgo('zh')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1ๅ้')\r\n\t\tformatDatePastBy(hour).should.equal('1ๅฐๆถ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4ๆ9ๆฅ')\r\n\t\tformatDatePastBy(year).should.equal('2015ๅนด4ๆ11ๆฅ')\r\n\t})\r\n\r\n\t// This test won't pass because `Intl.DateTimeFormat` is read at\r\n\t// initialization time, not at run time.\r\n\t// it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {\r\n\t// \tconst DateTimeFormat = Intl.DateTimeFormat\r\n\t// \tIntl.DateTimeFormat = undefined\r\n\t//\r\n\t// \tconst timeAgo = new TimeAgo('en')\r\n\t// \ttimeAgo.format(Date.now() - 365 * 24 * hour * 1000, 'twitter').should.equal('1yr')\r\n\t//\r\n\t// \tIntl.DateTimeFormat = DateTimeFormat\r\n\t// })\r\n\r\n\tit('should support timestamp argument on `yearMonthAndDay.test()`', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\ttimeAgo.format(0, 'twitter').should.equal('Jan 1, 1970')\r\n\t})\r\n\r\n\tit('should round as \"floor\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\tconst test = (time, result) => timeAgo.format(time, 'twitter', {\r\n\t\t\tround: 'floor',\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(result)\r\n\t\ttest(2001, '2s')\r\n\t\ttest(2000, '2s')\r\n\t\ttest(1999, '1s')\r\n\t\ttest(1001, '1s')\r\n\t\ttest(1000, '1s')\r\n\t\ttest(999, '0s')\r\n\t\ttest(0, '0s')\r\n\t\ttest(-999, '0s')\r\n\t\ttest(-1000, '1s')\r\n\t\ttest(-1001, '1s')\r\n\t\ttest(-1999, '1s')\r\n\t\ttest(-2000, '2s')\r\n\t\ttest(-2001, '2s')\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\t// April 10th, 2016, 12:00 (two years earlier).\r\n\t\tlet now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10, 2018',\r\n\t\t\t// Updates on Jan 1st, 2018, 00:00.\r\n\t\t\tnew Date(2018, 0, 1).getTime() - now\r\n\t\t])\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 12:00.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\tlet now\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 11:30.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tget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EAGC;MACCjB,GAAG,EAAHA,GADD;MAECkB,mBAAmB,EAAE;IAFtB,CAHD,EAOEhB,MAPF,CAOSiB,IAPT,CAOcZ,KAPd,CAOoB,CACnB,KADmB,EAEnB;IACA,KAAK,EAAL,GAAU,IAHS,CAPpB;EAYA,CAvCC,CAAF;AAwCA,CA5QO,CAAR"}
|
|
1
|
+
{"version":3,"file":"twitter.test.js","names":["_twitter","_interopRequireDefault","require","_TimeAgo","_index","e","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","r","t","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","toPrimitive","call","TypeError","String","Number","describe","it","timeAgo","TimeAgo","format","Date","now","hour","should","include","formatDatePastBy","secondsPassed","twitter","equal","minute","round","getTime","day","month","year","test","time","result","date","getTimeToNextUpdate","deep"],"sources":["../../source/style/twitter.test.js"],"sourcesContent":["import twitter from './twitter.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitter', () => {\r\n\tit('should fallback from \"mini\" to \"narrow\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('ccp')\r\n\t\ttimeAgo.format(Date.now() - 3 * hour * 1000, 'twitter').should.include(' ๐๐ฎ๐๐ด๐ ๐๐๐ฌ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter })\r\n\r\n\t\tformatDatePastBy(0.49).should.equal('0s')\r\n\t\tformatDatePastBy(0.5).should.equal('1s')\r\n\t\tformatDatePastBy(59.49).should.equal('59s')\r\n\t\tformatDatePastBy(59.5).should.equal('1m')\r\n\t\tformatDatePastBy(1.49 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(1.5 * minute).should.equal('2m')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(59.49 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(59.5 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.49 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(1.5 * hour).should.equal('2h')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(23.49 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter, round: 'floor' })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0s')\r\n\t\tformatDatePastBy(0.9).should.equal('0s')\r\n\t\tformatDatePastBy(1).should.equal('1s')\r\n\t\tformatDatePastBy(59.9).should.equal('59s')\r\n\t\tformatDatePastBy(60).should.equal('1m')\r\n\t\tformatDatePastBy(1.9 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(2 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(2.9 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(3 * minute).should.equal('3m')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(59.9 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(60 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.9 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(2 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(2.9 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(3 * hour).should.equal('3h')\r\n\t\t// โฆ\r\n\t\tformatDatePastBy(23.9 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (absolute dates)', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016, 12:00.\r\n\t\tconst now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9')\r\n\t\t// โฆ\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(month * 3).should.equal('Jan 10')\r\n\t\tformatDatePastBy(month * 4).should.equal('Dec 10, 2015')\r\n\t\tformatDatePastBy(year).should.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(-1 * month * 8).should.equal('Dec 10')\r\n\t\tformatDatePastBy(-1 * month * 9).should.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Russian)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ru')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0 ั')\r\n\t\tformatDatePastBy(1).should.equal('1 ั')\r\n\t\tformatDatePastBy(minute).should.equal('1 ะผะธะฝ')\r\n\t\tformatDatePastBy(hour).should.equal('1 ั')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 ะฐะฟั.')\r\n\t\tformatDatePastBy(year).should.equal('11 ะฐะฟั. 2015 ะณ.')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Korean)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ko')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1๋ถ')\r\n\t\tformatDatePastBy(hour).should.equal('1์๊ฐ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4์ 9์ผ')\r\n\t\tformatDatePastBy(year).should.equal('2015๋
4์ 11์ผ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (German)', () => {\r\n\t\tconst timeAgo = new TimeAgo('de')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 Min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 Std.')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9. Apr.')\r\n\t\tformatDatePastBy(year).should.equal('11. Apr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (French)', () => {\r\n\t\tconst timeAgo = new TimeAgo('fr')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 h')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 avr.')\r\n\t\tformatDatePastBy(year).should.equal('11 avr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Chinese)', () => {\r\n\t\tconst timeAgo = new TimeAgo('zh')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1ๅ้')\r\n\t\tformatDatePastBy(hour).should.equal('1ๅฐๆถ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4ๆ9ๆฅ')\r\n\t\tformatDatePastBy(year).should.equal('2015ๅนด4ๆ11ๆฅ')\r\n\t})\r\n\r\n\t// This test won't pass because `Intl.DateTimeFormat` is read at\r\n\t// initialization time, not at run time.\r\n\t// it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {\r\n\t// \tconst DateTimeFormat = Intl.DateTimeFormat\r\n\t// \tIntl.DateTimeFormat = undefined\r\n\t//\r\n\t// \tconst timeAgo = new TimeAgo('en')\r\n\t// \ttimeAgo.format(Date.now() - 365 * 24 * hour * 1000, 'twitter').should.equal('1yr')\r\n\t//\r\n\t// \tIntl.DateTimeFormat = DateTimeFormat\r\n\t// })\r\n\r\n\tit('should support timestamp argument on `yearMonthAndDay.test()`', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\ttimeAgo.format(0, 'twitter').should.equal('Jan 1, 1970')\r\n\t})\r\n\r\n\tit('should round as \"floor\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\tconst test = (time, result) => timeAgo.format(time, 'twitter', {\r\n\t\t\tround: 'floor',\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(result)\r\n\t\ttest(2001, '2s')\r\n\t\ttest(2000, '2s')\r\n\t\ttest(1999, '1s')\r\n\t\ttest(1001, '1s')\r\n\t\ttest(1000, '1s')\r\n\t\ttest(999, '0s')\r\n\t\ttest(0, '0s')\r\n\t\ttest(-999, '0s')\r\n\t\ttest(-1000, '1s')\r\n\t\ttest(-1001, '1s')\r\n\t\ttest(-1999, '1s')\r\n\t\ttest(-2000, '2s')\r\n\t\ttest(-2001, '2s')\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\t// April 10th, 2016, 12:00 (two years earlier).\r\n\t\tlet now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10, 2018',\r\n\t\t\t// Updates on Jan 1st, 2018, 00:00.\r\n\t\t\tnew Date(2018, 0, 1).getTime() - now\r\n\t\t])\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 12:00.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\tlet now\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 11:30.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAkE,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,QAAAR,CAAA,EAAAS,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAZ,CAAA,OAAAW,MAAA,CAAAE,qBAAA,QAAAV,CAAA,GAAAQ,MAAA,CAAAE,qBAAA,CAAAb,CAAA,GAAAS,CAAA,KAAAN,CAAA,GAAAA,CAAA,CAAAW,MAAA,WAAAL,CAAA,WAAAE,MAAA,CAAAI,wBAAA,CAAAf,CAAA,EAAAS,CAAA,EAAAO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