javascript-time-ago 2.3.13 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/bin/create-commonjs-package-json.js +11 -0
- package/bin/generate-load-all-locales.js +38 -6
- package/bin/generate-locale-messages.js +106 -21
- 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/cache/index.cjs +2 -0
- package/cache/index.cjs.js +7 -0
- package/cache/index.js +1 -1
- package/cache/package.json +9 -3
- package/commonjs/LocaleDataStore.js +1 -1
- package/commonjs/LocaleDataStore.js.map +1 -1
- package/commonjs/PropTypes.js +26 -18
- package/commonjs/PropTypes.js.map +1 -1
- package/commonjs/TimeAgo.js +41 -48
- package/commonjs/TimeAgo.js.map +1 -1
- package/commonjs/TimeAgo.test.js +70 -70
- package/commonjs/TimeAgo.test.js.map +1 -1
- package/commonjs/cache.js +10 -14
- package/commonjs/cache.js.map +1 -1
- package/commonjs/cache.test.js +3 -3
- package/commonjs/cache.test.js.map +1 -1
- package/commonjs/isStyleObject.js +2 -2
- package/commonjs/isStyleObject.js.map +1 -1
- package/commonjs/isStyleObject.test.js +11 -11
- package/commonjs/isStyleObject.test.js.map +1 -1
- package/commonjs/locale.js +11 -16
- package/commonjs/locale.js.map +1 -1
- package/commonjs/locale.test.js +8 -4
- package/commonjs/locale.test.js.map +1 -1
- package/commonjs/package.json +5 -0
- package/commonjs/round.js +1 -1
- package/commonjs/round.js.map +1 -1
- package/commonjs/steps/approximate.js +3 -3
- package/commonjs/steps/approximate.js.map +1 -1
- package/commonjs/steps/approximate.test.js +5 -5
- package/commonjs/steps/approximate.test.js.map +1 -1
- package/commonjs/steps/getStep.js +10 -8
- package/commonjs/steps/getStep.js.map +1 -1
- package/commonjs/steps/getStep.test.js +16 -16
- package/commonjs/steps/getStep.test.js.map +1 -1
- package/commonjs/steps/getStepDenominator.js +2 -2
- package/commonjs/steps/getStepDenominator.js.map +1 -1
- package/commonjs/steps/getStepDenominator.test.js +4 -4
- package/commonjs/steps/getStepDenominator.test.js.map +1 -1
- package/commonjs/steps/getStepMinTime.js +5 -5
- package/commonjs/steps/getStepMinTime.js.map +1 -1
- package/commonjs/steps/getStepMinTime.test.js +4 -4
- package/commonjs/steps/getStepMinTime.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.js +8 -8
- package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.test.js +18 -14
- package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdateForUnit.js +3 -3
- package/commonjs/steps/getTimeToNextUpdateForUnit.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +8 -8
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/commonjs/steps/helpers.js.map +1 -1
- package/commonjs/steps/helpers.test.js +1 -1
- package/commonjs/steps/helpers.test.js.map +1 -1
- package/commonjs/steps/index.js +24 -24
- package/commonjs/steps/index.js.map +1 -1
- package/commonjs/steps/renameLegacyProperties.js +8 -8
- package/commonjs/steps/renameLegacyProperties.js.map +1 -1
- package/commonjs/steps/renameLegacyProperties.test.js +6 -6
- package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/steps/round.js +2 -2
- package/commonjs/steps/round.js.map +1 -1
- package/commonjs/steps/round.test.js +6 -6
- package/commonjs/steps/round.test.js.map +1 -1
- package/commonjs/steps/units.js +2 -1
- package/commonjs/steps/units.js.map +1 -1
- package/commonjs/style/approximate.js +5 -5
- package/commonjs/style/approximate.js.map +1 -1
- package/commonjs/style/approximateTime.js +5 -5
- package/commonjs/style/approximateTime.js.map +1 -1
- package/commonjs/style/approximateTime.test.js +13 -18
- package/commonjs/style/approximateTime.test.js.map +1 -1
- package/commonjs/style/getStyleByName.js +29 -29
- package/commonjs/style/getStyleByName.js.map +1 -1
- package/commonjs/style/mini.js +2 -2
- package/commonjs/style/mini.js.map +1 -1
- package/commonjs/style/mini.test.js +62 -60
- package/commonjs/style/mini.test.js.map +1 -1
- package/commonjs/style/miniMinute.js +9 -7
- package/commonjs/style/miniMinute.js.map +1 -1
- package/commonjs/style/miniMinute.test.js +30 -28
- package/commonjs/style/miniMinute.test.js.map +1 -1
- package/commonjs/style/miniMinuteNow.js +9 -7
- package/commonjs/style/miniMinuteNow.js.map +1 -1
- package/commonjs/style/miniMinuteNow.test.js +30 -28
- package/commonjs/style/miniMinuteNow.test.js.map +1 -1
- package/commonjs/style/miniNow.js +9 -7
- package/commonjs/style/miniNow.js.map +1 -1
- package/commonjs/style/miniNow.test.js +30 -28
- package/commonjs/style/miniNow.test.js.map +1 -1
- package/commonjs/style/renameLegacyProperties.js +7 -5
- package/commonjs/style/renameLegacyProperties.js.map +1 -1
- package/commonjs/style/renameLegacyProperties.test.js +5 -5
- package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/style/round.js +5 -5
- package/commonjs/style/round.js.map +1 -1
- package/commonjs/style/round.test.js +66 -60
- package/commonjs/style/round.test.js.map +1 -1
- package/commonjs/style/roundMinute.js +9 -7
- package/commonjs/style/roundMinute.js.map +1 -1
- package/commonjs/style/roundMinute.test.js +33 -31
- package/commonjs/style/roundMinute.test.js.map +1 -1
- package/commonjs/style/twitter.js +18 -18
- package/commonjs/style/twitter.js.map +1 -1
- package/commonjs/style/twitter.test.js +76 -74
- package/commonjs/style/twitter.test.js.map +1 -1
- package/commonjs/style/twitterFirstMinute.js +11 -9
- package/commonjs/style/twitterFirstMinute.js.map +1 -1
- package/commonjs/style/twitterFirstMinute.test.js +35 -33
- package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinute.js +9 -7
- package/commonjs/style/twitterMinute.js.map +1 -1
- package/commonjs/style/twitterMinute.test.js +36 -34
- package/commonjs/style/twitterMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinuteNow.js +9 -7
- package/commonjs/style/twitterMinuteNow.js.map +1 -1
- package/commonjs/style/twitterMinuteNow.test.js +36 -34
- package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
- package/commonjs/style/twitterNow.js +9 -7
- package/commonjs/style/twitterNow.js.map +1 -1
- package/commonjs/style/twitterNow.test.js +35 -33
- package/commonjs/style/twitterNow.test.js.map +1 -1
- package/gradation/index.cjs +2 -0
- package/gradation/index.cjs.js +7 -0
- package/gradation/index.js +1 -1
- package/gradation/package.json +9 -3
- package/index.cjs +9 -0
- package/index.cjs.js +14 -0
- package/index.d.ts +6 -0
- package/index.js +2 -2
- package/load-all-locales/index.cjs +281 -0
- package/load-all-locales/index.cjs.js +286 -0
- package/load-all-locales/index.js +563 -0
- package/load-all-locales/package.json +18 -0
- package/locale/af/index.cjs +3 -0
- package/locale/af/index.cjs.js +3 -0
- package/locale/af/index.js +1 -3
- package/locale/af/package.json +14 -0
- package/locale/am/index.cjs +3 -0
- package/locale/am/index.cjs.js +3 -0
- package/locale/am/index.js +1 -3
- package/locale/am/package.json +14 -0
- package/locale/ar/index.cjs +3 -0
- package/locale/ar/index.cjs.js +3 -0
- package/locale/ar/index.js +1 -3
- package/locale/ar/package.json +14 -0
- package/locale/ar-AE/index.cjs +3 -0
- package/locale/ar-AE/index.cjs.js +3 -0
- package/locale/ar-AE/index.js +1 -3
- package/locale/ar-AE/package.json +14 -0
- package/locale/as/index.cjs +3 -0
- package/locale/as/index.cjs.js +3 -0
- package/locale/as/index.js +1 -3
- package/locale/as/package.json +14 -0
- package/locale/ast/index.cjs +3 -0
- package/locale/ast/index.cjs.js +3 -0
- package/locale/ast/index.js +1 -3
- package/locale/ast/package.json +14 -0
- package/locale/az/index.cjs +3 -0
- package/locale/az/index.cjs.js +3 -0
- package/locale/az/index.js +1 -3
- package/locale/az/package.json +14 -0
- package/locale/be/index.cjs +3 -0
- package/locale/be/index.cjs.js +3 -0
- package/locale/be/index.js +1 -3
- package/locale/be/package.json +14 -0
- package/locale/bg/index.cjs +3 -0
- package/locale/bg/index.cjs.js +3 -0
- package/locale/bg/index.js +1 -3
- package/locale/bg/package.json +14 -0
- package/locale/bn/index.cjs +3 -0
- package/locale/bn/index.cjs.js +3 -0
- package/locale/bn/index.js +1 -3
- package/locale/bn/package.json +14 -0
- package/locale/br/index.cjs +3 -0
- package/locale/br/index.cjs.js +3 -0
- package/locale/br/index.js +1 -3
- package/locale/br/package.json +14 -0
- package/locale/brx/index.cjs +3 -0
- package/locale/brx/index.cjs.js +3 -0
- package/locale/brx/index.js +1 -0
- package/locale/brx/package.json +14 -0
- package/locale/brx.json +159 -0
- package/locale/bs/index.cjs +3 -0
- package/locale/bs/index.cjs.js +3 -0
- package/locale/bs/index.js +1 -3
- package/locale/bs/package.json +14 -0
- package/locale/bs-Cyrl/index.cjs +3 -0
- package/locale/bs-Cyrl/index.cjs.js +3 -0
- package/locale/bs-Cyrl/index.js +1 -3
- package/locale/bs-Cyrl/package.json +14 -0
- package/locale/ca/index.cjs +3 -0
- package/locale/ca/index.cjs.js +3 -0
- package/locale/ca/index.js +1 -3
- package/locale/ca/package.json +14 -0
- package/locale/ccp/index.cjs +3 -0
- package/locale/ccp/index.cjs.js +3 -0
- package/locale/ccp/index.js +1 -3
- package/locale/ccp/package.json +14 -0
- package/locale/ce/index.cjs +3 -0
- package/locale/ce/index.cjs.js +3 -0
- package/locale/ce/index.js +1 -3
- package/locale/ce/package.json +14 -0
- package/locale/ceb/index.cjs +3 -0
- package/locale/ceb/index.cjs.js +3 -0
- package/locale/ceb/index.js +1 -3
- package/locale/ceb/package.json +14 -0
- package/locale/chr/index.cjs +3 -0
- package/locale/chr/index.cjs.js +3 -0
- package/locale/chr/index.js +1 -3
- package/locale/chr/package.json +14 -0
- package/locale/cs/index.cjs +3 -0
- package/locale/cs/index.cjs.js +3 -0
- package/locale/cs/index.js +1 -3
- package/locale/cs/package.json +14 -0
- package/locale/cy/index.cjs +3 -0
- package/locale/cy/index.cjs.js +3 -0
- package/locale/cy/index.js +1 -3
- package/locale/cy/package.json +14 -0
- package/locale/da/index.cjs +3 -0
- package/locale/da/index.cjs.js +3 -0
- package/locale/da/index.js +1 -3
- package/locale/da/package.json +14 -0
- package/locale/de/index.cjs +3 -0
- package/locale/de/index.cjs.js +3 -0
- package/locale/de/index.js +1 -3
- package/locale/de/package.json +14 -0
- package/locale/dsb/index.cjs +3 -0
- package/locale/dsb/index.cjs.js +3 -0
- package/locale/dsb/index.js +1 -3
- package/locale/dsb/package.json +14 -0
- package/locale/dz/index.cjs +3 -0
- package/locale/dz/index.cjs.js +3 -0
- package/locale/dz/index.js +1 -3
- package/locale/dz/package.json +14 -0
- package/locale/ee/index.cjs +3 -0
- package/locale/ee/index.cjs.js +3 -0
- package/locale/ee/index.js +1 -3
- package/locale/ee/package.json +14 -0
- package/locale/el/index.cjs +3 -0
- package/locale/el/index.cjs.js +3 -0
- package/locale/el/index.js +1 -3
- package/locale/el/package.json +14 -0
- package/locale/en/index.cjs +3 -0
- package/locale/en/index.cjs.js +3 -0
- package/locale/en/index.js +1 -3
- package/locale/en/package.json +14 -0
- package/locale/en-001/index.cjs +3 -0
- package/locale/en-001/index.cjs.js +3 -0
- package/locale/en-001/index.js +1 -3
- package/locale/en-001/package.json +14 -0
- package/locale/en-150/index.cjs +3 -0
- package/locale/en-150/index.cjs.js +3 -0
- package/locale/en-150/index.js +1 -3
- package/locale/en-150/package.json +14 -0
- package/locale/en-AG/index.cjs +3 -0
- package/locale/en-AG/index.cjs.js +3 -0
- package/locale/en-AG/index.js +1 -3
- package/locale/en-AG/package.json +14 -0
- package/locale/en-AI/index.cjs +3 -0
- package/locale/en-AI/index.cjs.js +3 -0
- package/locale/en-AI/index.js +1 -3
- package/locale/en-AI/package.json +14 -0
- package/locale/en-AT/index.cjs +3 -0
- package/locale/en-AT/index.cjs.js +3 -0
- package/locale/en-AT/index.js +1 -3
- package/locale/en-AT/package.json +14 -0
- package/locale/en-AU/index.cjs +3 -0
- package/locale/en-AU/index.cjs.js +3 -0
- package/locale/en-AU/index.js +1 -3
- package/locale/en-AU/package.json +14 -0
- package/locale/en-BB/index.cjs +3 -0
- package/locale/en-BB/index.cjs.js +3 -0
- package/locale/en-BB/index.js +1 -3
- package/locale/en-BB/package.json +14 -0
- package/locale/en-BE/index.cjs +3 -0
- package/locale/en-BE/index.cjs.js +3 -0
- package/locale/en-BE/index.js +1 -3
- package/locale/en-BE/package.json +14 -0
- package/locale/en-BM/index.cjs +3 -0
- package/locale/en-BM/index.cjs.js +3 -0
- package/locale/en-BM/index.js +1 -3
- package/locale/en-BM/package.json +14 -0
- package/locale/en-BS/index.cjs +3 -0
- package/locale/en-BS/index.cjs.js +3 -0
- package/locale/en-BS/index.js +1 -3
- package/locale/en-BS/package.json +14 -0
- package/locale/en-BW/index.cjs +3 -0
- package/locale/en-BW/index.cjs.js +3 -0
- package/locale/en-BW/index.js +1 -3
- package/locale/en-BW/package.json +14 -0
- package/locale/en-BZ/index.cjs +3 -0
- package/locale/en-BZ/index.cjs.js +3 -0
- package/locale/en-BZ/index.js +1 -3
- package/locale/en-BZ/package.json +14 -0
- package/locale/en-CA/index.cjs +3 -0
- package/locale/en-CA/index.cjs.js +3 -0
- package/locale/en-CA/index.js +1 -3
- package/locale/en-CA/package.json +14 -0
- package/locale/en-CC/index.cjs +3 -0
- package/locale/en-CC/index.cjs.js +3 -0
- package/locale/en-CC/index.js +1 -3
- package/locale/en-CC/package.json +14 -0
- package/locale/en-CH/index.cjs +3 -0
- package/locale/en-CH/index.cjs.js +3 -0
- package/locale/en-CH/index.js +1 -3
- package/locale/en-CH/package.json +14 -0
- package/locale/en-CK/index.cjs +3 -0
- package/locale/en-CK/index.cjs.js +3 -0
- package/locale/en-CK/index.js +1 -3
- package/locale/en-CK/package.json +14 -0
- package/locale/en-CM/index.cjs +3 -0
- package/locale/en-CM/index.cjs.js +3 -0
- package/locale/en-CM/index.js +1 -3
- package/locale/en-CM/package.json +14 -0
- package/locale/en-CX/index.cjs +3 -0
- package/locale/en-CX/index.cjs.js +3 -0
- package/locale/en-CX/index.js +1 -3
- package/locale/en-CX/package.json +14 -0
- package/locale/en-CY/index.cjs +3 -0
- package/locale/en-CY/index.cjs.js +3 -0
- package/locale/en-CY/index.js +1 -3
- package/locale/en-CY/package.json +14 -0
- package/locale/en-DE/index.cjs +3 -0
- package/locale/en-DE/index.cjs.js +3 -0
- package/locale/en-DE/index.js +1 -3
- package/locale/en-DE/package.json +14 -0
- package/locale/en-DG/index.cjs +3 -0
- package/locale/en-DG/index.cjs.js +3 -0
- package/locale/en-DG/index.js +1 -3
- package/locale/en-DG/package.json +14 -0
- package/locale/en-DK/index.cjs +3 -0
- package/locale/en-DK/index.cjs.js +3 -0
- package/locale/en-DK/index.js +1 -3
- package/locale/en-DK/package.json +14 -0
- package/locale/en-DM/index.cjs +3 -0
- package/locale/en-DM/index.cjs.js +3 -0
- package/locale/en-DM/index.js +1 -3
- package/locale/en-DM/package.json +14 -0
- package/locale/en-ER/index.cjs +3 -0
- package/locale/en-ER/index.cjs.js +3 -0
- package/locale/en-ER/index.js +1 -3
- package/locale/en-ER/package.json +14 -0
- package/locale/en-FI/index.cjs +3 -0
- package/locale/en-FI/index.cjs.js +3 -0
- package/locale/en-FI/index.js +1 -3
- package/locale/en-FI/package.json +14 -0
- package/locale/en-FJ/index.cjs +3 -0
- package/locale/en-FJ/index.cjs.js +3 -0
- package/locale/en-FJ/index.js +1 -3
- package/locale/en-FJ/package.json +14 -0
- package/locale/en-FK/index.cjs +3 -0
- package/locale/en-FK/index.cjs.js +3 -0
- package/locale/en-FK/index.js +1 -3
- package/locale/en-FK/package.json +14 -0
- package/locale/en-FM/index.cjs +3 -0
- package/locale/en-FM/index.cjs.js +3 -0
- package/locale/en-FM/index.js +1 -3
- package/locale/en-FM/package.json +14 -0
- package/locale/en-GB/index.cjs +3 -0
- package/locale/en-GB/index.cjs.js +3 -0
- package/locale/en-GB/index.js +1 -3
- package/locale/en-GB/package.json +14 -0
- package/locale/en-GD/index.cjs +3 -0
- package/locale/en-GD/index.cjs.js +3 -0
- package/locale/en-GD/index.js +1 -3
- package/locale/en-GD/package.json +14 -0
- package/locale/en-GG/index.cjs +3 -0
- package/locale/en-GG/index.cjs.js +3 -0
- package/locale/en-GG/index.js +1 -3
- package/locale/en-GG/package.json +14 -0
- package/locale/en-GH/index.cjs +3 -0
- package/locale/en-GH/index.cjs.js +3 -0
- package/locale/en-GH/index.js +1 -3
- package/locale/en-GH/package.json +14 -0
- package/locale/en-GI/index.cjs +3 -0
- package/locale/en-GI/index.cjs.js +3 -0
- package/locale/en-GI/index.js +1 -3
- package/locale/en-GI/package.json +14 -0
- package/locale/en-GM/index.cjs +3 -0
- package/locale/en-GM/index.cjs.js +3 -0
- package/locale/en-GM/index.js +1 -3
- package/locale/en-GM/package.json +14 -0
- package/locale/en-GY/index.cjs +3 -0
- package/locale/en-GY/index.cjs.js +3 -0
- package/locale/en-GY/index.js +1 -3
- package/locale/en-GY/package.json +14 -0
- package/locale/en-HK/index.cjs +3 -0
- package/locale/en-HK/index.cjs.js +3 -0
- package/locale/en-HK/index.js +1 -3
- package/locale/en-HK/package.json +14 -0
- package/locale/en-IE/index.cjs +3 -0
- package/locale/en-IE/index.cjs.js +3 -0
- package/locale/en-IE/index.js +1 -3
- package/locale/en-IE/package.json +14 -0
- package/locale/en-IL/index.cjs +3 -0
- package/locale/en-IL/index.cjs.js +3 -0
- package/locale/en-IL/index.js +1 -3
- package/locale/en-IL/package.json +14 -0
- package/locale/en-IM/index.cjs +3 -0
- package/locale/en-IM/index.cjs.js +3 -0
- package/locale/en-IM/index.js +1 -3
- package/locale/en-IM/package.json +14 -0
- package/locale/en-IN/index.cjs +3 -0
- package/locale/en-IN/index.cjs.js +3 -0
- package/locale/en-IN/index.js +1 -3
- package/locale/en-IN/package.json +14 -0
- package/locale/en-IO/index.cjs +3 -0
- package/locale/en-IO/index.cjs.js +3 -0
- package/locale/en-IO/index.js +1 -3
- package/locale/en-IO/package.json +14 -0
- package/locale/en-JE/index.cjs +3 -0
- package/locale/en-JE/index.cjs.js +3 -0
- package/locale/en-JE/index.js +1 -3
- package/locale/en-JE/package.json +14 -0
- package/locale/en-JM/index.cjs +3 -0
- package/locale/en-JM/index.cjs.js +3 -0
- package/locale/en-JM/index.js +1 -3
- package/locale/en-JM/package.json +14 -0
- package/locale/en-KE/index.cjs +3 -0
- package/locale/en-KE/index.cjs.js +3 -0
- package/locale/en-KE/index.js +1 -3
- package/locale/en-KE/package.json +14 -0
- package/locale/en-KI/index.cjs +3 -0
- package/locale/en-KI/index.cjs.js +3 -0
- package/locale/en-KI/index.js +1 -3
- package/locale/en-KI/package.json +14 -0
- package/locale/en-KN/index.cjs +3 -0
- package/locale/en-KN/index.cjs.js +3 -0
- package/locale/en-KN/index.js +1 -3
- package/locale/en-KN/package.json +14 -0
- package/locale/en-KY/index.cjs +3 -0
- package/locale/en-KY/index.cjs.js +3 -0
- package/locale/en-KY/index.js +1 -3
- package/locale/en-KY/package.json +14 -0
- package/locale/en-LC/index.cjs +3 -0
- package/locale/en-LC/index.cjs.js +3 -0
- package/locale/en-LC/index.js +1 -3
- package/locale/en-LC/package.json +14 -0
- package/locale/en-LR/index.cjs +3 -0
- package/locale/en-LR/index.cjs.js +3 -0
- package/locale/en-LR/index.js +1 -3
- package/locale/en-LR/package.json +14 -0
- package/locale/en-LS/index.cjs +3 -0
- package/locale/en-LS/index.cjs.js +3 -0
- package/locale/en-LS/index.js +1 -3
- package/locale/en-LS/package.json +14 -0
- package/locale/en-MG/index.cjs +3 -0
- package/locale/en-MG/index.cjs.js +3 -0
- package/locale/en-MG/index.js +1 -3
- package/locale/en-MG/package.json +14 -0
- package/locale/en-MO/index.cjs +3 -0
- package/locale/en-MO/index.cjs.js +3 -0
- package/locale/en-MO/index.js +1 -3
- package/locale/en-MO/package.json +14 -0
- package/locale/en-MS/index.cjs +3 -0
- package/locale/en-MS/index.cjs.js +3 -0
- package/locale/en-MS/index.js +1 -3
- package/locale/en-MS/package.json +14 -0
- package/locale/en-MT/index.cjs +3 -0
- package/locale/en-MT/index.cjs.js +3 -0
- package/locale/en-MT/index.js +1 -3
- package/locale/en-MT/package.json +14 -0
- package/locale/en-MU/index.cjs +3 -0
- package/locale/en-MU/index.cjs.js +3 -0
- package/locale/en-MU/index.js +1 -3
- package/locale/en-MU/package.json +14 -0
- package/locale/en-MV/index.cjs +3 -0
- package/locale/en-MV/index.cjs.js +3 -0
- package/locale/en-MV/index.js +1 -0
- package/locale/en-MV/package.json +14 -0
- package/locale/en-MV.json +219 -0
- package/locale/en-MW/index.cjs +3 -0
- package/locale/en-MW/index.cjs.js +3 -0
- package/locale/en-MW/index.js +1 -3
- package/locale/en-MW/package.json +14 -0
- package/locale/en-MY/index.cjs +3 -0
- package/locale/en-MY/index.cjs.js +3 -0
- package/locale/en-MY/index.js +1 -3
- package/locale/en-MY/package.json +14 -0
- package/locale/en-NA/index.cjs +3 -0
- package/locale/en-NA/index.cjs.js +3 -0
- package/locale/en-NA/index.js +1 -3
- package/locale/en-NA/package.json +14 -0
- package/locale/en-NF/index.cjs +3 -0
- package/locale/en-NF/index.cjs.js +3 -0
- package/locale/en-NF/index.js +1 -3
- package/locale/en-NF/package.json +14 -0
- package/locale/en-NG/index.cjs +3 -0
- package/locale/en-NG/index.cjs.js +3 -0
- package/locale/en-NG/index.js +1 -3
- package/locale/en-NG/package.json +14 -0
- package/locale/en-NL/index.cjs +3 -0
- package/locale/en-NL/index.cjs.js +3 -0
- package/locale/en-NL/index.js +1 -3
- package/locale/en-NL/package.json +14 -0
- package/locale/en-NR/index.cjs +3 -0
- package/locale/en-NR/index.cjs.js +3 -0
- package/locale/en-NR/index.js +1 -3
- package/locale/en-NR/package.json +14 -0
- package/locale/en-NU/index.cjs +3 -0
- package/locale/en-NU/index.cjs.js +3 -0
- package/locale/en-NU/index.js +1 -3
- package/locale/en-NU/package.json +14 -0
- package/locale/en-NZ/index.cjs +3 -0
- package/locale/en-NZ/index.cjs.js +3 -0
- package/locale/en-NZ/index.js +1 -3
- package/locale/en-NZ/package.json +14 -0
- package/locale/en-PG/index.cjs +3 -0
- package/locale/en-PG/index.cjs.js +3 -0
- package/locale/en-PG/index.js +1 -3
- package/locale/en-PG/package.json +14 -0
- package/locale/en-PK/index.cjs +3 -0
- package/locale/en-PK/index.cjs.js +3 -0
- package/locale/en-PK/index.js +1 -3
- package/locale/en-PK/package.json +14 -0
- package/locale/en-PN/index.cjs +3 -0
- package/locale/en-PN/index.cjs.js +3 -0
- package/locale/en-PN/index.js +1 -3
- package/locale/en-PN/package.json +14 -0
- package/locale/en-PW/index.cjs +3 -0
- package/locale/en-PW/index.cjs.js +3 -0
- package/locale/en-PW/index.js +1 -3
- package/locale/en-PW/package.json +14 -0
- package/locale/en-RW/index.cjs +3 -0
- package/locale/en-RW/index.cjs.js +3 -0
- package/locale/en-RW/index.js +1 -3
- package/locale/en-RW/package.json +14 -0
- package/locale/en-SB/index.cjs +3 -0
- package/locale/en-SB/index.cjs.js +3 -0
- package/locale/en-SB/index.js +1 -3
- package/locale/en-SB/package.json +14 -0
- package/locale/en-SC/index.cjs +3 -0
- package/locale/en-SC/index.cjs.js +3 -0
- package/locale/en-SC/index.js +1 -3
- package/locale/en-SC/package.json +14 -0
- package/locale/en-SD/index.cjs +3 -0
- package/locale/en-SD/index.cjs.js +3 -0
- package/locale/en-SD/index.js +1 -3
- package/locale/en-SD/package.json +14 -0
- package/locale/en-SE/index.cjs +3 -0
- package/locale/en-SE/index.cjs.js +3 -0
- package/locale/en-SE/index.js +1 -3
- package/locale/en-SE/package.json +14 -0
- package/locale/en-SG/index.cjs +3 -0
- package/locale/en-SG/index.cjs.js +3 -0
- package/locale/en-SG/index.js +1 -3
- package/locale/en-SG/package.json +14 -0
- package/locale/en-SH/index.cjs +3 -0
- package/locale/en-SH/index.cjs.js +3 -0
- package/locale/en-SH/index.js +1 -3
- package/locale/en-SH/package.json +14 -0
- package/locale/en-SI/index.cjs +3 -0
- package/locale/en-SI/index.cjs.js +3 -0
- package/locale/en-SI/index.js +1 -3
- package/locale/en-SI/package.json +14 -0
- package/locale/en-SL/index.cjs +3 -0
- package/locale/en-SL/index.cjs.js +3 -0
- package/locale/en-SL/index.js +1 -3
- package/locale/en-SL/package.json +14 -0
- package/locale/en-SS/index.cjs +3 -0
- package/locale/en-SS/index.cjs.js +3 -0
- package/locale/en-SS/index.js +1 -3
- package/locale/en-SS/package.json +14 -0
- package/locale/en-SX/index.cjs +3 -0
- package/locale/en-SX/index.cjs.js +3 -0
- package/locale/en-SX/index.js +1 -3
- package/locale/en-SX/package.json +14 -0
- package/locale/en-SZ/index.cjs +3 -0
- package/locale/en-SZ/index.cjs.js +3 -0
- package/locale/en-SZ/index.js +1 -3
- package/locale/en-SZ/package.json +14 -0
- package/locale/en-TC/index.cjs +3 -0
- package/locale/en-TC/index.cjs.js +3 -0
- package/locale/en-TC/index.js +1 -3
- package/locale/en-TC/package.json +14 -0
- package/locale/en-TK/index.cjs +3 -0
- package/locale/en-TK/index.cjs.js +3 -0
- package/locale/en-TK/index.js +1 -3
- package/locale/en-TK/package.json +14 -0
- package/locale/en-TO/index.cjs +3 -0
- package/locale/en-TO/index.cjs.js +3 -0
- package/locale/en-TO/index.js +1 -3
- package/locale/en-TO/package.json +14 -0
- package/locale/en-TT/index.cjs +3 -0
- package/locale/en-TT/index.cjs.js +3 -0
- package/locale/en-TT/index.js +1 -3
- package/locale/en-TT/package.json +14 -0
- package/locale/en-TV/index.cjs +3 -0
- package/locale/en-TV/index.cjs.js +3 -0
- package/locale/en-TV/index.js +1 -3
- package/locale/en-TV/package.json +14 -0
- package/locale/en-TZ/index.cjs +3 -0
- package/locale/en-TZ/index.cjs.js +3 -0
- package/locale/en-TZ/index.js +1 -3
- package/locale/en-TZ/package.json +14 -0
- package/locale/en-UG/index.cjs +3 -0
- package/locale/en-UG/index.cjs.js +3 -0
- package/locale/en-UG/index.js +1 -3
- package/locale/en-UG/package.json +14 -0
- package/locale/en-VC/index.cjs +3 -0
- package/locale/en-VC/index.cjs.js +3 -0
- package/locale/en-VC/index.js +1 -3
- package/locale/en-VC/package.json +14 -0
- package/locale/en-VG/index.cjs +3 -0
- package/locale/en-VG/index.cjs.js +3 -0
- package/locale/en-VG/index.js +1 -3
- package/locale/en-VG/package.json +14 -0
- package/locale/en-VU/index.cjs +3 -0
- package/locale/en-VU/index.cjs.js +3 -0
- package/locale/en-VU/index.js +1 -3
- package/locale/en-VU/package.json +14 -0
- package/locale/en-WS/index.cjs +3 -0
- package/locale/en-WS/index.cjs.js +3 -0
- package/locale/en-WS/index.js +1 -3
- package/locale/en-WS/package.json +14 -0
- package/locale/en-ZA/index.cjs +3 -0
- package/locale/en-ZA/index.cjs.js +3 -0
- package/locale/en-ZA/index.js +1 -3
- package/locale/en-ZA/package.json +14 -0
- package/locale/en-ZM/index.cjs +3 -0
- package/locale/en-ZM/index.cjs.js +3 -0
- package/locale/en-ZM/index.js +1 -3
- package/locale/en-ZM/package.json +14 -0
- package/locale/en-ZW/index.cjs +3 -0
- package/locale/en-ZW/index.cjs.js +3 -0
- package/locale/en-ZW/index.js +1 -3
- package/locale/en-ZW/package.json +14 -0
- package/locale/es/index.cjs +3 -0
- package/locale/es/index.cjs.js +3 -0
- package/locale/es/index.js +1 -3
- package/locale/es/package.json +14 -0
- package/locale/es-419/index.cjs +3 -0
- package/locale/es-419/index.cjs.js +3 -0
- package/locale/es-419/index.js +1 -3
- package/locale/es-419/package.json +14 -0
- package/locale/es-AR/index.cjs +3 -0
- package/locale/es-AR/index.cjs.js +3 -0
- package/locale/es-AR/index.js +1 -3
- package/locale/es-AR/package.json +14 -0
- package/locale/es-BO/index.cjs +3 -0
- package/locale/es-BO/index.cjs.js +3 -0
- package/locale/es-BO/index.js +1 -3
- package/locale/es-BO/package.json +14 -0
- package/locale/es-BR/index.cjs +3 -0
- package/locale/es-BR/index.cjs.js +3 -0
- package/locale/es-BR/index.js +1 -3
- package/locale/es-BR/package.json +14 -0
- package/locale/es-BZ/index.cjs +3 -0
- package/locale/es-BZ/index.cjs.js +3 -0
- package/locale/es-BZ/index.js +1 -3
- package/locale/es-BZ/package.json +14 -0
- package/locale/es-CL/index.cjs +3 -0
- package/locale/es-CL/index.cjs.js +3 -0
- package/locale/es-CL/index.js +1 -3
- package/locale/es-CL/package.json +14 -0
- package/locale/es-CO/index.cjs +3 -0
- package/locale/es-CO/index.cjs.js +3 -0
- package/locale/es-CO/index.js +1 -3
- package/locale/es-CO/package.json +14 -0
- package/locale/es-CR/index.cjs +3 -0
- package/locale/es-CR/index.cjs.js +3 -0
- package/locale/es-CR/index.js +1 -3
- package/locale/es-CR/package.json +14 -0
- package/locale/es-CU/index.cjs +3 -0
- package/locale/es-CU/index.cjs.js +3 -0
- package/locale/es-CU/index.js +1 -3
- package/locale/es-CU/package.json +14 -0
- package/locale/es-DO/index.cjs +3 -0
- package/locale/es-DO/index.cjs.js +3 -0
- package/locale/es-DO/index.js +1 -3
- package/locale/es-DO/package.json +14 -0
- package/locale/es-EC/index.cjs +3 -0
- package/locale/es-EC/index.cjs.js +3 -0
- package/locale/es-EC/index.js +1 -3
- package/locale/es-EC/package.json +14 -0
- package/locale/es-GT/index.cjs +3 -0
- package/locale/es-GT/index.cjs.js +3 -0
- package/locale/es-GT/index.js +1 -3
- package/locale/es-GT/package.json +14 -0
- package/locale/es-HN/index.cjs +3 -0
- package/locale/es-HN/index.cjs.js +3 -0
- package/locale/es-HN/index.js +1 -3
- package/locale/es-HN/package.json +14 -0
- package/locale/es-MX/index.cjs +3 -0
- package/locale/es-MX/index.cjs.js +3 -0
- package/locale/es-MX/index.js +1 -3
- package/locale/es-MX/package.json +14 -0
- package/locale/es-NI/index.cjs +3 -0
- package/locale/es-NI/index.cjs.js +3 -0
- package/locale/es-NI/index.js +1 -3
- package/locale/es-NI/package.json +14 -0
- package/locale/es-PA/index.cjs +3 -0
- package/locale/es-PA/index.cjs.js +3 -0
- package/locale/es-PA/index.js +1 -3
- package/locale/es-PA/package.json +14 -0
- package/locale/es-PE/index.cjs +3 -0
- package/locale/es-PE/index.cjs.js +3 -0
- package/locale/es-PE/index.js +1 -3
- package/locale/es-PE/package.json +14 -0
- package/locale/es-PR/index.cjs +3 -0
- package/locale/es-PR/index.cjs.js +3 -0
- package/locale/es-PR/index.js +1 -3
- package/locale/es-PR/package.json +14 -0
- package/locale/es-PY/index.cjs +3 -0
- package/locale/es-PY/index.cjs.js +3 -0
- package/locale/es-PY/index.js +1 -3
- package/locale/es-PY/package.json +14 -0
- package/locale/es-SV/index.cjs +3 -0
- package/locale/es-SV/index.cjs.js +3 -0
- package/locale/es-SV/index.js +1 -3
- package/locale/es-SV/package.json +14 -0
- package/locale/es-US/index.cjs +3 -0
- package/locale/es-US/index.cjs.js +3 -0
- package/locale/es-US/index.js +1 -3
- package/locale/es-US/package.json +14 -0
- package/locale/es-UY/index.cjs +3 -0
- package/locale/es-UY/index.cjs.js +3 -0
- package/locale/es-UY/index.js +1 -3
- package/locale/es-UY/package.json +14 -0
- package/locale/es-VE/index.cjs +3 -0
- package/locale/es-VE/index.cjs.js +3 -0
- package/locale/es-VE/index.js +1 -3
- package/locale/es-VE/package.json +14 -0
- package/locale/et/index.cjs +3 -0
- package/locale/et/index.cjs.js +3 -0
- package/locale/et/index.js +1 -3
- package/locale/et/package.json +14 -0
- package/locale/eu/index.cjs +3 -0
- package/locale/eu/index.cjs.js +3 -0
- package/locale/eu/index.js +1 -3
- package/locale/eu/package.json +14 -0
- package/locale/fa/index.cjs +3 -0
- package/locale/fa/index.cjs.js +3 -0
- package/locale/fa/index.js +1 -3
- package/locale/fa/package.json +14 -0
- package/locale/ff-Adlm/index.cjs +3 -0
- package/locale/ff-Adlm/index.cjs.js +3 -0
- package/locale/ff-Adlm/index.js +1 -3
- package/locale/ff-Adlm/package.json +14 -0
- package/locale/fi/index.cjs +3 -0
- package/locale/fi/index.cjs.js +3 -0
- package/locale/fi/index.js +1 -3
- package/locale/fi/package.json +14 -0
- package/locale/fil/index.cjs +3 -0
- package/locale/fil/index.cjs.js +3 -0
- package/locale/fil/index.js +1 -3
- package/locale/fil/package.json +14 -0
- package/locale/fo/index.cjs +3 -0
- package/locale/fo/index.cjs.js +3 -0
- package/locale/fo/index.js +1 -3
- package/locale/fo/package.json +14 -0
- package/locale/fr/index.cjs +3 -0
- package/locale/fr/index.cjs.js +3 -0
- package/locale/fr/index.js +1 -3
- package/locale/fr/package.json +14 -0
- package/locale/fr-CA/index.cjs +3 -0
- package/locale/fr-CA/index.cjs.js +3 -0
- package/locale/fr-CA/index.js +1 -3
- package/locale/fr-CA/package.json +14 -0
- package/locale/fur/index.cjs +3 -0
- package/locale/fur/index.cjs.js +3 -0
- package/locale/fur/index.js +1 -3
- package/locale/fur/package.json +14 -0
- package/locale/fy/index.cjs +3 -0
- package/locale/fy/index.cjs.js +3 -0
- package/locale/fy/index.js +1 -3
- package/locale/fy/package.json +14 -0
- package/locale/ga/index.cjs +3 -0
- package/locale/ga/index.cjs.js +3 -0
- package/locale/ga/index.js +1 -3
- package/locale/ga/package.json +14 -0
- package/locale/gd/index.cjs +3 -0
- package/locale/gd/index.cjs.js +3 -0
- package/locale/gd/index.js +1 -3
- package/locale/gd/package.json +14 -0
- package/locale/gl/index.cjs +3 -0
- package/locale/gl/index.cjs.js +3 -0
- package/locale/gl/index.js +1 -3
- package/locale/gl/package.json +14 -0
- package/locale/gu/index.cjs +3 -0
- package/locale/gu/index.cjs.js +3 -0
- package/locale/gu/index.js +1 -3
- package/locale/gu/package.json +14 -0
- package/locale/ha/index.cjs +3 -0
- package/locale/ha/index.cjs.js +3 -0
- package/locale/ha/index.js +1 -3
- package/locale/ha/package.json +14 -0
- package/locale/he/index.cjs +3 -0
- package/locale/he/index.cjs.js +3 -0
- package/locale/he/index.js +1 -3
- package/locale/he/package.json +14 -0
- package/locale/hi/index.cjs +3 -0
- package/locale/hi/index.cjs.js +3 -0
- package/locale/hi/index.js +1 -3
- package/locale/hi/package.json +14 -0
- package/locale/hi-Latn/index.cjs +3 -0
- package/locale/hi-Latn/index.cjs.js +3 -0
- package/locale/hi-Latn/index.js +1 -0
- package/locale/hi-Latn/package.json +14 -0
- package/locale/hi-Latn.json +183 -0
- package/locale/hr/index.cjs +3 -0
- package/locale/hr/index.cjs.js +3 -0
- package/locale/hr/index.js +1 -3
- package/locale/hr/package.json +14 -0
- package/locale/hsb/index.cjs +3 -0
- package/locale/hsb/index.cjs.js +3 -0
- package/locale/hsb/index.js +1 -3
- package/locale/hsb/package.json +14 -0
- package/locale/hu/index.cjs +3 -0
- package/locale/hu/index.cjs.js +3 -0
- package/locale/hu/index.js +1 -3
- package/locale/hu/package.json +14 -0
- package/locale/hy/index.cjs +3 -0
- package/locale/hy/index.cjs.js +3 -0
- package/locale/hy/index.js +1 -3
- package/locale/hy/package.json +14 -0
- package/locale/ia/index.cjs +3 -0
- package/locale/ia/index.cjs.js +3 -0
- package/locale/ia/index.js +1 -3
- package/locale/ia/package.json +14 -0
- package/locale/id/index.cjs +3 -0
- package/locale/id/index.cjs.js +3 -0
- package/locale/id/index.js +1 -3
- package/locale/id/package.json +14 -0
- package/locale/ig/index.cjs +3 -0
- package/locale/ig/index.cjs.js +3 -0
- package/locale/ig/index.js +1 -3
- package/locale/ig/package.json +14 -0
- package/locale/is/index.cjs +3 -0
- package/locale/is/index.cjs.js +3 -0
- package/locale/is/index.js +1 -3
- package/locale/is/package.json +14 -0
- package/locale/it/index.cjs +3 -0
- package/locale/it/index.cjs.js +3 -0
- package/locale/it/index.js +1 -3
- package/locale/it/package.json +14 -0
- package/locale/ja/index.cjs +3 -0
- package/locale/ja/index.cjs.js +3 -0
- package/locale/ja/index.js +1 -3
- package/locale/ja/package.json +14 -0
- package/locale/jgo/index.cjs +3 -0
- package/locale/jgo/index.cjs.js +3 -0
- package/locale/jgo/index.js +1 -3
- package/locale/jgo/package.json +14 -0
- package/locale/jv/index.cjs +3 -0
- package/locale/jv/index.cjs.js +3 -0
- package/locale/jv/index.js +1 -3
- package/locale/jv/package.json +14 -0
- package/locale/ka/index.cjs +3 -0
- package/locale/ka/index.cjs.js +3 -0
- package/locale/ka/index.js +1 -3
- package/locale/ka/package.json +14 -0
- package/locale/kea/index.cjs +3 -0
- package/locale/kea/index.cjs.js +3 -0
- package/locale/kea/index.js +1 -3
- package/locale/kea/package.json +14 -0
- package/locale/kgp/index.cjs +3 -0
- package/locale/kgp/index.cjs.js +3 -0
- package/locale/kgp/index.js +1 -3
- package/locale/kgp/package.json +14 -0
- package/locale/kk/index.cjs +3 -0
- package/locale/kk/index.cjs.js +3 -0
- package/locale/kk/index.js +1 -3
- package/locale/kk/package.json +14 -0
- package/locale/kl/index.cjs +3 -0
- package/locale/kl/index.cjs.js +3 -0
- package/locale/kl/index.js +1 -3
- package/locale/kl/package.json +14 -0
- package/locale/km/index.cjs +3 -0
- package/locale/km/index.cjs.js +3 -0
- package/locale/km/index.js +1 -3
- package/locale/km/package.json +14 -0
- package/locale/kn/index.cjs +3 -0
- package/locale/kn/index.cjs.js +3 -0
- package/locale/kn/index.js +1 -3
- package/locale/kn/package.json +14 -0
- package/locale/ko/index.cjs +3 -0
- package/locale/ko/index.cjs.js +3 -0
- package/locale/ko/index.js +1 -3
- package/locale/ko/package.json +14 -0
- package/locale/kok/index.cjs +3 -0
- package/locale/kok/index.cjs.js +3 -0
- package/locale/kok/index.js +1 -3
- package/locale/kok/package.json +14 -0
- package/locale/ksh/index.cjs +3 -0
- package/locale/ksh/index.cjs.js +3 -0
- package/locale/ksh/index.js +1 -3
- package/locale/ksh/package.json +14 -0
- package/locale/ku/index.cjs +3 -0
- package/locale/ku/index.cjs.js +3 -0
- package/locale/ku/index.js +1 -3
- package/locale/ku/package.json +14 -0
- package/locale/ky/index.cjs +3 -0
- package/locale/ky/index.cjs.js +3 -0
- package/locale/ky/index.js +1 -3
- package/locale/ky/package.json +14 -0
- package/locale/lb/index.cjs +3 -0
- package/locale/lb/index.cjs.js +3 -0
- package/locale/lb/index.js +1 -3
- package/locale/lb/package.json +14 -0
- package/locale/lkt/index.cjs +3 -0
- package/locale/lkt/index.cjs.js +3 -0
- package/locale/lkt/index.js +1 -3
- package/locale/lkt/package.json +14 -0
- package/locale/lo/index.cjs +3 -0
- package/locale/lo/index.cjs.js +3 -0
- package/locale/lo/index.js +1 -3
- package/locale/lo/package.json +14 -0
- package/locale/lt/index.cjs +3 -0
- package/locale/lt/index.cjs.js +3 -0
- package/locale/lt/index.js +1 -3
- package/locale/lt/package.json +14 -0
- package/locale/lv/index.cjs +3 -0
- package/locale/lv/index.cjs.js +3 -0
- package/locale/lv/index.js +1 -3
- package/locale/lv/package.json +14 -0
- package/locale/mk/index.cjs +3 -0
- package/locale/mk/index.cjs.js +3 -0
- package/locale/mk/index.js +1 -3
- package/locale/mk/package.json +14 -0
- package/locale/ml/index.cjs +3 -0
- package/locale/ml/index.cjs.js +3 -0
- package/locale/ml/index.js +1 -3
- package/locale/ml/package.json +14 -0
- package/locale/mn/index.cjs +3 -0
- package/locale/mn/index.cjs.js +3 -0
- package/locale/mn/index.js +1 -3
- package/locale/mn/package.json +14 -0
- package/locale/mni/index.cjs +3 -0
- package/locale/mni/index.cjs.js +3 -0
- package/locale/mni/index.js +1 -3
- package/locale/mni/package.json +14 -0
- package/locale/mr/index.cjs +3 -0
- package/locale/mr/index.cjs.js +3 -0
- package/locale/mr/index.js +1 -3
- package/locale/mr/package.json +14 -0
- package/locale/ms/index.cjs +3 -0
- package/locale/ms/index.cjs.js +3 -0
- package/locale/ms/index.js +1 -3
- package/locale/ms/package.json +14 -0
- package/locale/mt/index.cjs +3 -0
- package/locale/mt/index.cjs.js +3 -0
- package/locale/mt/index.js +1 -3
- package/locale/mt/package.json +14 -0
- package/locale/my/index.cjs +3 -0
- package/locale/my/index.cjs.js +3 -0
- package/locale/my/index.js +1 -3
- package/locale/my/package.json +14 -0
- package/locale/mzn/index.cjs +3 -0
- package/locale/mzn/index.cjs.js +3 -0
- package/locale/mzn/index.js +1 -3
- package/locale/mzn/package.json +14 -0
- package/locale/nb/index.cjs +3 -0
- package/locale/nb/index.cjs.js +3 -0
- package/locale/nb/index.js +1 -3
- package/locale/nb/package.json +14 -0
- package/locale/ne/index.cjs +3 -0
- package/locale/ne/index.cjs.js +3 -0
- package/locale/ne/index.js +1 -3
- package/locale/ne/package.json +14 -0
- package/locale/nl/index.cjs +3 -0
- package/locale/nl/index.cjs.js +3 -0
- package/locale/nl/index.js +1 -3
- package/locale/nl/package.json +14 -0
- package/locale/nn/index.cjs +3 -0
- package/locale/nn/index.cjs.js +3 -0
- package/locale/nn/index.js +1 -3
- package/locale/nn/package.json +14 -0
- package/locale/no/index.cjs +3 -0
- package/locale/no/index.cjs.js +3 -0
- package/locale/no/index.js +1 -3
- package/locale/no/package.json +14 -0
- package/locale/or/index.cjs +3 -0
- package/locale/or/index.cjs.js +3 -0
- package/locale/or/index.js +1 -3
- package/locale/or/package.json +14 -0
- package/locale/pa/index.cjs +3 -0
- package/locale/pa/index.cjs.js +3 -0
- package/locale/pa/index.js +1 -3
- package/locale/pa/package.json +14 -0
- package/locale/pcm/index.cjs +3 -0
- package/locale/pcm/index.cjs.js +3 -0
- package/locale/pcm/index.js +1 -3
- package/locale/pcm/package.json +14 -0
- package/locale/pl/index.cjs +3 -0
- package/locale/pl/index.cjs.js +3 -0
- package/locale/pl/index.js +1 -3
- package/locale/pl/package.json +14 -0
- package/locale/ps/index.cjs +3 -0
- package/locale/ps/index.cjs.js +3 -0
- package/locale/ps/index.js +1 -3
- package/locale/ps/package.json +14 -0
- package/locale/ps-PK/index.cjs +3 -0
- package/locale/ps-PK/index.cjs.js +3 -0
- package/locale/ps-PK/index.js +1 -3
- package/locale/ps-PK/package.json +14 -0
- package/locale/pt/index.cjs +3 -0
- package/locale/pt/index.cjs.js +3 -0
- package/locale/pt/index.js +1 -3
- package/locale/pt/package.json +14 -0
- package/locale/pt-AO/index.cjs +3 -0
- package/locale/pt-AO/index.cjs.js +3 -0
- package/locale/pt-AO/index.js +1 -3
- package/locale/pt-AO/package.json +14 -0
- package/locale/pt-CH/index.cjs +3 -0
- package/locale/pt-CH/index.cjs.js +3 -0
- package/locale/pt-CH/index.js +1 -3
- package/locale/pt-CH/package.json +14 -0
- package/locale/pt-CV/index.cjs +3 -0
- package/locale/pt-CV/index.cjs.js +3 -0
- package/locale/pt-CV/index.js +1 -3
- package/locale/pt-CV/package.json +14 -0
- package/locale/pt-GQ/index.cjs +3 -0
- package/locale/pt-GQ/index.cjs.js +3 -0
- package/locale/pt-GQ/index.js +1 -3
- package/locale/pt-GQ/package.json +14 -0
- package/locale/pt-GW/index.cjs +3 -0
- package/locale/pt-GW/index.cjs.js +3 -0
- package/locale/pt-GW/index.js +1 -3
- package/locale/pt-GW/package.json +14 -0
- package/locale/pt-LU/index.cjs +3 -0
- package/locale/pt-LU/index.cjs.js +3 -0
- package/locale/pt-LU/index.js +1 -3
- package/locale/pt-LU/package.json +14 -0
- package/locale/pt-MO/index.cjs +3 -0
- package/locale/pt-MO/index.cjs.js +3 -0
- package/locale/pt-MO/index.js +1 -3
- package/locale/pt-MO/package.json +14 -0
- package/locale/pt-MZ/index.cjs +3 -0
- package/locale/pt-MZ/index.cjs.js +3 -0
- package/locale/pt-MZ/index.js +1 -3
- package/locale/pt-MZ/package.json +14 -0
- package/locale/pt-PT/index.cjs +3 -0
- package/locale/pt-PT/index.cjs.js +3 -0
- package/locale/pt-PT/index.js +1 -3
- package/locale/pt-PT/package.json +14 -0
- package/locale/pt-ST/index.cjs +3 -0
- package/locale/pt-ST/index.cjs.js +3 -0
- package/locale/pt-ST/index.js +1 -3
- package/locale/pt-ST/package.json +14 -0
- package/locale/pt-TL/index.cjs +3 -0
- package/locale/pt-TL/index.cjs.js +3 -0
- package/locale/pt-TL/index.js +1 -3
- package/locale/pt-TL/package.json +14 -0
- package/locale/qu/index.cjs +3 -0
- package/locale/qu/index.cjs.js +3 -0
- package/locale/qu/index.js +1 -3
- package/locale/qu/package.json +14 -0
- package/locale/rm/index.cjs +3 -0
- package/locale/rm/index.cjs.js +3 -0
- package/locale/rm/index.js +1 -3
- package/locale/rm/package.json +14 -0
- package/locale/ro/index.cjs +3 -0
- package/locale/ro/index.cjs.js +3 -0
- package/locale/ro/index.js +1 -3
- package/locale/ro/package.json +14 -0
- package/locale/ru/index.cjs +3 -0
- package/locale/ru/index.cjs.js +3 -0
- package/locale/ru/index.js +1 -3
- package/locale/ru/package.json +14 -0
- package/locale/sah/index.cjs +3 -0
- package/locale/sah/index.cjs.js +3 -0
- package/locale/sah/index.js +1 -3
- package/locale/sah/package.json +14 -0
- package/locale/sc/index.cjs +3 -0
- package/locale/sc/index.cjs.js +3 -0
- package/locale/sc/index.js +1 -3
- package/locale/sc/package.json +14 -0
- package/locale/sd/index.cjs +3 -0
- package/locale/sd/index.cjs.js +3 -0
- package/locale/sd/index.js +1 -3
- package/locale/sd/package.json +14 -0
- package/locale/se/index.cjs +3 -0
- package/locale/se/index.cjs.js +3 -0
- package/locale/se/index.js +1 -3
- package/locale/se/package.json +14 -0
- package/locale/se-FI/index.cjs +3 -0
- package/locale/se-FI/index.cjs.js +3 -0
- package/locale/se-FI/index.js +1 -3
- package/locale/se-FI/package.json +14 -0
- package/locale/si/index.cjs +3 -0
- package/locale/si/index.cjs.js +3 -0
- package/locale/si/index.js +1 -3
- package/locale/si/package.json +14 -0
- package/locale/sk/index.cjs +3 -0
- package/locale/sk/index.cjs.js +3 -0
- package/locale/sk/index.js +1 -3
- package/locale/sk/package.json +14 -0
- package/locale/sl/index.cjs +3 -0
- package/locale/sl/index.cjs.js +3 -0
- package/locale/sl/index.js +1 -3
- package/locale/sl/package.json +14 -0
- package/locale/so/index.cjs +3 -0
- package/locale/so/index.cjs.js +3 -0
- package/locale/so/index.js +1 -3
- package/locale/so/package.json +14 -0
- package/locale/sq/index.cjs +3 -0
- package/locale/sq/index.cjs.js +3 -0
- package/locale/sq/index.js +1 -3
- package/locale/sq/package.json +14 -0
- package/locale/sr/index.cjs +3 -0
- package/locale/sr/index.cjs.js +3 -0
- package/locale/sr/index.js +1 -3
- package/locale/sr/package.json +14 -0
- package/locale/sr-Cyrl-BA/index.cjs +3 -0
- package/locale/sr-Cyrl-BA/index.cjs.js +3 -0
- package/locale/sr-Cyrl-BA/index.js +1 -3
- package/locale/sr-Cyrl-BA/package.json +14 -0
- package/locale/sr-Latn/index.cjs +3 -0
- package/locale/sr-Latn/index.cjs.js +3 -0
- package/locale/sr-Latn/index.js +1 -3
- package/locale/sr-Latn/package.json +14 -0
- package/locale/sr-Latn-BA/index.cjs +3 -0
- package/locale/sr-Latn-BA/index.cjs.js +3 -0
- package/locale/sr-Latn-BA/index.js +1 -3
- package/locale/sr-Latn-BA/package.json +14 -0
- package/locale/su/index.cjs +3 -0
- package/locale/su/index.cjs.js +3 -0
- package/locale/su/index.js +1 -3
- package/locale/su/package.json +14 -0
- package/locale/sv/index.cjs +3 -0
- package/locale/sv/index.cjs.js +3 -0
- package/locale/sv/index.js +1 -3
- package/locale/sv/package.json +14 -0
- package/locale/sw/index.cjs +3 -0
- package/locale/sw/index.cjs.js +3 -0
- package/locale/sw/index.js +1 -3
- package/locale/sw/package.json +14 -0
- package/locale/ta/index.cjs +3 -0
- package/locale/ta/index.cjs.js +3 -0
- package/locale/ta/index.js +1 -3
- package/locale/ta/package.json +14 -0
- package/locale/te/index.cjs +3 -0
- package/locale/te/index.cjs.js +3 -0
- package/locale/te/index.js +1 -3
- package/locale/te/package.json +14 -0
- package/locale/tg/index.cjs +3 -0
- package/locale/tg/index.cjs.js +3 -0
- package/locale/tg/index.js +1 -3
- package/locale/tg/package.json +14 -0
- package/locale/th/index.cjs +3 -0
- package/locale/th/index.cjs.js +3 -0
- package/locale/th/index.js +1 -3
- package/locale/th/package.json +14 -0
- package/locale/ti/index.cjs +3 -0
- package/locale/ti/index.cjs.js +3 -0
- package/locale/ti/index.js +1 -3
- package/locale/ti/package.json +14 -0
- package/locale/tk/index.cjs +3 -0
- package/locale/tk/index.cjs.js +3 -0
- package/locale/tk/index.js +1 -3
- package/locale/tk/package.json +14 -0
- package/locale/to/index.cjs +3 -0
- package/locale/to/index.cjs.js +3 -0
- package/locale/to/index.js +1 -3
- package/locale/to/package.json +14 -0
- package/locale/tr/index.cjs +3 -0
- package/locale/tr/index.cjs.js +3 -0
- package/locale/tr/index.js +1 -3
- package/locale/tr/package.json +14 -0
- package/locale/tt/index.cjs +3 -0
- package/locale/tt/index.cjs.js +3 -0
- package/locale/tt/index.js +1 -3
- package/locale/tt/package.json +14 -0
- package/locale/ug/index.cjs +3 -0
- package/locale/ug/index.cjs.js +3 -0
- package/locale/ug/index.js +1 -3
- package/locale/ug/package.json +14 -0
- package/locale/uk/index.cjs +3 -0
- package/locale/uk/index.cjs.js +3 -0
- package/locale/uk/index.js +1 -3
- package/locale/uk/package.json +14 -0
- package/locale/ur/index.cjs +3 -0
- package/locale/ur/index.cjs.js +3 -0
- package/locale/ur/index.js +1 -3
- package/locale/ur/package.json +14 -0
- package/locale/ur-IN/index.cjs +3 -0
- package/locale/ur-IN/index.cjs.js +3 -0
- package/locale/ur-IN/index.js +1 -3
- package/locale/ur-IN/package.json +14 -0
- package/locale/uz/index.cjs +3 -0
- package/locale/uz/index.cjs.js +3 -0
- package/locale/uz/index.js +1 -3
- package/locale/uz/package.json +14 -0
- package/locale/uz-Cyrl/index.cjs +3 -0
- package/locale/uz-Cyrl/index.cjs.js +3 -0
- package/locale/uz-Cyrl/index.js +1 -3
- package/locale/uz-Cyrl/package.json +14 -0
- package/locale/vi/index.cjs +3 -0
- package/locale/vi/index.cjs.js +3 -0
- package/locale/vi/index.js +1 -3
- package/locale/vi/package.json +14 -0
- package/locale/wae/index.cjs +3 -0
- package/locale/wae/index.cjs.js +3 -0
- package/locale/wae/index.js +1 -3
- package/locale/wae/package.json +14 -0
- package/locale/wo/index.cjs +3 -0
- package/locale/wo/index.cjs.js +3 -0
- package/locale/wo/index.js +1 -3
- package/locale/wo/package.json +14 -0
- package/locale/yi/index.cjs +3 -0
- package/locale/yi/index.cjs.js +3 -0
- package/locale/yi/index.js +1 -3
- package/locale/yi/package.json +14 -0
- package/locale/yo/index.cjs +3 -0
- package/locale/yo/index.cjs.js +3 -0
- package/locale/yo/index.js +1 -3
- package/locale/yo/package.json +14 -0
- package/locale/yo-BJ/index.cjs +3 -0
- package/locale/yo-BJ/index.cjs.js +3 -0
- package/locale/yo-BJ/index.js +1 -3
- package/locale/yo-BJ/package.json +14 -0
- package/locale/yrl/index.cjs +3 -0
- package/locale/yrl/index.cjs.js +3 -0
- package/locale/yrl/index.js +1 -3
- package/locale/yrl/package.json +14 -0
- package/locale/yue/index.cjs +3 -0
- package/locale/yue/index.cjs.js +3 -0
- package/locale/yue/index.js +1 -3
- package/locale/yue/package.json +14 -0
- package/locale/yue-Hans/index.cjs +3 -0
- package/locale/yue-Hans/index.cjs.js +3 -0
- package/locale/yue-Hans/index.js +1 -3
- package/locale/yue-Hans/package.json +14 -0
- package/locale/zh/index.cjs +3 -0
- package/locale/zh/index.cjs.js +3 -0
- package/locale/zh/index.js +1 -3
- package/locale/zh/package.json +14 -0
- package/locale/zh-Hans-HK/index.cjs +3 -0
- package/locale/zh-Hans-HK/index.cjs.js +3 -0
- package/locale/zh-Hans-HK/index.js +1 -3
- package/locale/zh-Hans-HK/package.json +14 -0
- package/locale/zh-Hans-MO/index.cjs +3 -0
- package/locale/zh-Hans-MO/index.cjs.js +3 -0
- package/locale/zh-Hans-MO/index.js +1 -3
- package/locale/zh-Hans-MO/package.json +14 -0
- package/locale/zh-Hans-SG/index.cjs +3 -0
- package/locale/zh-Hans-SG/index.cjs.js +3 -0
- package/locale/zh-Hans-SG/index.js +1 -3
- package/locale/zh-Hans-SG/package.json +14 -0
- package/locale/zh-Hant/index.cjs +3 -0
- package/locale/zh-Hant/index.cjs.js +3 -0
- package/locale/zh-Hant/index.js +1 -3
- package/locale/zh-Hant/package.json +14 -0
- package/locale/zh-Hant-HK/index.cjs +3 -0
- package/locale/zh-Hant-HK/index.cjs.js +3 -0
- package/locale/zh-Hant-HK/index.js +1 -3
- package/locale/zh-Hant-HK/package.json +14 -0
- package/locale/zh-Hant-MO/index.cjs +3 -0
- package/locale/zh-Hant-MO/index.cjs.js +3 -0
- package/locale/zh-Hant-MO/index.js +1 -3
- package/locale/zh-Hant-MO/package.json +14 -0
- package/locale/zu/index.cjs +3 -0
- package/locale/zu/index.cjs.js +3 -0
- package/locale/zu/index.js +1 -3
- package/locale/zu/package.json +14 -0
- package/modules/LocaleDataStore.js.map +1 -1
- package/modules/PropTypes.js +7 -1
- package/modules/PropTypes.js.map +1 -1
- package/modules/TimeAgo.js +25 -32
- package/modules/TimeAgo.js.map +1 -1
- package/modules/TimeAgo.test.js +7 -7
- package/modules/TimeAgo.test.js.map +1 -1
- package/modules/cache.js +8 -12
- package/modules/cache.js.map +1 -1
- package/modules/cache.test.js +1 -1
- package/modules/cache.test.js.map +1 -1
- package/modules/isStyleObject.js +1 -1
- package/modules/isStyleObject.js.map +1 -1
- package/modules/isStyleObject.test.js +1 -1
- package/modules/isStyleObject.test.js.map +1 -1
- package/modules/locale.js +9 -14
- package/modules/locale.js.map +1 -1
- package/modules/locale.test.js +2 -2
- package/modules/locale.test.js.map +1 -1
- package/modules/round.js.map +1 -1
- package/modules/steps/approximate.js +1 -1
- package/modules/steps/approximate.js.map +1 -1
- package/modules/steps/approximate.test.js +2 -2
- package/modules/steps/approximate.test.js.map +1 -1
- package/modules/steps/getStep.js +6 -4
- package/modules/steps/getStep.js.map +1 -1
- package/modules/steps/getStep.test.js +5 -5
- package/modules/steps/getStep.test.js.map +1 -1
- package/modules/steps/getStepDenominator.js +1 -1
- package/modules/steps/getStepDenominator.js.map +1 -1
- package/modules/steps/getStepDenominator.test.js +1 -1
- package/modules/steps/getStepDenominator.test.js.map +1 -1
- package/modules/steps/getStepMinTime.js +4 -4
- package/modules/steps/getStepMinTime.js.map +1 -1
- package/modules/steps/getStepMinTime.test.js +1 -1
- package/modules/steps/getStepMinTime.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.js +3 -3
- package/modules/steps/getTimeToNextUpdate.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.test.js +1 -1
- package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.js +2 -2
- package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.test.js +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/modules/steps/helpers.js.map +1 -1
- package/modules/steps/helpers.test.js +1 -1
- package/modules/steps/helpers.test.js.map +1 -1
- package/modules/steps/index.js +4 -4
- package/modules/steps/index.js.map +1 -1
- package/modules/steps/renameLegacyProperties.js +7 -7
- package/modules/steps/renameLegacyProperties.js.map +1 -1
- package/modules/steps/renameLegacyProperties.test.js +2 -2
- package/modules/steps/renameLegacyProperties.test.js.map +1 -1
- package/modules/steps/round.js.map +1 -1
- package/modules/steps/round.test.js +2 -2
- package/modules/steps/round.test.js.map +1 -1
- package/modules/steps/units.js.map +1 -1
- package/modules/style/approximate.js +1 -1
- package/modules/style/approximate.js.map +1 -1
- package/modules/style/approximateTime.js +1 -1
- package/modules/style/approximateTime.js.map +1 -1
- package/modules/style/approximateTime.test.js +11 -16
- package/modules/style/approximateTime.test.js.map +1 -1
- package/modules/style/getStyleByName.js +13 -13
- package/modules/style/getStyleByName.js.map +1 -1
- package/modules/style/mini.js.map +1 -1
- package/modules/style/mini.test.js +8 -6
- package/modules/style/mini.test.js.map +1 -1
- package/modules/style/miniMinute.js +5 -3
- package/modules/style/miniMinute.js.map +1 -1
- package/modules/style/miniMinute.test.js +8 -6
- package/modules/style/miniMinute.test.js.map +1 -1
- package/modules/style/miniMinuteNow.js +5 -3
- package/modules/style/miniMinuteNow.js.map +1 -1
- package/modules/style/miniMinuteNow.test.js +8 -6
- package/modules/style/miniMinuteNow.test.js.map +1 -1
- package/modules/style/miniNow.js +5 -3
- package/modules/style/miniNow.js.map +1 -1
- package/modules/style/miniNow.test.js +8 -6
- package/modules/style/miniNow.test.js.map +1 -1
- package/modules/style/renameLegacyProperties.js +4 -2
- package/modules/style/renameLegacyProperties.js.map +1 -1
- package/modules/style/renameLegacyProperties.test.js +2 -2
- package/modules/style/renameLegacyProperties.test.js.map +1 -1
- package/modules/style/round.js +1 -1
- package/modules/style/round.js.map +1 -1
- package/modules/style/round.test.js +17 -11
- package/modules/style/round.test.js.map +1 -1
- package/modules/style/roundMinute.js +5 -3
- package/modules/style/roundMinute.js.map +1 -1
- package/modules/style/roundMinute.test.js +8 -6
- package/modules/style/roundMinute.test.js.map +1 -1
- package/modules/style/twitter.js +13 -13
- package/modules/style/twitter.js.map +1 -1
- package/modules/style/twitter.test.js +9 -7
- package/modules/style/twitter.test.js.map +1 -1
- package/modules/style/twitterFirstMinute.js +7 -5
- package/modules/style/twitterFirstMinute.js.map +1 -1
- package/modules/style/twitterFirstMinute.test.js +10 -8
- package/modules/style/twitterFirstMinute.test.js.map +1 -1
- package/modules/style/twitterMinute.js +5 -3
- package/modules/style/twitterMinute.js.map +1 -1
- package/modules/style/twitterMinute.test.js +10 -8
- package/modules/style/twitterMinute.test.js.map +1 -1
- package/modules/style/twitterMinuteNow.js +5 -3
- package/modules/style/twitterMinuteNow.js.map +1 -1
- package/modules/style/twitterMinuteNow.test.js +10 -8
- package/modules/style/twitterMinuteNow.test.js.map +1 -1
- package/modules/style/twitterNow.js +5 -3
- package/modules/style/twitterNow.js.map +1 -1
- package/modules/style/twitterNow.test.js +10 -8
- package/modules/style/twitterNow.test.js.map +1 -1
- package/package.json +671 -75
- package/prop-types/index.cjs +2 -0
- package/prop-types/index.cjs.js +7 -0
- package/prop-types/index.js +1 -1
- package/prop-types/package.json +9 -3
- package/{rollup.config.js → rollup.config.mjs} +0 -0
- package/steps/index.cjs +1 -0
- package/steps/index.cjs.js +6 -0
- package/steps/index.js +1 -1
- package/steps/package.json +9 -3
- package/cache/index.commonjs.js +0 -2
- package/gradation/index.commonjs.js +0 -2
- package/index.commonjs.js +0 -9
- package/load-all-locales.js +0 -278
- package/prop-types/index.commonjs.js +0 -2
- package/steps/index.commonjs.js +0 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "javascript-time-ago/locale/zh-Hant-HK",
|
|
3
|
+
"private": true,
|
|
4
|
+
"main": "index.cjs",
|
|
5
|
+
"module": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js",
|
|
10
|
+
"require": "./index.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "javascript-time-ago/locale/zh-Hant-MO",
|
|
3
|
+
"private": true,
|
|
4
|
+
"main": "index.cjs",
|
|
5
|
+
"module": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js",
|
|
10
|
+
"require": "./index.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false
|
|
14
|
+
}
|
package/locale/zu/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,EAApB;AAEA,OAAO,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;EACrC,OAAOF,WAAW,CAACE,MAAD,CAAlB;AACA;AAED,OAAO,SAASC,aAAT,CAAuBC,UAAvB,EAAmC;EACzC,IAAI,CAACA,UAAL,EAAiB;IAChB,MAAM,IAAIC,KAAJ,CAAU,8CAAV,CAAN;EACA,CAHwC,CAIzC;EACA;;;EACAL,WAAW,CAACI,UAAU,CAACF,MAAZ,CAAX,GAAiCE,UAAjC;AACA"}
|
package/modules/PropTypes.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// Deprecated: Moved to `react-time-ago`.
|
|
2
|
-
import
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
var oneOfType = PropTypes.oneOfType,
|
|
4
|
+
arrayOf = PropTypes.arrayOf,
|
|
5
|
+
string = PropTypes.string,
|
|
6
|
+
number = PropTypes.number,
|
|
7
|
+
shape = PropTypes.shape,
|
|
8
|
+
func = PropTypes.func; // The first step isn't required to define `minTime` or `test()`.
|
|
3
9
|
|
|
4
10
|
var step = oneOfType([shape({
|
|
5
11
|
minTime: number,
|
package/modules/PropTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"PropTypes.js","names":["PropTypes","oneOfType","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":"AAAA;AAEA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,IACCC,SADD,GAOID,SAPJ,CACCC,SADD;AAAA,IAECC,OAFD,GAOIF,SAPJ,CAECE,OAFD;AAAA,IAGCC,MAHD,GAOIH,SAPJ,CAGCG,MAHD;AAAA,IAICC,MAJD,GAOIJ,SAPJ,CAICI,MAJD;AAAA,IAKCC,KALD,GAOIL,SAPJ,CAKCK,KALD;AAAA,IAMCC,IAND,GAOIN,SAPJ,CAMCM,IAND,C,CASA;;AACA,IAAMC,IAAI,GAAGN,SAAS,CAAC,CACtBI,KAAK,CAAC;EACLG,OAAO,EAAEJ,MADJ;EAELK,QAAQ,EAAEN,MAAM,CAACO;AAFZ,CAAD,CADiB,EAKtBL,KAAK,CAAC;EACLM,IAAI,EAAEL,IADD;EAELG,QAAQ,EAAEN,MAAM,CAACO;AAFZ,CAAD,CALiB,EAStBL,KAAK,CAAC;EACLG,OAAO,EAAEJ,MADJ;EAELQ,MAAM,EAAEN,IAAI,CAACI;AAFR,CAAD,CATiB,EAatBL,KAAK,CAAC;EACLM,IAAI,EAAEL,IADD;EAELM,MAAM,EAAEN,IAAI,CAACI;AAFR,CAAD,CAbiB,CAAD,CAAtB,C,CAmBA;;AACA,OAAO,IAAMG,KAAK,GAAGZ,SAAS,CAAC,CAC9B;AACA;AACA;AACAE,MAJ8B,EAK9BE,KAAK,CAAC;EACLS,KAAK,EAAEZ,OAAO,CAACK,IAAD,CAAP,CAAcG,UADhB;EAELK,MAAM,EAAEd,SAAS,CAAC,CACjBE,MADiB,EAEjBD,OAAO,CAACC,MAAD,CAFU,CAAD,CAAT,CAGLO;AALE,CAAD,CALyB,CAAD,CAAvB"}
|
package/modules/TimeAgo.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
function _typeof(obj) {
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
+
|
|
13
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
14
|
|
|
9
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
16
|
|
|
@@ -12,26 +18,24 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
12
18
|
|
|
13
19
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
20
|
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
22
|
|
|
17
23
|
import RelativeTimeFormatPolyfill from 'relative-time-format';
|
|
18
|
-
import Cache from './cache';
|
|
19
|
-
import chooseLocale from './locale';
|
|
20
|
-
import isStyleObject from './isStyleObject';
|
|
21
|
-
import getStep from './steps/getStep';
|
|
22
|
-
import getStepDenominator from './steps/getStepDenominator';
|
|
23
|
-
import getTimeToNextUpdate from './steps/getTimeToNextUpdate';
|
|
24
|
-
import { addLocaleData, getLocaleData } from './LocaleDataStore';
|
|
25
|
-
import defaultStyle from './style/roundMinute';
|
|
26
|
-
import getStyleByName from './style/getStyleByName';
|
|
27
|
-
import { getRoundFunction } from './round'; // Valid time units.
|
|
24
|
+
import Cache from './cache.js';
|
|
25
|
+
import chooseLocale from './locale.js';
|
|
26
|
+
import isStyleObject from './isStyleObject.js';
|
|
27
|
+
import getStep from './steps/getStep.js';
|
|
28
|
+
import getStepDenominator from './steps/getStepDenominator.js';
|
|
29
|
+
import getTimeToNextUpdate from './steps/getTimeToNextUpdate.js';
|
|
30
|
+
import { addLocaleData, getLocaleData } from './LocaleDataStore.js';
|
|
31
|
+
import defaultStyle from './style/roundMinute.js';
|
|
32
|
+
import getStyleByName from './style/getStyleByName.js';
|
|
33
|
+
import { getRoundFunction } from './round.js'; // Valid time units.
|
|
28
34
|
|
|
29
35
|
var UNITS = ['now', // The rest are the same as in `Intl.RelativeTimeFormat`.
|
|
30
36
|
'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'];
|
|
31
37
|
|
|
32
|
-
var TimeAgo =
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
function () {
|
|
38
|
+
var TimeAgo = /*#__PURE__*/function () {
|
|
35
39
|
/**
|
|
36
40
|
* @param {(string|string[])} locales=[] - Preferred locales (or locale).
|
|
37
41
|
* @param {boolean} [polyfill] — Pass `false` to use native `Intl.RelativeTimeFormat` and `Intl.PluralRules` instead of the polyfills.
|
|
@@ -146,7 +150,7 @@ function () {
|
|
|
146
150
|
var secondsPassed = (now - timestamp) / 1000; // in seconds
|
|
147
151
|
|
|
148
152
|
var future = options.future || secondsPassed < 0;
|
|
149
|
-
var nowLabel = getNowLabel(labels, getLocaleData(this.locale).now, getLocaleData(this.locale)
|
|
153
|
+
var nowLabel = getNowLabel(labels, getLocaleData(this.locale).now, getLocaleData(this.locale)["long"], future); // `custom` – A function of `{ elapsed, time, date, now, locale }`.
|
|
150
154
|
//
|
|
151
155
|
// Looks like `custom` function is deprecated and will be removed
|
|
152
156
|
// in the next major version.
|
|
@@ -455,19 +459,8 @@ function () {
|
|
|
455
459
|
|
|
456
460
|
var localeData = getLocaleData(this.locale);
|
|
457
461
|
|
|
458
|
-
for (var _iterator = labelsType,
|
|
459
|
-
var
|
|
460
|
-
|
|
461
|
-
if (_isArray) {
|
|
462
|
-
if (_i2 >= _iterator.length) break;
|
|
463
|
-
_ref5 = _iterator[_i2++];
|
|
464
|
-
} else {
|
|
465
|
-
_i2 = _iterator.next();
|
|
466
|
-
if (_i2.done) break;
|
|
467
|
-
_ref5 = _i2.value;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
var _labelsType = _ref5;
|
|
462
|
+
for (var _iterator = _createForOfIteratorHelperLoose(labelsType), _step; !(_step = _iterator()).done;) {
|
|
463
|
+
var _labelsType = _step.value;
|
|
471
464
|
|
|
472
465
|
if (localeData[_labelsType]) {
|
|
473
466
|
return {
|
package/modules/TimeAgo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../source/TimeAgo.js"],"names":["RelativeTimeFormatPolyfill","Cache","chooseLocale","isStyleObject","getStep","getStepDenominator","getTimeToNextUpdate","addLocaleData","getLocaleData","defaultStyle","getStyleByName","getRoundFunction","UNITS","TimeAgo","locales","polyfill","locale","concat","getDefaultLocale","Intl","NumberFormat","numberFormat","IntlRelativeTimeFormat","RelativeTimeFormat","IntlPluralRules","PluralRules","relativeTimeFormatCache","pluralRulesCache","input","style","options","isStyle","undefined","timestamp","getTimestamp","getLabels","flavour","labels","labelsType","now","Date","secondsPassed","future","nowLabel","getNowLabel","long","custom","date","time","elapsed","units","getTimeIntervalMeasurementUnits","round","gradation","steps","getNextStep","prevStep","step","nextStep","formattedDate","formatDateForStep","timeToNextUpdate","format","formatAs","unit","value","formatValue","Error","JSON","stringify","amount","Math","abs","granularity","valueForFormatting","sign","getFormatter","getFormattingRule","replace","formatNumber","formattingRules","pastOrFuture","quantifierRules","quantifier","getPluralRules","select","other","number","String","get","put","map","localeData","_labelsType","defaultLocale","setDefaultLocale","addDefaultLocale","defaultLocaleHasBeenSpecified","console","error","addLocale","addLabels","name","constructor","isMockedDate","getTime","object","allowedUnits","Object","keys","push","filter","indexOf","nowLabels","longLabels","past","second","current","variable"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAOA,0BAAP,MAAuC,sBAAvC;AAEA,OAAOC,KAAP,MAAkB,SAAlB;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,OAAOC,OAAP,MAAoB,iBAApB;AACA,OAAOC,kBAAP,MAA+B,4BAA/B;AACA,OAAOC,mBAAP,MAAgC,6BAAhC;AAEA,SACCC,aADD,EAECC,aAFD,QAGO,mBAHP;AAKA,OAAOC,YAAP,MAAyB,qBAAzB;AACA,OAAOC,cAAP,MAA2B,wBAA3B;AAEA,SAASC,gBAAT,QAAiC,SAAjC,C,CAEA;;AACA,IAAMC,KAAK,GAAG,CACb,KADa,EAEb;AACA,QAHa,EAIb,QAJa,EAKb,MALa,EAMb,KANa,EAOb,MAPa,EAQb,OARa,EASb,SATa,EAUb,MAVa,CAAd;;IAaqBC,O;;;AACpB;;;;AAIA,qBAA6C;AAAA,QAAjCC,OAAiC,uEAAvB,EAAuB;;AAAA,mFAAJ,EAAI;AAAA,QAAjBC,QAAiB,QAAjBA,QAAiB;;AAAA;;AAC5C;AACA,QAAI,OAAOD,OAAP,KAAmB,QAAvB,EAAiC;AAChCA,MAAAA,OAAO,GAAG,CAACA,OAAD,CAAV;AACA,KAJ2C,CAM5C;AACA;AACA;;;AACA,SAAKE,MAAL,GAAcd,YA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ASN,WAAT,CAAqBP,MAArB,EAA6B4E,SAA7B,EAAwCC,UAAxC,EAAoDxE,MAApD,EAA4D;AAC3D,MAAMC,QAAQ,GAAGN,MAAM,CAACE,GAAP,IAAe0E,SAAS,IAAIA,SAAS,CAAC1E,GAAvD,CAD2D,CAE3D;;AACA,MAAII,QAAJ,EAAc;AACb;AACA,QAAI,OAAOA,QAAP,KAAoB,QAAxB,EAAkC;AACjC,aAAOA,QAAP;AACA,KAJY,CAKb;AACA;AACA;AACA;AACA;;;AACA,QAAID,MAAJ,EAAY;AACX,aAAOC,QAAQ,CAACD,MAAhB;AACA,KAFD,MAEO;AACN,aAAOC,QAAQ,CAACwE,IAAhB;AACA;AACD,GAlB0D,CAmB3D;;;AACA,MAAID,UAAU,IAAIA,UAAU,CAACE,MAAzB,IAAmCF,UAAU,CAACE,MAAX,CAAkBC,OAAzD,EAAkE;AACjE,WAAOH,UAAU,CAACE,MAAX,CAAkBC,OAAzB;AACA;AACD;;AAED,SAAStF,OAAT,CAAiBuF,QAAjB,EAA2B;AAC1B,SAAO,OAAOA,QAAP,KAAoB,QAApB,IAAgCnH,aAAa,CAACmH,QAAD,CAApD;AACA","sourcesContent":["import RelativeTimeFormatPolyfill from 'relative-time-format'\r\n\r\nimport Cache from './cache'\r\nimport chooseLocale from './locale'\r\nimport isStyleObject from './isStyleObject'\r\n\r\nimport getStep from './steps/getStep'\r\nimport getStepDenominator from './steps/getStepDenominator'\r\nimport getTimeToNextUpdate from './steps/getTimeToNextUpdate'\r\n\r\nimport {\r\n\taddLocaleData,\r\n\tgetLocaleData\r\n} from './LocaleDataStore'\r\n\r\nimport defaultStyle from './style/roundMinute'\r\nimport getStyleByName from './style/getStyleByName'\r\n\r\nimport { getRoundFunction } from './round'\r\n\r\n// Valid time units.\r\nconst UNITS = [\r\n\t'now',\r\n\t// The rest are the same as in `Intl.RelativeTimeFormat`.\r\n\t'second',\r\n\t'minute',\r\n\t'hour',\r\n\t'day',\r\n\t'week',\r\n\t'month',\r\n\t'quarter',\r\n\t'year'\r\n]\r\n\r\nexport default class TimeAgo {\r\n\t/**\r\n\t * @param {(string|string[])} locales=[] - Preferred locales (or locale).\r\n\t * @param {boolean} [polyfill] — Pass `false` to use native `Intl.RelativeTimeFormat` and `Intl.PluralRules` instead of the polyfills.\r\n\t */\r\n\tconstructor(locales = [], { polyfill } = {}) {\r\n\t\t// Convert `locales` to an array.\r\n\t\tif (typeof locales === 'string') {\r\n\t\t\tlocales = [locales]\r\n\t\t}\r\n\r\n\t\t// Choose the most appropriate locale\r\n\t\t// from the list of `locales` added by the user.\r\n\t\t// For example, new TimeAgo(\"en-US\") -> \"en\".\r\n\t\tthis.locale = chooseLocale(\r\n\t\t\tlocales.concat(TimeAgo.getDefaultLocale()),\r\n\t\t\tgetLocaleData\r\n\t\t)\r\n\r\n\t\tif (typeof Intl !== 'undefined') {\r\n\t\t\t// Use `Intl.NumberFormat` for formatting numbers (when available).\r\n\t\t\tif (Intl.NumberFormat) {\r\n\t\t\t\tthis.numberFormat = new Intl.NumberFormat(this.locale)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Some people have requested the ability to use native\r\n\t\t// `Intl.RelativeTimeFormat` and `Intl.PluralRules`\r\n\t\t// instead of the polyfills.\r\n\t\t// https://github.com/catamphetamine/javascript-time-ago/issues/21\r\n\t\tif (polyfill === false) {\r\n\t\t\tthis.IntlRelativeTimeFormat = Intl.RelativeTimeFormat\r\n\t\t\tthis.IntlPluralRules = Intl.PluralRules\r\n\t\t} else {\r\n\t\t\tthis.IntlRelativeTimeFormat = RelativeTimeFormatPolyfill\r\n\t\t\tthis.IntlPluralRules = RelativeTimeFormatPolyfill.PluralRules\r\n\t\t}\r\n\r\n\t\t// Cache `Intl.RelativeTimeFormat` instance.\r\n\t\tthis.relativeTimeFormatCache = new Cache()\r\n\r\n\t\t// Cache `Intl.PluralRules` instance.\r\n\t\tthis.pluralRulesCache = new Cache()\r\n\t}\r\n\r\n\t/**\r\n\t * Formats relative date/time.\r\n\t *\r\n\t * @param {number} [options.now] - Sets the current date timestamp.\r\n\t *\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`:\r\n\t * as \"future\" (`true`) or \"past\" (`false`).\r\n\t * Is `false` by default, but should have been `true` actually,\r\n\t * in order to correspond to `Intl.RelativeTimeFormat`\r\n\t * that uses `future` formatting for `0` unless `-0` is passed.\r\n\t *\r\n\t * @param {string} [options.round] — Rounding method. Overrides the style's one.\r\n\t *\r\n\t * @param {boolean} [options.getTimeToNextUpdate] — Pass `true` to return `[formattedDate, timeToNextUpdate]` instead of just `formattedDate`.\r\n\t *\r\n\t * @return {string} The formatted relative date/time. If no eligible `step` is found, then an empty string is returned.\r\n\t */\r\n\tformat(input, style, options) {\r\n\t\tif (!options) {\r\n\t\t\tif (style && !isStyle(style)) {\r\n\t\t\t\toptions = style\r\n\t\t\t\tstyle = undefined\r\n\t\t\t} else {\r\n\t\t\t\toptions = {}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!style) {\r\n\t\t\tstyle = defaultStyle\r\n\t\t}\r\n\r\n\t\tif (typeof style === 'string') {\r\n\t\t\tstyle = getStyleByName(style)\r\n\t\t}\r\n\r\n\t\tconst timestamp = getTimestamp(input)\r\n\r\n\t\t// Get locale messages for this type of labels.\r\n\t\t// \"flavour\" is a legacy name for \"labels\".\r\n\t\tconst { labels, labelsType } = this.getLabels(style.flavour || style.labels)\r\n\r\n\t\tlet now\r\n\t\t// Can pass a custom `now`, e.g. for testing purposes.\r\n\t\t//\r\n\t\t// Legacy way was passing `now` in `style`.\r\n\t\t// That way is deprecated.\r\n\t\tif (style.now !== undefined) {\r\n\t\t\tnow = style.now\r\n\t\t}\r\n\t\t// The new way is passing `now` option to `.format()`.\r\n\t\tif (now === undefined && options.now !== undefined) {\r\n\t\t\tnow = options.now\r\n\t\t}\r\n\t\tif (now === undefined) {\r\n\t\t\tnow = Date.now()\r\n\t\t}\r\n\r\n\t\t// how much time has passed (in seconds)\r\n\t\tconst secondsPassed = (now - timestamp) / 1000 // in seconds\r\n\r\n\t\tconst future = options.future || secondsPassed < 0\r\n\r\n\t\tconst nowLabel = getNowLabel(\r\n\t\t\tlabels,\r\n\t\t\tgetLocaleData(this.locale).now,\r\n\t\t\tgetLocaleData(this.locale).long,\r\n\t\t\tfuture\r\n\t\t)\r\n\r\n\t\t// `custom` – A function of `{ elapsed, time, date, now, locale }`.\r\n\t\t//\r\n\t\t// Looks like `custom` function is deprecated and will be removed\r\n\t\t// in the next major version.\r\n\t\t//\r\n\t\t// If this function returns a value, then the `.format()` call will return that value.\r\n\t\t// Otherwise the relative date/time is formatted as usual.\r\n\t\t// This feature is currently not used anywhere and is here\r\n\t\t// just for providing the ultimate customization point\r\n\t\t// in case anyone would ever need that. Prefer using\r\n\t\t// `steps[step].format(value, locale)` instead.\r\n\t\t//\r\n\t\tif (style.custom) {\r\n\t\t\tconst custom = style.custom({\r\n\t\t\t\tnow,\r\n\t\t\t\tdate: new Date(timestamp),\r\n\t\t\t\ttime: timestamp,\r\n\t\t\t\telapsed: secondsPassed,\r\n\t\t\t\tlocale: this.locale\r\n\t\t\t})\r\n\t\t\tif (custom !== undefined) {\r\n\t\t\t\t// Won't return `timeToNextUpdate` here\r\n\t\t\t\t// because `custom()` seems deprecated.\r\n\t\t\t\treturn custom\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Get the list of available time interval units.\r\n\t\tconst units = getTimeIntervalMeasurementUnits(\r\n\t\t\t// Controlling `style.steps` through `style.units` seems to be deprecated:\r\n\t\t\t// create a new custom `style` instead.\r\n\t\t\tstyle.units,\r\n\t\t\tlabels,\r\n\t\t\tnowLabel\r\n\t\t)\r\n\r\n\t\t// // If no available time unit is suitable, just output an empty string.\r\n\t\t// if (units.length === 0) {\r\n\t\t// \tconsole.error(`None of the \"${units.join(', ')}\" time units have been found in \"${labelsType}\" labels for \"${this.locale}\" locale.`)\r\n\t\t// \treturn ''\r\n\t\t// }\r\n\r\n\t\tconst round = options.round || style.round\r\n\r\n\t\t// Choose the appropriate time measurement unit\r\n\t\t// and get the corresponding rounded time amount.\r\n\t\tconst [prevStep, step, nextStep] = getStep(\r\n\t\t\t// \"gradation\" is a legacy name for \"steps\".\r\n\t\t\t// For historical reasons, \"approximate\" steps are used by default.\r\n\t\t\t// In the next major version, there'll be no default for `steps`.\r\n\t\t\tstyle.gradation || style.steps || defaultStyle.steps,\r\n\t\t\tsecondsPassed,\r\n\t\t\t{ now, units, round, future, getNextStep: true }\r\n\t\t)\r\n\r\n\t\tconst formattedDate = this.formatDateForStep(timestamp, step, secondsPassed, {\r\n\t\t\tlabels,\r\n\t\t\tlabelsType,\r\n\t\t\tnowLabel,\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround\r\n\t\t}) || ''\r\n\r\n\t\tif (options.getTimeToNextUpdate) {\r\n\t\t\tconst timeToNextUpdate = getTimeToNextUpdate(timestamp, step, {\r\n\t\t\t\tnextStep,\r\n\t\t\t\tprevStep,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t\treturn [formattedDate, timeToNextUpdate]\r\n\t\t}\r\n\r\n\t\treturn formattedDate\r\n\t}\r\n\r\n\tformatDateForStep(timestamp, step, secondsPassed, {\r\n\t\tlabels,\r\n\t\tlabelsType,\r\n\t\tnowLabel,\r\n\t\tnow,\r\n\t\tfuture,\r\n\t\tround\r\n\t}) {\r\n\t\t// If no step matches, then output an empty string.\r\n\t\tif (!step) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (step.format) {\r\n\t\t\treturn step.format(timestamp, this.locale, {\r\n\t\t\t\tformatAs: (unit, value) => {\r\n\t\t\t\t\t// Mimicks `Intl.RelativeTimeFormat.format()`.\r\n\t\t\t\t\treturn this.formatValue(value, unit, {\r\n\t\t\t\t\t\tlabels,\r\n\t\t\t\t\t\tfuture\r\n\t\t\t\t\t})\r\n\t\t\t\t},\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tconst unit = step.unit || step.formatAs\r\n\r\n\t\tif (!unit) {\r\n\t\t\tthrow new Error(`[javascript-time-ago] Each step must define either \\`formatAs\\` or \\`format()\\`. Step: ${JSON.stringify(step)}`)\r\n\t\t}\r\n\r\n\t\t// `Intl.RelativeTimeFormat` doesn't operate in \"now\" units.\r\n\t\t// Therefore, threat \"now\" as a special case.\r\n\t\tif (unit === 'now') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\r\n\t\t// Amount in units.\r\n\t\tlet amount = Math.abs(secondsPassed) / getStepDenominator(step)\r\n\r\n\t\t// Apply granularity to the time amount\r\n\t\t// (and fallback to the previous step\r\n\t\t// if the first level of granularity\r\n\t\t// isn't met by this amount)\r\n\t\t//\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\t//\r\n\t\tif (step.granularity) {\r\n\t\t\t// Recalculate the amount of seconds passed based on granularity\r\n\t\t\tamount = getRoundFunction(round)(amount / step.granularity) * step.granularity\r\n\t\t}\r\n\r\n\t\tlet valueForFormatting = -1 * Math.sign(secondsPassed) * getRoundFunction(round)(amount)\r\n\r\n\t\t// By default, this library formats a `0` in \"past\" mode,\r\n\t\t// unless `future: true` option is passed.\r\n\t\t// This is different to `relative-time-format`'s behavior\r\n\t\t// which formats a `0` in \"future\" mode by default, unless it's a `-0`.\r\n\t\t// So, convert `0` to `-0` if `future: true` option wasn't passed.\r\n\t\t// `=== 0` matches both `0` and `-0`.\r\n\t\tif (valueForFormatting === 0) {\r\n\t\t\tif (future) {\r\n\t\t\t\tvalueForFormatting = 0\r\n\t\t\t} else {\r\n\t\t\t\tvalueForFormatting = -0\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tswitch (labelsType) {\r\n\t\t\tcase 'long':\r\n\t\t\tcase 'short':\r\n\t\t\tcase 'narrow':\r\n\t\t\t\t// Format the amount using `Intl.RelativeTimeFormat`.\r\n\t\t\t\treturn this.getFormatter(labelsType).format(valueForFormatting, unit)\r\n\t\t\tdefault:\r\n\t\t\t\t// Format the amount.\r\n\t\t\t\t// (mimicks `Intl.RelativeTimeFormat` behavior for other time label styles)\r\n\t\t\t\treturn this.formatValue(valueForFormatting, unit, {\r\n\t\t\t\t\tlabels,\r\n\t\t\t\t\tfuture\r\n\t\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Mimicks what `Intl.RelativeTimeFormat` does for additional locale styles.\r\n\t * @param {number} value\r\n\t * @param {string} unit\r\n\t * @param {object} options.labels — Relative time labels.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default, but should have been `true` actually.\r\n\t * @return {string}\r\n\t */\r\n\tformatValue(value, unit, { labels, future }) {\r\n\t\treturn this.getFormattingRule(labels, unit, value, { future })\r\n\t\t\t.replace('{0}', this.formatNumber(Math.abs(value)))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns formatting rule for `value` in `units` (either in past or in future).\r\n\t * @param {object} formattingRules — Relative time labels for different units.\r\n\t * @param {string} unit - Time interval measurement unit.\r\n\t * @param {number} value - Time interval value.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default.\r\n\t * @return {string}\r\n\t * @example\r\n\t * // Returns \"{0} days ago\"\r\n\t * getFormattingRule(en.long, \"day\", -2, 'en')\r\n\t */\r\n\tgetFormattingRule(formattingRules, unit, value, { future }) {\r\n\t\t// Passing the language is required in order to\r\n\t\t// be able to correctly classify the `value` as a number.\r\n\t\tconst locale = this.locale\r\n\t\tformattingRules = formattingRules[unit]\r\n\t\t// Check for a special \"compacted\" rules case:\r\n\t\t// if formatting rules are the same for \"past\" and \"future\",\r\n\t\t// and also for all possible `value`s, then those rules are\r\n\t\t// stored as a single string.\r\n\t\tif (typeof formattingRules === 'string') {\r\n\t\t\treturn formattingRules\r\n\t\t}\r\n\t\t// Choose either \"past\" or \"future\" based on time `value` sign.\r\n\t\t// If \"past\" is same as \"future\" then they're stored as \"other\".\r\n\t\t// If there's only \"other\" then it's being collapsed.\r\n\t\tconst pastOrFuture = value === 0 ? (future ? 'future' : 'past') : (value < 0 ? 'past' : 'future')\r\n\t\tconst quantifierRules = formattingRules[pastOrFuture] || formattingRules\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof quantifierRules === 'string') {\r\n\t\t\treturn quantifierRules\r\n\t\t}\r\n\t\t// Quantify `value`.\r\n\t\tconst quantifier = this.getPluralRules().select(Math.abs(value))\r\n\t\t// \"other\" rule is supposed to always be present.\r\n\t\t// If only \"other\" rule is present then \"rules\" is not an object and is a string.\r\n\t\treturn quantifierRules[quantifier] || quantifierRules.other\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a number into a string.\r\n\t * Uses `Intl.NumberFormat` when available.\r\n\t * @param {number} number\r\n\t * @return {string}\r\n\t */\r\n\tformatNumber(number) {\r\n\t\treturn this.numberFormat ? this.numberFormat.format(number) : String(number)\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.RelativeTimeFormat` for a given `labelsType`.\r\n\t * @param {string} labelsType\r\n\t * @return {object} `Intl.RelativeTimeFormat` instance\r\n\t */\r\n\tgetFormatter(labelsType) {\r\n\t\t// `Intl.RelativeTimeFormat` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.relativeTimeFormatCache.get(this.locale, labelsType) ||\r\n\t\t\tthis.relativeTimeFormatCache.put(this.locale, labelsType, new this.IntlRelativeTimeFormat(this.locale, { style: labelsType }))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.PluralRules` instance.\r\n\t * @return {object} `Intl.PluralRules` instance\r\n\t */\r\n\tgetPluralRules() {\r\n\t\t// `Intl.PluralRules` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.pluralRulesCache.get(this.locale) ||\r\n\t\t\tthis.pluralRulesCache.put(this.locale, new this.IntlPluralRules(this.locale))\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Gets localized labels for this type of labels.\r\n\t *\r\n\t * @param {(string|string[])} labelsType - Relative date/time labels type.\r\n\t * If it's an array then all label types are tried\r\n\t * until a suitable one is found.\r\n\t *\r\n\t * @returns {Object} Returns an object of shape { labelsType, labels }\r\n\t */\r\n\tgetLabels(labelsType = []) {\r\n\t\t// Convert `labels` to an array.\r\n\t\tif (typeof labelsType === 'string') {\r\n\t\t\tlabelsType = [labelsType]\r\n\t\t}\r\n\r\n\t\t// Supports legacy \"tiny\" and \"mini-time\" label styles.\r\n\t\tlabelsType = labelsType.map((labelsType) => {\r\n\t\t\tswitch (labelsType) {\r\n\t\t\t\tcase 'tiny':\r\n\t\t\t\tcase 'mini-time':\r\n\t\t\t\t\treturn 'mini'\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn labelsType\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\t// \"long\" labels type is the default one.\r\n\t\t// (it's always present for all languages)\r\n\t\tlabelsType = labelsType.concat('long')\r\n\r\n\t\t// Find a suitable labels type.\r\n\t\tconst localeData = getLocaleData(this.locale)\r\n\t\tfor (const _labelsType of labelsType) {\r\n\t\t\tif (localeData[_labelsType]) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabelsType: _labelsType,\r\n\t\t\t\t\tlabels: localeData[_labelsType]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Default locale global variable.\r\n */\r\nlet defaultLocale = 'en'\r\n\r\n/**\r\n * Gets default locale.\r\n * @return {string} locale\r\n */\r\nTimeAgo.getDefaultLocale = () => defaultLocale\r\n\r\n/**\r\n * Sets default locale.\r\n * @param {string} locale\r\n */\r\nTimeAgo.setDefaultLocale = (locale) => defaultLocale = locale\r\n\r\n/**\r\n * Adds locale data for a specific locale and marks the locale as default.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addDefaultLocale = function(localeData) {\r\n\tif (defaultLocaleHasBeenSpecified) {\r\n\t\treturn console.error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.')\r\n\t}\r\n\tdefaultLocaleHasBeenSpecified = true\r\n\tTimeAgo.setDefaultLocale(localeData.locale)\r\n\tTimeAgo.addLocale(localeData)\r\n}\r\n\r\nlet defaultLocaleHasBeenSpecified\r\n\r\n/**\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addLocale = function(localeData) {\r\n\taddLocaleData(localeData)\r\n\tRelativeTimeFormatPolyfill.addLocale(localeData)\r\n}\r\n\r\n/**\r\n * (legacy alias)\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n * @deprecated\r\n */\r\nTimeAgo.locale = TimeAgo.addLocale\r\n\r\n/**\r\n * Adds custom labels to locale data.\r\n * @param {string} locale\r\n * @param {string} name\r\n * @param {object} labels\r\n */\r\nTimeAgo.addLabels = (locale, name, labels) => {\r\n\tlet localeData = getLocaleData(locale)\r\n\tif (!localeData) {\r\n\t\taddLocaleData({\r\n\t\t\tlocale\r\n\t\t})\r\n\t\tlocaleData = getLocaleData(locale)\r\n\t\t// throw new Error(`[javascript-time-ago] No data for locale \"${locale}\"`)\r\n\t}\r\n\tlocaleData[name] = labels\r\n}\r\n\r\n// Normalizes `.format()` `time` argument.\r\nfunction getTimestamp(input) {\r\n\tif (input.constructor === Date || isMockedDate(input)) {\r\n\t\treturn input.getTime()\r\n\t}\r\n\r\n\tif (typeof input === 'number') {\r\n\t\treturn input\r\n\t}\r\n\r\n\t// For some weird reason istanbul doesn't see this `throw` covered.\r\n\t/* istanbul ignore next */\r\n\tthrow new Error(`Unsupported relative time formatter input: ${typeof input}, ${input}`)\r\n}\r\n\r\n// During testing via some testing libraries `Date`s aren't actually `Date`s.\r\n// https://github.com/catamphetamine/javascript-time-ago/issues/22\r\nfunction isMockedDate(object) {\r\n\treturn typeof object === 'object' && typeof object.getTime === 'function'\r\n}\r\n\r\n// Get available time interval measurement units.\r\nfunction getTimeIntervalMeasurementUnits(allowedUnits, labels, nowLabel) {\r\n\t// Get all time interval measurement units that're available\r\n\t// in locale data for a given time labels style.\r\n\tlet units = Object.keys(labels)\r\n\r\n\t// `now` unit is handled separately and is shipped in its own `now.json` file.\r\n\t// `now.json` isn't present for all locales, so it could be substituted with\r\n\t// \".second.current\".\r\n\t// Add `now` unit if it's available in locale data.\r\n\tif (nowLabel) {\r\n\t\tunits.push('now')\r\n\t}\r\n\r\n\t// If only a specific set of available time measurement units can be used\r\n\t// then only those units are allowed (if they're present in locale data).\r\n\tif (allowedUnits) {\r\n\t\tunits = allowedUnits.filter(unit => unit === 'now' || units.indexOf(unit) >= 0)\r\n\t}\r\n\r\n\treturn units\r\n}\r\n\r\nfunction getNowLabel(labels, nowLabels, longLabels, future) {\r\n\tconst nowLabel = labels.now || (nowLabels && nowLabels.now)\r\n\t// Specific \"now\" message form extended locale data (if present).\r\n\tif (nowLabel) {\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof nowLabel === 'string') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\t\t// Not handling `value === 0` as `localeData.now.current` here\r\n\t\t// because it wouldn't make sense: \"now\" is a moment,\r\n\t\t// so one can't possibly differentiate between a\r\n\t\t// \"previous\" moment, a \"current\" moment and a \"next moment\".\r\n\t\t// It can only be differentiated between \"past\" and \"future\".\r\n\t\tif (future) {\r\n\t\t\treturn nowLabel.future\r\n\t\t} else {\r\n\t\t\treturn nowLabel.past\r\n\t\t}\r\n\t}\r\n\t// Use \".second.current\" as \"now\" message.\r\n\tif (longLabels && longLabels.second && longLabels.second.current) {\r\n\t\treturn longLabels.second.current\r\n\t}\r\n}\r\n\r\nfunction isStyle(variable) {\r\n\treturn typeof variable === 'string' || isStyleObject(variable)\r\n}"],"file":"TimeAgo.js"}
|
|
1
|
+
{"version":3,"file":"TimeAgo.js","names":["RelativeTimeFormatPolyfill","Cache","chooseLocale","isStyleObject","getStep","getStepDenominator","getTimeToNextUpdate","addLocaleData","getLocaleData","defaultStyle","getStyleByName","getRoundFunction","UNITS","TimeAgo","locales","polyfill","locale","concat","getDefaultLocale","Intl","NumberFormat","numberFormat","IntlRelativeTimeFormat","RelativeTimeFormat","IntlPluralRules","PluralRules","relativeTimeFormatCache","pluralRulesCache","input","style","options","isStyle","undefined","timestamp","getTimestamp","getLabels","flavour","labels","labelsType","now","Date","secondsPassed","future","nowLabel","getNowLabel","custom","date","time","elapsed","units","getTimeIntervalMeasurementUnits","round","gradation","steps","getNextStep","prevStep","step","nextStep","formattedDate","formatDateForStep","timeToNextUpdate","format","formatAs","unit","value","formatValue","Error","JSON","stringify","amount","Math","abs","granularity","valueForFormatting","sign","getFormatter","getFormattingRule","replace","formatNumber","formattingRules","pastOrFuture","quantifierRules","quantifier","getPluralRules","select","other","number","String","get","put","map","localeData","_labelsType","defaultLocale","setDefaultLocale","addDefaultLocale","defaultLocaleHasBeenSpecified","console","error","addLocale","addLabels","name","constructor","isMockedDate","getTime","object","allowedUnits","Object","keys","push","filter","indexOf","nowLabels","longLabels","past","second","current","variable"],"sources":["../source/TimeAgo.js"],"sourcesContent":["import RelativeTimeFormatPolyfill from 'relative-time-format'\r\n\r\nimport Cache from './cache.js'\r\nimport chooseLocale from './locale.js'\r\nimport isStyleObject from './isStyleObject.js'\r\n\r\nimport getStep from './steps/getStep.js'\r\nimport getStepDenominator from './steps/getStepDenominator.js'\r\nimport getTimeToNextUpdate from './steps/getTimeToNextUpdate.js'\r\n\r\nimport {\r\n\taddLocaleData,\r\n\tgetLocaleData\r\n} from './LocaleDataStore.js'\r\n\r\nimport defaultStyle from './style/roundMinute.js'\r\nimport getStyleByName from './style/getStyleByName.js'\r\n\r\nimport { getRoundFunction } from './round.js'\r\n\r\n// Valid time units.\r\nconst UNITS = [\r\n\t'now',\r\n\t// The rest are the same as in `Intl.RelativeTimeFormat`.\r\n\t'second',\r\n\t'minute',\r\n\t'hour',\r\n\t'day',\r\n\t'week',\r\n\t'month',\r\n\t'quarter',\r\n\t'year'\r\n]\r\n\r\nexport default class TimeAgo {\r\n\t/**\r\n\t * @param {(string|string[])} locales=[] - Preferred locales (or locale).\r\n\t * @param {boolean} [polyfill] — Pass `false` to use native `Intl.RelativeTimeFormat` and `Intl.PluralRules` instead of the polyfills.\r\n\t */\r\n\tconstructor(locales = [], { polyfill } = {}) {\r\n\t\t// Convert `locales` to an array.\r\n\t\tif (typeof locales === 'string') {\r\n\t\t\tlocales = [locales]\r\n\t\t}\r\n\r\n\t\t// Choose the most appropriate locale\r\n\t\t// from the list of `locales` added by the user.\r\n\t\t// For example, new TimeAgo(\"en-US\") -> \"en\".\r\n\t\tthis.locale = chooseLocale(\r\n\t\t\tlocales.concat(TimeAgo.getDefaultLocale()),\r\n\t\t\tgetLocaleData\r\n\t\t)\r\n\r\n\t\tif (typeof Intl !== 'undefined') {\r\n\t\t\t// Use `Intl.NumberFormat` for formatting numbers (when available).\r\n\t\t\tif (Intl.NumberFormat) {\r\n\t\t\t\tthis.numberFormat = new Intl.NumberFormat(this.locale)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Some people have requested the ability to use native\r\n\t\t// `Intl.RelativeTimeFormat` and `Intl.PluralRules`\r\n\t\t// instead of the polyfills.\r\n\t\t// https://github.com/catamphetamine/javascript-time-ago/issues/21\r\n\t\tif (polyfill === false) {\r\n\t\t\tthis.IntlRelativeTimeFormat = Intl.RelativeTimeFormat\r\n\t\t\tthis.IntlPluralRules = Intl.PluralRules\r\n\t\t} else {\r\n\t\t\tthis.IntlRelativeTimeFormat = RelativeTimeFormatPolyfill\r\n\t\t\tthis.IntlPluralRules = RelativeTimeFormatPolyfill.PluralRules\r\n\t\t}\r\n\r\n\t\t// Cache `Intl.RelativeTimeFormat` instance.\r\n\t\tthis.relativeTimeFormatCache = new Cache()\r\n\r\n\t\t// Cache `Intl.PluralRules` instance.\r\n\t\tthis.pluralRulesCache = new Cache()\r\n\t}\r\n\r\n\t/**\r\n\t * Formats relative date/time.\r\n\t *\r\n\t * @param {number} [options.now] - Sets the current date timestamp.\r\n\t *\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`:\r\n\t * as \"future\" (`true`) or \"past\" (`false`).\r\n\t * Is `false` by default, but should have been `true` actually,\r\n\t * in order to correspond to `Intl.RelativeTimeFormat`\r\n\t * that uses `future` formatting for `0` unless `-0` is passed.\r\n\t *\r\n\t * @param {string} [options.round] — Rounding method. Overrides the style's one.\r\n\t *\r\n\t * @param {boolean} [options.getTimeToNextUpdate] — Pass `true` to return `[formattedDate, timeToNextUpdate]` instead of just `formattedDate`.\r\n\t *\r\n\t * @return {string} The formatted relative date/time. If no eligible `step` is found, then an empty string is returned.\r\n\t */\r\n\tformat(input, style, options) {\r\n\t\tif (!options) {\r\n\t\t\tif (style && !isStyle(style)) {\r\n\t\t\t\toptions = style\r\n\t\t\t\tstyle = undefined\r\n\t\t\t} else {\r\n\t\t\t\toptions = {}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!style) {\r\n\t\t\tstyle = defaultStyle\r\n\t\t}\r\n\r\n\t\tif (typeof style === 'string') {\r\n\t\t\tstyle = getStyleByName(style)\r\n\t\t}\r\n\r\n\t\tconst timestamp = getTimestamp(input)\r\n\r\n\t\t// Get locale messages for this type of labels.\r\n\t\t// \"flavour\" is a legacy name for \"labels\".\r\n\t\tconst { labels, labelsType } = this.getLabels(style.flavour || style.labels)\r\n\r\n\t\tlet now\r\n\t\t// Can pass a custom `now`, e.g. for testing purposes.\r\n\t\t//\r\n\t\t// Legacy way was passing `now` in `style`.\r\n\t\t// That way is deprecated.\r\n\t\tif (style.now !== undefined) {\r\n\t\t\tnow = style.now\r\n\t\t}\r\n\t\t// The new way is passing `now` option to `.format()`.\r\n\t\tif (now === undefined && options.now !== undefined) {\r\n\t\t\tnow = options.now\r\n\t\t}\r\n\t\tif (now === undefined) {\r\n\t\t\tnow = Date.now()\r\n\t\t}\r\n\r\n\t\t// how much time has passed (in seconds)\r\n\t\tconst secondsPassed = (now - timestamp) / 1000 // in seconds\r\n\r\n\t\tconst future = options.future || secondsPassed < 0\r\n\r\n\t\tconst nowLabel = getNowLabel(\r\n\t\t\tlabels,\r\n\t\t\tgetLocaleData(this.locale).now,\r\n\t\t\tgetLocaleData(this.locale).long,\r\n\t\t\tfuture\r\n\t\t)\r\n\r\n\t\t// `custom` – A function of `{ elapsed, time, date, now, locale }`.\r\n\t\t//\r\n\t\t// Looks like `custom` function is deprecated and will be removed\r\n\t\t// in the next major version.\r\n\t\t//\r\n\t\t// If this function returns a value, then the `.format()` call will return that value.\r\n\t\t// Otherwise the relative date/time is formatted as usual.\r\n\t\t// This feature is currently not used anywhere and is here\r\n\t\t// just for providing the ultimate customization point\r\n\t\t// in case anyone would ever need that. Prefer using\r\n\t\t// `steps[step].format(value, locale)` instead.\r\n\t\t//\r\n\t\tif (style.custom) {\r\n\t\t\tconst custom = style.custom({\r\n\t\t\t\tnow,\r\n\t\t\t\tdate: new Date(timestamp),\r\n\t\t\t\ttime: timestamp,\r\n\t\t\t\telapsed: secondsPassed,\r\n\t\t\t\tlocale: this.locale\r\n\t\t\t})\r\n\t\t\tif (custom !== undefined) {\r\n\t\t\t\t// Won't return `timeToNextUpdate` here\r\n\t\t\t\t// because `custom()` seems deprecated.\r\n\t\t\t\treturn custom\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Get the list of available time interval units.\r\n\t\tconst units = getTimeIntervalMeasurementUnits(\r\n\t\t\t// Controlling `style.steps` through `style.units` seems to be deprecated:\r\n\t\t\t// create a new custom `style` instead.\r\n\t\t\tstyle.units,\r\n\t\t\tlabels,\r\n\t\t\tnowLabel\r\n\t\t)\r\n\r\n\t\t// // If no available time unit is suitable, just output an empty string.\r\n\t\t// if (units.length === 0) {\r\n\t\t// \tconsole.error(`None of the \"${units.join(', ')}\" time units have been found in \"${labelsType}\" labels for \"${this.locale}\" locale.`)\r\n\t\t// \treturn ''\r\n\t\t// }\r\n\r\n\t\tconst round = options.round || style.round\r\n\r\n\t\t// Choose the appropriate time measurement unit\r\n\t\t// and get the corresponding rounded time amount.\r\n\t\tconst [prevStep, step, nextStep] = getStep(\r\n\t\t\t// \"gradation\" is a legacy name for \"steps\".\r\n\t\t\t// For historical reasons, \"approximate\" steps are used by default.\r\n\t\t\t// In the next major version, there'll be no default for `steps`.\r\n\t\t\tstyle.gradation || style.steps || defaultStyle.steps,\r\n\t\t\tsecondsPassed,\r\n\t\t\t{ now, units, round, future, getNextStep: true }\r\n\t\t)\r\n\r\n\t\tconst formattedDate = this.formatDateForStep(timestamp, step, secondsPassed, {\r\n\t\t\tlabels,\r\n\t\t\tlabelsType,\r\n\t\t\tnowLabel,\r\n\t\t\tnow,\r\n\t\t\tfuture,\r\n\t\t\tround\r\n\t\t}) || ''\r\n\r\n\t\tif (options.getTimeToNextUpdate) {\r\n\t\t\tconst timeToNextUpdate = getTimeToNextUpdate(timestamp, step, {\r\n\t\t\t\tnextStep,\r\n\t\t\t\tprevStep,\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture,\r\n\t\t\t\tround\r\n\t\t\t})\r\n\t\t\treturn [formattedDate, timeToNextUpdate]\r\n\t\t}\r\n\r\n\t\treturn formattedDate\r\n\t}\r\n\r\n\tformatDateForStep(timestamp, step, secondsPassed, {\r\n\t\tlabels,\r\n\t\tlabelsType,\r\n\t\tnowLabel,\r\n\t\tnow,\r\n\t\tfuture,\r\n\t\tround\r\n\t}) {\r\n\t\t// If no step matches, then output an empty string.\r\n\t\tif (!step) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (step.format) {\r\n\t\t\treturn step.format(timestamp, this.locale, {\r\n\t\t\t\tformatAs: (unit, value) => {\r\n\t\t\t\t\t// Mimicks `Intl.RelativeTimeFormat.format()`.\r\n\t\t\t\t\treturn this.formatValue(value, unit, {\r\n\t\t\t\t\t\tlabels,\r\n\t\t\t\t\t\tfuture\r\n\t\t\t\t\t})\r\n\t\t\t\t},\r\n\t\t\t\tnow,\r\n\t\t\t\tfuture\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\t// \"unit\" is now called \"formatAs\".\r\n\t\tconst unit = step.unit || step.formatAs\r\n\r\n\t\tif (!unit) {\r\n\t\t\tthrow new Error(`[javascript-time-ago] Each step must define either \\`formatAs\\` or \\`format()\\`. Step: ${JSON.stringify(step)}`)\r\n\t\t}\r\n\r\n\t\t// `Intl.RelativeTimeFormat` doesn't operate in \"now\" units.\r\n\t\t// Therefore, threat \"now\" as a special case.\r\n\t\tif (unit === 'now') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\r\n\t\t// Amount in units.\r\n\t\tlet amount = Math.abs(secondsPassed) / getStepDenominator(step)\r\n\r\n\t\t// Apply granularity to the time amount\r\n\t\t// (and fallback to the previous step\r\n\t\t// if the first level of granularity\r\n\t\t// isn't met by this amount)\r\n\t\t//\r\n\t\t// `granularity` — (advanced) Time interval value \"granularity\".\r\n\t\t// For example, it could be set to `5` for minutes to allow only 5-minute increments\r\n\t\t// when formatting time intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.\r\n\t\t// Perhaps this feature will be removed because there seem to be no use cases\r\n\t\t// of it in the real world.\r\n\t\t//\r\n\t\tif (step.granularity) {\r\n\t\t\t// Recalculate the amount of seconds passed based on granularity\r\n\t\t\tamount = getRoundFunction(round)(amount / step.granularity) * step.granularity\r\n\t\t}\r\n\r\n\t\tlet valueForFormatting = -1 * Math.sign(secondsPassed) * getRoundFunction(round)(amount)\r\n\r\n\t\t// By default, this library formats a `0` in \"past\" mode,\r\n\t\t// unless `future: true` option is passed.\r\n\t\t// This is different to `relative-time-format`'s behavior\r\n\t\t// which formats a `0` in \"future\" mode by default, unless it's a `-0`.\r\n\t\t// So, convert `0` to `-0` if `future: true` option wasn't passed.\r\n\t\t// `=== 0` matches both `0` and `-0`.\r\n\t\tif (valueForFormatting === 0) {\r\n\t\t\tif (future) {\r\n\t\t\t\tvalueForFormatting = 0\r\n\t\t\t} else {\r\n\t\t\t\tvalueForFormatting = -0\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tswitch (labelsType) {\r\n\t\t\tcase 'long':\r\n\t\t\tcase 'short':\r\n\t\t\tcase 'narrow':\r\n\t\t\t\t// Format the amount using `Intl.RelativeTimeFormat`.\r\n\t\t\t\treturn this.getFormatter(labelsType).format(valueForFormatting, unit)\r\n\t\t\tdefault:\r\n\t\t\t\t// Format the amount.\r\n\t\t\t\t// (mimicks `Intl.RelativeTimeFormat` behavior for other time label styles)\r\n\t\t\t\treturn this.formatValue(valueForFormatting, unit, {\r\n\t\t\t\t\tlabels,\r\n\t\t\t\t\tfuture\r\n\t\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Mimicks what `Intl.RelativeTimeFormat` does for additional locale styles.\r\n\t * @param {number} value\r\n\t * @param {string} unit\r\n\t * @param {object} options.labels — Relative time labels.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default, but should have been `true` actually.\r\n\t * @return {string}\r\n\t */\r\n\tformatValue(value, unit, { labels, future }) {\r\n\t\treturn this.getFormattingRule(labels, unit, value, { future })\r\n\t\t\t.replace('{0}', this.formatNumber(Math.abs(value)))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns formatting rule for `value` in `units` (either in past or in future).\r\n\t * @param {object} formattingRules — Relative time labels for different units.\r\n\t * @param {string} unit - Time interval measurement unit.\r\n\t * @param {number} value - Time interval value.\r\n\t * @param {boolean} [options.future] — Tells how to format value `0`: as \"future\" (`true`) or \"past\" (`false`). Is `false` by default.\r\n\t * @return {string}\r\n\t * @example\r\n\t * // Returns \"{0} days ago\"\r\n\t * getFormattingRule(en.long, \"day\", -2, 'en')\r\n\t */\r\n\tgetFormattingRule(formattingRules, unit, value, { future }) {\r\n\t\t// Passing the language is required in order to\r\n\t\t// be able to correctly classify the `value` as a number.\r\n\t\tconst locale = this.locale\r\n\t\tformattingRules = formattingRules[unit]\r\n\t\t// Check for a special \"compacted\" rules case:\r\n\t\t// if formatting rules are the same for \"past\" and \"future\",\r\n\t\t// and also for all possible `value`s, then those rules are\r\n\t\t// stored as a single string.\r\n\t\tif (typeof formattingRules === 'string') {\r\n\t\t\treturn formattingRules\r\n\t\t}\r\n\t\t// Choose either \"past\" or \"future\" based on time `value` sign.\r\n\t\t// If \"past\" is same as \"future\" then they're stored as \"other\".\r\n\t\t// If there's only \"other\" then it's being collapsed.\r\n\t\tconst pastOrFuture = value === 0 ? (future ? 'future' : 'past') : (value < 0 ? 'past' : 'future')\r\n\t\tconst quantifierRules = formattingRules[pastOrFuture] || formattingRules\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof quantifierRules === 'string') {\r\n\t\t\treturn quantifierRules\r\n\t\t}\r\n\t\t// Quantify `value`.\r\n\t\tconst quantifier = this.getPluralRules().select(Math.abs(value))\r\n\t\t// \"other\" rule is supposed to always be present.\r\n\t\t// If only \"other\" rule is present then \"rules\" is not an object and is a string.\r\n\t\treturn quantifierRules[quantifier] || quantifierRules.other\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a number into a string.\r\n\t * Uses `Intl.NumberFormat` when available.\r\n\t * @param {number} number\r\n\t * @return {string}\r\n\t */\r\n\tformatNumber(number) {\r\n\t\treturn this.numberFormat ? this.numberFormat.format(number) : String(number)\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.RelativeTimeFormat` for a given `labelsType`.\r\n\t * @param {string} labelsType\r\n\t * @return {object} `Intl.RelativeTimeFormat` instance\r\n\t */\r\n\tgetFormatter(labelsType) {\r\n\t\t// `Intl.RelativeTimeFormat` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.relativeTimeFormatCache.get(this.locale, labelsType) ||\r\n\t\t\tthis.relativeTimeFormatCache.put(this.locale, labelsType, new this.IntlRelativeTimeFormat(this.locale, { style: labelsType }))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `Intl.PluralRules` instance.\r\n\t * @return {object} `Intl.PluralRules` instance\r\n\t */\r\n\tgetPluralRules() {\r\n\t\t// `Intl.PluralRules` instance creation is (hypothetically) assumed\r\n\t\t// a lengthy operation so the instances are cached and reused.\r\n\t\treturn this.pluralRulesCache.get(this.locale) ||\r\n\t\t\tthis.pluralRulesCache.put(this.locale, new this.IntlPluralRules(this.locale))\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Gets localized labels for this type of labels.\r\n\t *\r\n\t * @param {(string|string[])} labelsType - Relative date/time labels type.\r\n\t * If it's an array then all label types are tried\r\n\t * until a suitable one is found.\r\n\t *\r\n\t * @returns {Object} Returns an object of shape { labelsType, labels }\r\n\t */\r\n\tgetLabels(labelsType = []) {\r\n\t\t// Convert `labels` to an array.\r\n\t\tif (typeof labelsType === 'string') {\r\n\t\t\tlabelsType = [labelsType]\r\n\t\t}\r\n\r\n\t\t// Supports legacy \"tiny\" and \"mini-time\" label styles.\r\n\t\tlabelsType = labelsType.map((labelsType) => {\r\n\t\t\tswitch (labelsType) {\r\n\t\t\t\tcase 'tiny':\r\n\t\t\t\tcase 'mini-time':\r\n\t\t\t\t\treturn 'mini'\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn labelsType\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\t// \"long\" labels type is the default one.\r\n\t\t// (it's always present for all languages)\r\n\t\tlabelsType = labelsType.concat('long')\r\n\r\n\t\t// Find a suitable labels type.\r\n\t\tconst localeData = getLocaleData(this.locale)\r\n\t\tfor (const _labelsType of labelsType) {\r\n\t\t\tif (localeData[_labelsType]) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabelsType: _labelsType,\r\n\t\t\t\t\tlabels: localeData[_labelsType]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Default locale global variable.\r\n */\r\nlet defaultLocale = 'en'\r\n\r\n/**\r\n * Gets default locale.\r\n * @return {string} locale\r\n */\r\nTimeAgo.getDefaultLocale = () => defaultLocale\r\n\r\n/**\r\n * Sets default locale.\r\n * @param {string} locale\r\n */\r\nTimeAgo.setDefaultLocale = (locale) => defaultLocale = locale\r\n\r\n/**\r\n * Adds locale data for a specific locale and marks the locale as default.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addDefaultLocale = function(localeData) {\r\n\tif (defaultLocaleHasBeenSpecified) {\r\n\t\treturn console.error('[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.')\r\n\t}\r\n\tdefaultLocaleHasBeenSpecified = true\r\n\tTimeAgo.setDefaultLocale(localeData.locale)\r\n\tTimeAgo.addLocale(localeData)\r\n}\r\n\r\nlet defaultLocaleHasBeenSpecified\r\n\r\n/**\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n */\r\nTimeAgo.addLocale = function(localeData) {\r\n\taddLocaleData(localeData)\r\n\tRelativeTimeFormatPolyfill.addLocale(localeData)\r\n}\r\n\r\n/**\r\n * (legacy alias)\r\n * Adds locale data for a specific locale.\r\n * @param {Object} localeData\r\n * @deprecated\r\n */\r\nTimeAgo.locale = TimeAgo.addLocale\r\n\r\n/**\r\n * Adds custom labels to locale data.\r\n * @param {string} locale\r\n * @param {string} name\r\n * @param {object} labels\r\n */\r\nTimeAgo.addLabels = (locale, name, labels) => {\r\n\tlet localeData = getLocaleData(locale)\r\n\tif (!localeData) {\r\n\t\taddLocaleData({\r\n\t\t\tlocale\r\n\t\t})\r\n\t\tlocaleData = getLocaleData(locale)\r\n\t\t// throw new Error(`[javascript-time-ago] No data for locale \"${locale}\"`)\r\n\t}\r\n\tlocaleData[name] = labels\r\n}\r\n\r\n// Normalizes `.format()` `time` argument.\r\nfunction getTimestamp(input) {\r\n\tif (input.constructor === Date || isMockedDate(input)) {\r\n\t\treturn input.getTime()\r\n\t}\r\n\r\n\tif (typeof input === 'number') {\r\n\t\treturn input\r\n\t}\r\n\r\n\t// For some weird reason istanbul doesn't see this `throw` covered.\r\n\t/* istanbul ignore next */\r\n\tthrow new Error(`Unsupported relative time formatter input: ${typeof input}, ${input}`)\r\n}\r\n\r\n// During testing via some testing libraries `Date`s aren't actually `Date`s.\r\n// https://github.com/catamphetamine/javascript-time-ago/issues/22\r\nfunction isMockedDate(object) {\r\n\treturn typeof object === 'object' && typeof object.getTime === 'function'\r\n}\r\n\r\n// Get available time interval measurement units.\r\nfunction getTimeIntervalMeasurementUnits(allowedUnits, labels, nowLabel) {\r\n\t// Get all time interval measurement units that're available\r\n\t// in locale data for a given time labels style.\r\n\tlet units = Object.keys(labels)\r\n\r\n\t// `now` unit is handled separately and is shipped in its own `now.json` file.\r\n\t// `now.json` isn't present for all locales, so it could be substituted with\r\n\t// \".second.current\".\r\n\t// Add `now` unit if it's available in locale data.\r\n\tif (nowLabel) {\r\n\t\tunits.push('now')\r\n\t}\r\n\r\n\t// If only a specific set of available time measurement units can be used\r\n\t// then only those units are allowed (if they're present in locale data).\r\n\tif (allowedUnits) {\r\n\t\tunits = allowedUnits.filter(unit => unit === 'now' || units.indexOf(unit) >= 0)\r\n\t}\r\n\r\n\treturn units\r\n}\r\n\r\nfunction getNowLabel(labels, nowLabels, longLabels, future) {\r\n\tconst nowLabel = labels.now || (nowLabels && nowLabels.now)\r\n\t// Specific \"now\" message form extended locale data (if present).\r\n\tif (nowLabel) {\r\n\t\t// Bundle size optimization technique.\r\n\t\tif (typeof nowLabel === 'string') {\r\n\t\t\treturn nowLabel\r\n\t\t}\r\n\t\t// Not handling `value === 0` as `localeData.now.current` here\r\n\t\t// because it wouldn't make sense: \"now\" is a moment,\r\n\t\t// so one can't possibly differentiate between a\r\n\t\t// \"previous\" moment, a \"current\" moment and a \"next moment\".\r\n\t\t// It can only be differentiated between \"past\" and \"future\".\r\n\t\tif (future) {\r\n\t\t\treturn nowLabel.future\r\n\t\t} else {\r\n\t\t\treturn nowLabel.past\r\n\t\t}\r\n\t}\r\n\t// Use \".second.current\" as \"now\" message.\r\n\tif (longLabels && longLabels.second && longLabels.second.current) {\r\n\t\treturn longLabels.second.current\r\n\t}\r\n}\r\n\r\nfunction isStyle(variable) {\r\n\treturn typeof variable === 'string' || isStyleObject(variable)\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,0BAAP,MAAuC,sBAAvC;AAEA,OAAOC,KAAP,MAAkB,YAAlB;AACA,OAAOC,YAAP,MAAyB,aAAzB;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AAEA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,kBAAP,MAA+B,+BAA/B;AACA,OAAOC,mBAAP,MAAgC,gCAAhC;AAEA,SACCC,aADD,EAECC,aAFD,QAGO,sBAHP;AAKA,OAAOC,YAAP,MAAyB,wBAAzB;AACA,OAAOC,cAAP,MAA2B,2BAA3B;AAEA,SAASC,gBAAT,QAAiC,YAAjC,C,CAEA;;AACA,IAAMC,KAAK,GAAG,CACb,KADa,EAEb;AACA,QAHa,EAIb,QAJa,EAKb,MALa,EAMb,KANa,EAOb,MAPa,EAQb,OARa,EASb,SATa,EAUb,MAVa,CAAd;;IAaqBC,O;EACpB;AACD;AACA;AACA;EACC,mBAA6C;IAAA,IAAjCC,OAAiC,uEAAvB,EAAuB;;IAAA,+EAAJ,EAAI;IAAA,IAAjBC,QAAiB,QAAjBA,QAAiB;;IAAA;;IAC5C;IACA,IAAI,OAAOD,OAAP,KAAmB,QAAvB,EAAiC;MAChCA,OAAO,GAAG,CAACA,OAAD,CAAV;IACA,CAJ2C,CAM5C;IACA;IACA;;;IACA,KAAKE,MAAL,GAAcd,YAAY,CACzBY,OAAO,CAACG,M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EACA,IAAII,QAAJ,EAAc;IACb;IACA,IAAI,OAAOA,QAAP,KAAoB,QAAxB,EAAkC;MACjC,OAAOA,QAAP;IACA,CAJY,CAKb;IACA;IACA;IACA;IACA;;;IACA,IAAID,MAAJ,EAAY;MACX,OAAOC,QAAQ,CAACD,MAAhB;IACA,CAFD,MAEO;MACN,OAAOC,QAAQ,CAACuE,IAAhB;IACA;EACD,CAlB0D,CAmB3D;;;EACA,IAAID,UAAU,IAAIA,UAAU,CAACE,MAAzB,IAAmCF,UAAU,CAACE,MAAX,CAAkBC,OAAzD,EAAkE;IACjE,OAAOH,UAAU,CAACE,MAAX,CAAkBC,OAAzB;EACA;AACD;;AAED,SAASrF,OAAT,CAAiBsF,QAAjB,EAA2B;EAC1B,OAAO,OAAOA,QAAP,KAAoB,QAApB,IAAgClH,aAAa,CAACkH,QAAD,CAApD;AACA"}
|
package/modules/TimeAgo.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import TimeAgo from './TimeAgo';
|
|
2
|
-
import { getLocaleData } from '
|
|
1
|
+
import TimeAgo from './TimeAgo.js';
|
|
2
|
+
import { getLocaleData } from './LocaleDataStore.js'; // Load locale specific relative date/time messages
|
|
3
3
|
|
|
4
|
-
import english from '../locale/en'; // Just so this function code is covered.
|
|
4
|
+
import english from '../locale/en.json'; // Just so this function code is covered.
|
|
5
5
|
|
|
6
6
|
TimeAgo.setDefaultLocale('en');
|
|
7
7
|
describe("javascript-time-ago", function () {
|
|
@@ -218,7 +218,7 @@ describe("javascript-time-ago", function () {
|
|
|
218
218
|
return timeAgo.format('Jan 14, 2017');
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
thrower.should
|
|
221
|
+
thrower.should["throw"]('Unsupported relative time formatter input: string, Jan 14, 2017');
|
|
222
222
|
});
|
|
223
223
|
it('should return an empty string if the specified units are not available in locale data', function () {
|
|
224
224
|
var timeAgo = new TimeAgo('en');
|
|
@@ -296,12 +296,12 @@ describe("javascript-time-ago", function () {
|
|
|
296
296
|
}).should.equal('2 г');
|
|
297
297
|
});
|
|
298
298
|
it('should have generated missing quantifier functions for locales that do not have it in CLDR data', function () {
|
|
299
|
-
new TimeAgo('ccp').format(Date.now() + 60 * 1000).should.
|
|
299
|
+
new TimeAgo('ccp').format(Date.now() + 60 * 1000).should.include(' 𑄟𑄨𑄚𑄨𑄘𑄬');
|
|
300
300
|
});
|
|
301
301
|
it('should throw for non-existing locales', function () {
|
|
302
302
|
(function () {
|
|
303
303
|
return TimeAgo.addLocale();
|
|
304
|
-
}).should
|
|
304
|
+
}).should["throw"]('No locale data passed');
|
|
305
305
|
});
|
|
306
306
|
it('should choose "future" variant of a label for `0` if "future: true" option is passed', function () {
|
|
307
307
|
TimeAgo.addLocale(english);
|
|
@@ -615,7 +615,7 @@ describe("javascript-time-ago", function () {
|
|
|
615
615
|
labels: 'long',
|
|
616
616
|
steps: [{}]
|
|
617
617
|
});
|
|
618
|
-
}).to
|
|
618
|
+
}).to["throw"]('Each step must define either `formatAs` or `format()`.');
|
|
619
619
|
});
|
|
620
620
|
it('should add default locale', function () {
|
|
621
621
|
TimeAgo.getDefaultLocale().should.equal('en');
|