javascript-time-ago 2.5.11 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/README.md +410 -272
- 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/FullDateFormatter.js +72 -0
- package/commonjs/FullDateFormatter.js.map +1 -0
- package/commonjs/FullDateFormatter.test.js +26 -0
- package/commonjs/FullDateFormatter.test.js.map +1 -0
- 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 +300 -253
- package/commonjs/TimeAgo.js.map +1 -1
- package/commonjs/TimeAgo.test.js +214 -135
- 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 +31 -39
- 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 +27 -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 -39
- package/commonjs/style/twitter.js.map +1 -1
- package/commonjs/style/twitter.test.js +54 -57
- 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/full-date-formatter/index.cjs +4 -0
- package/full-date-formatter/index.cjs.js +9 -0
- package/full-date-formatter/index.d.ts +6 -0
- package/full-date-formatter/index.js +1 -0
- package/full-date-formatter/package.json +15 -0
- package/index.cjs +1 -1
- package/index.cjs.js +2 -2
- package/index.d.ts +14 -4
- package/index.js +3 -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/FullDateFormatter.js +67 -0
- package/modules/FullDateFormatter.js.map +1 -0
- package/modules/FullDateFormatter.test.js +22 -0
- package/modules/FullDateFormatter.test.js.map +1 -0
- 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 +299 -237
- package/modules/TimeAgo.js.map +1 -1
- package/modules/TimeAgo.test.js +217 -119
- 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 +31 -36
- package/modules/steps/getStepMinTime.js.map +1 -1
- package/modules/steps/getStepMinTime.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.js +28 -32
- 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 +36 -33
- package/modules/style/twitter.js.map +1 -1
- package/modules/style/twitter.test.js +53 -52
- 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 +275 -13
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.FallbackDateFormatter = void 0;
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), 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); }
|
|
13
|
+
var FullDateFormatter = exports["default"] = /*#__PURE__*/function () {
|
|
14
|
+
function FullDateFormatter(localeOrLocales) {
|
|
15
|
+
_classCallCheck(this, FullDateFormatter);
|
|
16
|
+
// See if `Intl.DateTimeFormat` is supported in the current environment.
|
|
17
|
+
//
|
|
18
|
+
// `Intl` is present in all modern web browsers and is only absent from some of the ancient ones.
|
|
19
|
+
//
|
|
20
|
+
// Babel transforms `typeof` into some "branches"
|
|
21
|
+
// so istanbul will show this as "branch not covered".
|
|
22
|
+
/* istanbul ignore next */
|
|
23
|
+
var isIntlAvailable = (typeof Intl === "undefined" ? "undefined" : _typeof(Intl)) === 'object';
|
|
24
|
+
var isIntlDateTimeFormatAvailable = isIntlAvailable && typeof Intl.DateTimeFormat === 'function';
|
|
25
|
+
|
|
26
|
+
/* istanbul ignore else */
|
|
27
|
+
if (isIntlDateTimeFormatAvailable) {
|
|
28
|
+
this.formatter = new Intl.DateTimeFormat(localeOrLocales, VERBOSE_DATE_FORMAT_OPTIONS);
|
|
29
|
+
} else {
|
|
30
|
+
this.formatter = new FallbackDateFormatter();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
_createClass(FullDateFormatter, [{
|
|
34
|
+
key: "format",
|
|
35
|
+
value: function format(dateOrTimestamp) {
|
|
36
|
+
return this.formatter.format(getDate(dateOrTimestamp));
|
|
37
|
+
}
|
|
38
|
+
}]);
|
|
39
|
+
return FullDateFormatter;
|
|
40
|
+
}();
|
|
41
|
+
var FallbackDateFormatter = exports.FallbackDateFormatter = /*#__PURE__*/function () {
|
|
42
|
+
function FallbackDateFormatter() {
|
|
43
|
+
_classCallCheck(this, FallbackDateFormatter);
|
|
44
|
+
}
|
|
45
|
+
_createClass(FallbackDateFormatter, [{
|
|
46
|
+
key: "format",
|
|
47
|
+
value: function format(date) {
|
|
48
|
+
return String(date);
|
|
49
|
+
}
|
|
50
|
+
}]);
|
|
51
|
+
return FallbackDateFormatter;
|
|
52
|
+
}();
|
|
53
|
+
function getDate(dateOrTimestamp) {
|
|
54
|
+
if (typeof dateOrTimestamp === 'number') {
|
|
55
|
+
return new Date(dateOrTimestamp);
|
|
56
|
+
}
|
|
57
|
+
return dateOrTimestamp;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// `Intl.DateTimeFormat` options for outputting a verbose date.
|
|
61
|
+
// Formatted date example: "Thursday, December 20, 2012, 7:00:00 AM GMT+4"
|
|
62
|
+
var VERBOSE_DATE_FORMAT_OPTIONS = {
|
|
63
|
+
weekday: 'long',
|
|
64
|
+
day: 'numeric',
|
|
65
|
+
month: 'long',
|
|
66
|
+
year: 'numeric',
|
|
67
|
+
hour: 'numeric',
|
|
68
|
+
minute: '2-digit',
|
|
69
|
+
second: '2-digit'
|
|
70
|
+
// timeZoneName: 'short'
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=FullDateFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullDateFormatter.js","names":["FullDateFormatter","exports","localeOrLocales","_classCallCheck","isIntlAvailable","Intl","_typeof","isIntlDateTimeFormatAvailable","DateTimeFormat","formatter","VERBOSE_DATE_FORMAT_OPTIONS","FallbackDateFormatter","_createClass","key","value","format","dateOrTimestamp","getDate","date","String","Date","weekday","day","month","year","hour","minute","second"],"sources":["../source/FullDateFormatter.js"],"sourcesContent":["export default class FullDateFormatter {\r\n\tconstructor(localeOrLocales) {\r\n\t\t// See if `Intl.DateTimeFormat` is supported in the current environment.\r\n\t\t//\r\n\t\t// `Intl` is present in all modern web browsers and is only absent from some of the ancient ones.\r\n\t\t//\r\n\t\t// Babel transforms `typeof` into some \"branches\"\r\n\t\t// so istanbul will show this as \"branch not covered\".\r\n\t\t/* istanbul ignore next */\r\n\t\tconst isIntlAvailable = typeof Intl === 'object'\r\n\t\tconst isIntlDateTimeFormatAvailable = isIntlAvailable && typeof Intl.DateTimeFormat === 'function'\r\n\r\n\t\t/* istanbul ignore else */\r\n\t\tif (isIntlDateTimeFormatAvailable) {\r\n\t\t\tthis.formatter = new Intl.DateTimeFormat(localeOrLocales, VERBOSE_DATE_FORMAT_OPTIONS)\r\n\t\t} else {\r\n\t\t\tthis.formatter = new FallbackDateFormatter()\r\n\t\t}\r\n\t}\r\n\r\n\tformat(dateOrTimestamp) {\r\n\t\treturn this.formatter.format(getDate(dateOrTimestamp))\r\n\t}\r\n}\r\n\r\nexport class FallbackDateFormatter {\r\n\tformat(date) {\r\n\t\treturn String(date)\r\n\t}\r\n}\r\n\r\nfunction getDate(dateOrTimestamp) {\r\n\tif (typeof dateOrTimestamp === 'number') {\r\n\t\treturn new Date(dateOrTimestamp)\r\n\t}\r\n\treturn dateOrTimestamp\r\n}\r\n\r\n// `Intl.DateTimeFormat` options for outputting a verbose date.\r\n// Formatted date example: \"Thursday, December 20, 2012, 7:00:00 AM GMT+4\"\r\nconst VERBOSE_DATE_FORMAT_OPTIONS = {\r\n\tweekday: 'long',\r\n\tday: 'numeric',\r\n\tmonth: 'long',\r\n\tyear: 'numeric',\r\n\thour: 'numeric',\r\n\tminute: '2-digit',\r\n\ts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EAAE,MAAM;EACfC,GAAG,EAAE,SAAS;EACdC,KAAK,EAAE,MAAM;EACbC,IAAI,EAAE,SAAS;EACfC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,MAAM,EAAE;EACR;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
var _FullDateFormatter = _interopRequireWildcard(require("./FullDateFormatter.js"));
|
|
5
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) { "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); } return f; })(e, t); }
|
|
6
|
+
describe('FullDateFormatter', function () {
|
|
7
|
+
it('should format full date', function () {
|
|
8
|
+
var formatter = new _FullDateFormatter["default"]('en');
|
|
9
|
+
expect(formatter.format(new Date(Date.UTC(2000, 0, 1)))).to.equal('Saturday, January 1, 2000 at 3:00:00 AM');
|
|
10
|
+
});
|
|
11
|
+
it('should format full date (`locales` argument)', function () {
|
|
12
|
+
var formatter = new _FullDateFormatter["default"](['en', 'ru']);
|
|
13
|
+
expect(formatter.format(new Date(Date.UTC(2000, 0, 1)))).to.equal('Saturday, January 1, 2000 at 3:00:00 AM');
|
|
14
|
+
});
|
|
15
|
+
it('should format full date (timestamp)', function () {
|
|
16
|
+
var formatter = new _FullDateFormatter["default"]('en');
|
|
17
|
+
expect(formatter.format(Date.UTC(2000, 0, 1))).to.equal('Saturday, January 1, 2000 at 3:00:00 AM');
|
|
18
|
+
});
|
|
19
|
+
it('should fallback to non-`Intl` formatter', function () {
|
|
20
|
+
var formatter = new _FullDateFormatter.FallbackDateFormatter('en');
|
|
21
|
+
// The output depends on the user's time zone.
|
|
22
|
+
// Example when running in Moscow: "Sat Jan 01 2000 03:00:00 GMT+0300 (Moscow Standard Time)".
|
|
23
|
+
expect(formatter.format(new Date(Date.UTC(2000, 1, 1)))).to.include(':00:00 GMT');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=FullDateFormatter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullDateFormatter.test.js","names":["_FullDateFormatter","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","it","formatter","FullDateFormatter","expect","format","Date","UTC","to","equal","FallbackDateFormatter","include"],"sources":["../source/FullDateFormatter.test.js"],"sourcesContent":["import FullDateFormatter, { FallbackDateFormatter } from './FullDateFormatter.js'\r\n\r\ndescribe('FullDateFormatter', () => {\r\n\tit('should format full date', () => {\r\n\t\tconst formatter = new FullDateFormatter('en')\r\n\t\texpect(\r\n\t\t\tformatter.format(new Date(Date.UTC(2000, 0, 1)))\r\n\t\t).to.equal('Saturday, January 1, 2000 at 3:00:00 AM')\r\n\t})\r\n\r\n\tit('should format full date (`locales` argument)', () => {\r\n\t\tconst formatter = new FullDateFormatter(['en', 'ru'])\r\n\t\texpect(\r\n\t\t\tformatter.format(new Date(Date.UTC(2000, 0, 1)))\r\n\t\t).to.equal('Saturday, January 1, 2000 at 3:00:00 AM')\r\n\t})\r\n\r\n\tit('should format full date (timestamp)', () => {\r\n\t\tconst formatter = new FullDateFormatter('en')\r\n\t\texpect(\r\n\t\t\tformatter.format(Date.UTC(2000, 0, 1))\r\n\t\t).to.equal('Saturday, January 1, 2000 at 3:00:00 AM')\r\n\t})\r\n\r\n\tit('should fallback to non-`Intl` formatter', () => {\r\n\t\tconst formatter = new FallbackDateFormatter('en')\r\n\t\t// The output depends on the user's time zone.\r\n\t\t// Example when running in Moscow: \"Sat Jan 01 2000 03:00:00 GMT+0300 (Moscow Standard Time)\".\r\n\t\texpect(\r\n\t\t\tformatter.format(new Date(Date.UTC(2000, 1, 1)))\r\n\t\t).to.include(':00:00 GMT')\r\n\t})\r\n})"],"mappings":";;;AAAA,IAAAA,kBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiF,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,kBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAA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,CAAC;IACjD;IACA;IACAN,MAAM,CACLF,SAAS,CAACG,MAAM,CAAC,IAAIC,IAAI,CAACA,IAAI,CAACC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAChD,CAAC,CAACC,EAAE,CAACG,OAAO,CAAC,YAAY,CAAC;EAC3B,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -8,18 +8,15 @@ exports.getLocaleData = getLocaleData;
|
|
|
8
8
|
// For all locales added
|
|
9
9
|
// their relative time formatter messages will be stored here.
|
|
10
10
|
var localesData = {};
|
|
11
|
-
|
|
12
11
|
function getLocaleData(locale) {
|
|
13
12
|
return localesData[locale];
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
function addLocaleData(localeData) {
|
|
17
15
|
if (!localeData) {
|
|
18
16
|
throw new Error('[javascript-time-ago] No locale data passed.');
|
|
19
|
-
}
|
|
17
|
+
}
|
|
18
|
+
// This locale data is stored in a global variable
|
|
20
19
|
// and later used when calling `.format(time)`.
|
|
21
|
-
|
|
22
|
-
|
|
23
20
|
localesData[localeData.locale] = localeData;
|
|
24
21
|
}
|
|
25
22
|
//# sourceMappingURL=LocaleDataStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleDataStore.js","names":["localesData","getLocaleData","locale","addLocaleData","localeData","Error"],"sources":["../source/LocaleDataStore.js"],"sourcesContent":["// For all locales added\r\n// their relative time formatter messages will be stored here.\r\nconst localesData = {}\r\n\r\nexport function getLocaleData(locale) {\r\n\treturn localesData[locale]\r\n}\r\n\r\nexport function addLocaleData(localeData) {\r\n\tif (!localeData) {\r\n\t\tthrow new Error('[javascript-time-ago] No locale data passed.')\r\n\t}\r\n\t// This locale data is stored in a global variable\r\n\t// and later used when calling `.format(time)`.\r\n\tlocalesData[localeData.locale] = localeData\r\n}"],"mappings":";;;;;;;AAAA;AACA;AACA,IAAMA,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"LocaleDataStore.js","names":["localesData","getLocaleData","locale","addLocaleData","localeData","Error"],"sources":["../source/LocaleDataStore.js"],"sourcesContent":["// For all locales added\r\n// their relative time formatter messages will be stored here.\r\nconst localesData = {}\r\n\r\nexport function getLocaleData(locale) {\r\n\treturn localesData[locale]\r\n}\r\n\r\nexport function addLocaleData(localeData) {\r\n\tif (!localeData) {\r\n\t\tthrow new Error('[javascript-time-ago] No locale data passed.')\r\n\t}\r\n\t// This locale data is stored in a global variable\r\n\t// and later used when calling `.format(time)`.\r\n\tlocalesData[localeData.locale] = localeData\r\n}"],"mappings":";;;;;;;AAAA;AACA;AACA,IAAMA,WAAW,GAAG,CAAC,CAAC;AAEf,SAASC,aAAaA,CAACC,MAAM,EAAE;EACrC,OAAOF,WAAW,CAACE,MAAM,CAAC;AAC3B;AAEO,SAASC,aAAaA,CAACC,UAAU,EAAE;EACzC,IAAI,CAACA,UAAU,EAAE;IAChB,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EAChE;EACA;EACA;EACAL,WAAW,CAACI,UAAU,CAACF,MAAM,CAAC,GAAGE,UAAU;AAC5C","ignoreList":[]}
|
package/commonjs/PropTypes.js
CHANGED
|
@@ -4,19 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.style = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
9
|
// Deprecated: Moved to `react-time-ago`.
|
|
10
|
+
|
|
13
11
|
var oneOfType = _propTypes["default"].oneOfType,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
arrayOf = _propTypes["default"].arrayOf,
|
|
13
|
+
string = _propTypes["default"].string,
|
|
14
|
+
number = _propTypes["default"].number,
|
|
15
|
+
shape = _propTypes["default"].shape,
|
|
16
|
+
func = _propTypes["default"].func;
|
|
19
17
|
|
|
18
|
+
// The first step isn't required to define `minTime` or `test()`.
|
|
20
19
|
var step = oneOfType([shape({
|
|
21
20
|
minTime: number,
|
|
22
21
|
formatAs: string.isRequired
|
|
@@ -29,14 +28,15 @@ var step = oneOfType([shape({
|
|
|
29
28
|
}), shape({
|
|
30
29
|
test: func,
|
|
31
30
|
format: func.isRequired
|
|
32
|
-
})]);
|
|
31
|
+
})]);
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
// Formatting style.
|
|
34
|
+
var style = exports.style = oneOfType([
|
|
35
|
+
// Not using `oneOf()` here, because that way
|
|
35
36
|
// this package wouldn't support some hypothetical
|
|
36
37
|
// new styles added to `javascript-time-ago` in some future.
|
|
37
38
|
string, shape({
|
|
38
39
|
steps: arrayOf(step).isRequired,
|
|
39
40
|
labels: oneOfType([string, arrayOf(string)]).isRequired
|
|
40
41
|
})]);
|
|
41
|
-
exports.style = style;
|
|
42
42
|
//# sourceMappingURL=PropTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropTypes.js","names":["oneOfType","PropTypes","arrayOf","string","number","shape","func","step","minTime","formatAs","isRequired","test","format","style","steps","labels"],"sources":["../source/PropTypes.js"],"sourcesContent":["// Deprecated: Moved to `react-time-ago`.\r\n\r\nimport PropTypes from 'prop-types'\r\n\r\nconst {\r\n\toneOfType,\r\n\tarrayOf,\r\n\tstring,\r\n\tnumber,\r\n\tshape,\r\n\tfunc\r\n} = PropTypes\r\n\r\n// The first step isn't required to define `minTime` or `test()`.\r\nconst step = oneOfType([\r\n\tshape({\r\n\t\tminTime: number,\r\n\t\tformatAs: string.isRequired\r\n\t}),\r\n\tshape({\r\n\t\ttest: func,\r\n\t\tformatAs: string.isRequired\r\n\t}),\r\n\tshape({\r\n\t\tminTime: number,\r\n\t\tformat: func.isRequired\r\n\t}),\r\n\tshape({\r\n\t\ttest: func,\r\n\t\tformat: func.isRequired\r\n\t})\r\n])\r\n\r\n// Formatting style.\r\nexport const style = oneOfType([\r\n\t// Not using `oneOf()` here, because that way\r\n\t// this package wouldn't support some hypothetical\r\n\t// new styles added to `javascript-time-ago` in some future.\r\n\tstring,\r\n\tshape({\r\n\t\tsteps: arrayOf(step).isRequired,\r\n\t\tlabels: oneOfType([\r\n\t\t\tstring,\r\n\t\t\tarrayOf(string)\r\n\t\t]).isRequired\r\n\t})\r\n])"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PropTypes.js","names":["_propTypes","_interopRequireDefault","require","e","__esModule","oneOfType","PropTypes","arrayOf","string","number","shape","func","step","minTime","formatAs","isRequired","test","format","style","exports","steps","labels"],"sources":["../source/PropTypes.js"],"sourcesContent":["// Deprecated: Moved to `react-time-ago`.\r\n\r\nimport PropTypes from 'prop-types'\r\n\r\nconst {\r\n\toneOfType,\r\n\tarrayOf,\r\n\tstring,\r\n\tnumber,\r\n\tshape,\r\n\tfunc\r\n} = PropTypes\r\n\r\n// The first step isn't required to define `minTime` or `test()`.\r\nconst step = oneOfType([\r\n\tshape({\r\n\t\tminTime: number,\r\n\t\tformatAs: string.isRequired\r\n\t}),\r\n\tshape({\r\n\t\ttest: func,\r\n\t\tformatAs: string.isRequired\r\n\t}),\r\n\tshape({\r\n\t\tminTime: number,\r\n\t\tformat: func.isRequired\r\n\t}),\r\n\tshape({\r\n\t\ttest: func,\r\n\t\tformat: func.isRequired\r\n\t})\r\n])\r\n\r\n// Formatting style.\r\nexport const style = oneOfType([\r\n\t// Not using `oneOf()` here, because that way\r\n\t// this package wouldn't support some hypothetical\r\n\t// new styles added to `javascript-time-ago` in some future.\r\n\tstring,\r\n\tshape({\r\n\t\tsteps: arrayOf(step).isRequired,\r\n\t\tlabels: oneOfType([\r\n\t\t\tstring,\r\n\t\t\tarrayOf(string)\r\n\t\t]).isRequired\r\n\t})\r\n])"],"m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