@formatjs/intl-enumerator 1.1.2 → 1.1.4
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/index.d.ts +9 -0
- package/index.d.ts.map +1 -0
- package/index.js +7 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/lib/polyfill-force.d.ts +2 -0
- package/lib/polyfill-force.d.ts.map +1 -0
- package/lib/polyfill-force.js +7 -0
- package/lib/polyfill.d.ts +2 -0
- package/lib/polyfill.d.ts.map +1 -0
- package/lib/polyfill.js +10 -0
- package/lib/should-polyfill.d.ts +2 -0
- package/lib/should-polyfill.d.ts.map +1 -0
- package/lib/should-polyfill.js +3 -0
- package/lib/src/calendars.generated.d.ts +3 -0
- package/lib/src/calendars.generated.d.ts.map +1 -0
- package/lib/src/calendars.generated.js +3 -0
- package/lib/src/collations.generated.d.ts +3 -0
- package/lib/src/collations.generated.d.ts.map +1 -0
- package/lib/src/collations.generated.js +3 -0
- package/lib/src/currencies.generated.d.ts +3 -0
- package/lib/src/currencies.generated.d.ts.map +1 -0
- package/lib/src/currencies.generated.js +3 -0
- package/lib/src/get-supported-calendars.d.ts +3 -0
- package/lib/src/get-supported-calendars.d.ts.map +1 -0
- package/lib/src/get-supported-calendars.js +14 -0
- package/lib/src/get-supported-collations.d.ts +3 -0
- package/lib/src/get-supported-collations.d.ts.map +1 -0
- package/lib/src/get-supported-collations.js +11 -0
- package/lib/src/get-supported-currencies.d.ts +3 -0
- package/lib/src/get-supported-currencies.d.ts.map +1 -0
- package/lib/src/get-supported-currencies.js +40 -0
- package/lib/src/get-supported-numbering-systems.d.ts +2 -0
- package/lib/src/get-supported-numbering-systems.d.ts.map +1 -0
- package/lib/src/get-supported-numbering-systems.js +16 -0
- package/lib/src/get-supported-timezones.d.ts +3 -0
- package/lib/src/get-supported-timezones.d.ts.map +1 -0
- package/lib/src/get-supported-timezones.js +12 -0
- package/lib/src/get-supported-units.d.ts +2 -0
- package/lib/src/get-supported-units.d.ts.map +1 -0
- package/lib/src/get-supported-units.js +12 -0
- package/lib/src/index.d.ts +3 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +24 -0
- package/lib/src/numbering-systems.generated.d.ts +2 -0
- package/lib/src/numbering-systems.generated.d.ts.map +1 -0
- package/lib/src/numbering-systems.generated.js +1 -0
- package/lib/src/timezones.generated.d.ts +3 -0
- package/lib/src/timezones.generated.d.ts.map +1 -0
- package/lib/src/timezones.generated.js +3 -0
- package/lib/src/units.generated.d.ts +3 -0
- package/lib/src/units.generated.d.ts.map +1 -0
- package/lib/src/units.generated.js +3 -0
- package/package.json +2 -2
- package/polyfill-force.d.ts +2 -0
- package/polyfill-force.d.ts.map +1 -0
- package/polyfill-force.js +9 -0
- package/polyfill.d.ts +2 -0
- package/polyfill.d.ts.map +1 -0
- package/polyfill.js +12 -0
- package/should-polyfill.d.ts +2 -0
- package/should-polyfill.d.ts.map +1 -0
- package/should-polyfill.js +7 -0
- package/src/calendars.generated.d.ts +3 -0
- package/src/calendars.generated.d.ts.map +1 -0
- package/src/calendars.generated.js +6 -0
- package/src/collations.generated.d.ts +3 -0
- package/src/collations.generated.d.ts.map +1 -0
- package/src/collations.generated.js +6 -0
- package/src/currencies.generated.d.ts +3 -0
- package/src/currencies.generated.d.ts.map +1 -0
- package/src/currencies.generated.js +6 -0
- package/src/get-supported-calendars.d.ts +3 -0
- package/src/get-supported-calendars.d.ts.map +1 -0
- package/src/get-supported-calendars.js +18 -0
- package/src/get-supported-collations.d.ts +3 -0
- package/src/get-supported-collations.d.ts.map +1 -0
- package/src/get-supported-collations.js +15 -0
- package/src/get-supported-currencies.d.ts +3 -0
- package/src/get-supported-currencies.d.ts.map +1 -0
- package/src/get-supported-currencies.js +44 -0
- package/src/get-supported-numbering-systems.d.ts +2 -0
- package/src/get-supported-numbering-systems.d.ts.map +1 -0
- package/src/get-supported-numbering-systems.js +20 -0
- package/src/get-supported-timezones.d.ts +3 -0
- package/src/get-supported-timezones.d.ts.map +1 -0
- package/src/get-supported-timezones.js +16 -0
- package/src/get-supported-units.d.ts +2 -0
- package/src/get-supported-units.d.ts.map +1 -0
- package/src/get-supported-units.js +16 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +28 -0
- package/src/numbering-systems.generated.d.ts +2 -0
- package/src/numbering-systems.generated.d.ts.map +1 -0
- package/src/numbering-systems.generated.js +4 -0
- package/src/timezones.generated.d.ts +3 -0
- package/src/timezones.generated.d.ts.map +1 -0
- package/src/timezones.generated.js +6 -0
- package/src/units.generated.d.ts +3 -0
- package/src/units.generated.d.ts.map +1 -0
- package/src/units.generated.js +6 -0
- package/BUILD +0 -136
- package/CHANGELOG.md +0 -25
- package/index.ts +0 -9
- package/polyfill-force.ts +0 -8
- package/polyfill.ts +0 -11
- package/scripts/calendars.ts +0 -21
- package/scripts/collations.ts +0 -21
- package/scripts/currencies.ts +0 -21
- package/scripts/timezones.ts +0 -22
- package/scripts/units.ts +0 -23
- package/should-polyfill.ts +0 -3
- package/src/calendars.generated.ts +0 -5
- package/src/collations.generated.ts +0 -5
- package/src/currencies.generated.ts +0 -5
- package/src/get-supported-calendars.ts +0 -17
- package/src/get-supported-collations.ts +0 -16
- package/src/get-supported-currencies.ts +0 -48
- package/src/get-supported-numbering-systems.ts +0 -21
- package/src/get-supported-timezones.ts +0 -15
- package/src/get-supported-units.ts +0 -15
- package/src/index.ts +0 -33
- package/src/numbering-systems.generated.ts +0 -1
- package/src/timezones.generated.ts +0 -5
- package/src/units.generated.ts +0 -4
- package/tests/index.test.ts +0 -47
- package/tsconfig.json +0 -5
package/scripts/timezones.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import minimist from 'minimist'
|
|
2
|
-
import {outputFileSync} from 'fs-extra'
|
|
3
|
-
interface Args extends minimist.ParsedArgs {
|
|
4
|
-
zone: string[]
|
|
5
|
-
}
|
|
6
|
-
function main(args: Args) {
|
|
7
|
-
const {out, zone: timezones} = args
|
|
8
|
-
|
|
9
|
-
// Output numbering systems file
|
|
10
|
-
outputFileSync(
|
|
11
|
-
out,
|
|
12
|
-
`/* @generated */
|
|
13
|
-
// prettier-ignore
|
|
14
|
-
export const timezones = ${JSON.stringify(timezones)} as const
|
|
15
|
-
export type Timezone = typeof timezones[number]
|
|
16
|
-
`
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (require.main === module) {
|
|
21
|
-
main(minimist<Args>(process.argv))
|
|
22
|
-
}
|
package/scripts/units.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import minimist from 'minimist'
|
|
2
|
-
import {outputFileSync} from 'fs-extra'
|
|
3
|
-
import {SIMPLE_UNITS} from '@formatjs/ecma402-abstract'
|
|
4
|
-
|
|
5
|
-
interface Args extends minimist.ParsedArgs {
|
|
6
|
-
zone: string[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function main(args: Args) {
|
|
10
|
-
const {out} = args
|
|
11
|
-
|
|
12
|
-
outputFileSync(
|
|
13
|
-
out,
|
|
14
|
-
`/* @generated */
|
|
15
|
-
// prettier-ignore
|
|
16
|
-
export const units = ${JSON.stringify(SIMPLE_UNITS)} as const
|
|
17
|
-
export type Unit = typeof units[number]`
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (require.main === module) {
|
|
22
|
-
main(minimist<Args>(process.argv))
|
|
23
|
-
}
|
package/should-polyfill.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
export const calendars = ["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-civil","islamic-rgsa","islamic-tbla","islamic-umalqura","islamicc","iso8601","japanese","persian","roc"] as const
|
|
4
|
-
export type Calendar = typeof calendars[number]
|
|
5
|
-
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
export const collations = ["big5han","compat","dict","direct","ducet","emoji","eor","gb2312","phonebk","phonetic","pinyin","reformed","search","searchjl","standard","stroke","trad","unihan","zhuyin"] as const
|
|
4
|
-
export type Collation = typeof collations[number]
|
|
5
|
-
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
export const currencies = ["ADP","AED","AFA","AFN","ALK","ALL","AMD","ANG","AOA","AOK","AON","AOR","ARA","ARL","ARM","ARP","ARS","ATS","AUD","AWG","AZM","AZN","BAD","BAM","BAN","BBD","BDT","BEC","BEF","BEL","BGL","BGM","BGN","BGO","BHD","BIF","BMD","BND","BOB","BOL","BOP","BOV","BRB","BRC","BRE","BRL","BRN","BRR","BRZ","BSD","BTN","BUK","BWP","BYB","BYN","BYR","BZD","CAD","CDF","CHE","CHF","CHW","CLE","CLF","CLP","CNH","CNX","CNY","COP","COU","CRC","CSD","CSK","CUC","CUP","CVE","CYP","CZK","DDM","DEM","DJF","DKK","DOP","DZD","ECS","ECV","EEK","EGP","ERN","ESA","ESB","ESP","ETB","EUR","FIM","FJD","FKP","FRF","GBP","GEK","GEL","GHC","GHS","GIP","GMD","GNF","GNS","GQE","GRD","GTQ","GWE","GWP","GYD","HKD","HNL","HRD","HRK","HTG","HUF","IDR","IEP","ILP","ILR","ILS","INR","IQD","IRR","ISJ","ISK","ITL","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRH","KRO","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LTT","LUC","LUF","LUL","LVL","LVR","LYD","MAD","MAF","MCF","MDC","MDL","MGA","MGF","MKD","MKN","MLF","MMK","MNT","MOP","MRO","MRU","MTL","MTP","MUR","MVP","MVR","MWK","MXN","MXP","MXV","MYR","MZE","MZM","MZN","NAD","NGN","NIC","NIO","NLG","NOK","NPR","NZD","OMR","PAB","PEI","PEN","PES","PGK","PHP","PKR","PLN","PLZ","PTE","PYG","QAR","RHD","ROL","RON","RSD","RUB","RUR","RWF","SAR","SBD","SCR","SDD","SDG","SDP","SEK","SGD","SHP","SIT","SKK","SLL","SOS","SRD","SRG","SSP","STD","STN","SUR","SVC","SYP","SZL","THB","TJR","TJS","TMM","TMT","TND","TOP","TPE","TRL","TRY","TTD","TWD","TZS","UAH","UAK","UGS","UGX","USD","USN","USS","UYI","UYP","UYU","UYW","UZS","VEB","VEF","VES","VND","VNN","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XEU","XFO","XFU","XOF","XPD","XPF","XPT","XRE","XSU","XTS","XUA","XXX","YDD","YER","YUD","YUM","YUN","YUR","ZAL","ZAR","ZMK","ZMW","ZRN","ZRZ","ZWD","ZWL","ZWR"] as const
|
|
4
|
-
export type Currency = typeof currencies[number]
|
|
5
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type {Calendar} from './calendars.generated'
|
|
2
|
-
import {calendars} from './calendars.generated'
|
|
3
|
-
|
|
4
|
-
function isSupportedCalendar(item: Calendar): boolean {
|
|
5
|
-
try {
|
|
6
|
-
const dateTimeFormat = new Intl.DateTimeFormat('en-u-ca' + item)
|
|
7
|
-
const options = dateTimeFormat.resolvedOptions().calendar
|
|
8
|
-
|
|
9
|
-
if (item !== 'gregory' || options !== 'gregory') return true
|
|
10
|
-
} catch (_err) {}
|
|
11
|
-
|
|
12
|
-
return false
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function getSupportedCalendars(): Calendar[] {
|
|
16
|
-
return calendars.filter(isSupportedCalendar)
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type {Collation} from './collations.generated'
|
|
2
|
-
import {collations} from './collations.generated'
|
|
3
|
-
|
|
4
|
-
function isSupported(collation: Collation): boolean {
|
|
5
|
-
try {
|
|
6
|
-
return (
|
|
7
|
-
Intl.Collator('en-u-co-' + collation).resolvedOptions().locale === 'en'
|
|
8
|
-
)
|
|
9
|
-
} catch (_err) {}
|
|
10
|
-
|
|
11
|
-
return false
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getSupportedCollations(): Collation[] {
|
|
15
|
-
return collations.filter(isSupported)
|
|
16
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type {Currency} from './currencies.generated'
|
|
2
|
-
import {currencies} from './currencies.generated'
|
|
3
|
-
|
|
4
|
-
function isSupportedCurrency(currency: Currency): boolean {
|
|
5
|
-
try {
|
|
6
|
-
const numberFormat = new Intl.NumberFormat('en', {
|
|
7
|
-
style: 'currency',
|
|
8
|
-
currencyDisplay: 'name',
|
|
9
|
-
currency,
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
const format = numberFormat.format(123)
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
format.substring(0, 3) !== currency &&
|
|
16
|
-
format.substring(format.length - 3) !== currency
|
|
17
|
-
) {
|
|
18
|
-
return true
|
|
19
|
-
}
|
|
20
|
-
} catch (_err) {}
|
|
21
|
-
|
|
22
|
-
return false
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function getSupportedCurrencies(): Currency[] {
|
|
26
|
-
const ATOZ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
27
|
-
const supportedCurrencies: Currency[] = []
|
|
28
|
-
|
|
29
|
-
for (const currency of currencies) {
|
|
30
|
-
if (currency.length === 3) {
|
|
31
|
-
if (isSupportedCurrency(currency)) {
|
|
32
|
-
supportedCurrencies.push(currency)
|
|
33
|
-
}
|
|
34
|
-
} else if (currency.length === 5 && currency[3] === '~') {
|
|
35
|
-
const start = ATOZ.indexOf(currency[2])
|
|
36
|
-
const end = ATOZ.indexOf(currency[4])
|
|
37
|
-
|
|
38
|
-
for (let i = start; i <= end; i++) {
|
|
39
|
-
const currentCurrency = (currency.substring(0, 2) + ATOZ[i]) as Currency
|
|
40
|
-
if (isSupportedCurrency(currentCurrency)) {
|
|
41
|
-
supportedCurrencies.push(currentCurrency)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return supportedCurrencies
|
|
48
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {numberingSystemNames} from './numbering-systems.generated'
|
|
2
|
-
|
|
3
|
-
function isSupportedNumberingSystem(system: string): boolean {
|
|
4
|
-
try {
|
|
5
|
-
const numberFormat = new Intl.NumberFormat('en-u-nu-' + system)
|
|
6
|
-
const options = numberFormat.resolvedOptions().numberingSystem
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
(options === system && system === 'latn') ||
|
|
10
|
-
numberFormat.format(123) !== '123'
|
|
11
|
-
) {
|
|
12
|
-
return true
|
|
13
|
-
}
|
|
14
|
-
} catch (_err) {}
|
|
15
|
-
|
|
16
|
-
return false
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getSupportedNumberingSystems(): string[] {
|
|
20
|
-
return numberingSystemNames.filter(isSupportedNumberingSystem)
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type {Timezone} from './timezones.generated'
|
|
2
|
-
import {timezones} from './timezones.generated'
|
|
3
|
-
|
|
4
|
-
function isSupported(timeZone: Timezone): boolean {
|
|
5
|
-
try {
|
|
6
|
-
const formatter = new Intl.DateTimeFormat('en', {timeZone})
|
|
7
|
-
return formatter.resolvedOptions().timeZone === timeZone
|
|
8
|
-
} catch (_err) {}
|
|
9
|
-
|
|
10
|
-
return false
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getSupportedTimeZones(): Timezone[] {
|
|
14
|
-
return timezones.filter(isSupported)
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type {Unit} from './units.generated'
|
|
2
|
-
import {units} from './units.generated'
|
|
3
|
-
|
|
4
|
-
function isSupported(unit: Unit): boolean {
|
|
5
|
-
try {
|
|
6
|
-
const formatter = new Intl.NumberFormat('en', {style: 'unit', unit})
|
|
7
|
-
return formatter.resolvedOptions().unit === unit
|
|
8
|
-
} catch (_err) {}
|
|
9
|
-
|
|
10
|
-
return false
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getSupportedUnits() {
|
|
14
|
-
return units.filter(isSupported)
|
|
15
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {getSupportedCalendars} from './get-supported-calendars'
|
|
2
|
-
import {getSupportedCollations} from './get-supported-collations'
|
|
3
|
-
import {getSupportedCurrencies} from './get-supported-currencies'
|
|
4
|
-
import {getSupportedNumberingSystems} from './get-supported-numbering-systems'
|
|
5
|
-
import {getSupportedTimeZones} from './get-supported-timezones'
|
|
6
|
-
import {getSupportedUnits} from './get-supported-units'
|
|
7
|
-
|
|
8
|
-
export type SupportedValuesOf =
|
|
9
|
-
| 'calendar'
|
|
10
|
-
| 'collation'
|
|
11
|
-
| 'currency'
|
|
12
|
-
| 'numberingSystem'
|
|
13
|
-
| 'timeZone'
|
|
14
|
-
| 'unit'
|
|
15
|
-
|
|
16
|
-
export function supportedValuesOf(key: SupportedValuesOf): string[] {
|
|
17
|
-
switch (key) {
|
|
18
|
-
case 'calendar':
|
|
19
|
-
return getSupportedCalendars()
|
|
20
|
-
case 'collation':
|
|
21
|
-
return getSupportedCollations()
|
|
22
|
-
case 'currency':
|
|
23
|
-
return getSupportedCurrencies()
|
|
24
|
-
case 'numberingSystem':
|
|
25
|
-
return getSupportedNumberingSystems()
|
|
26
|
-
case 'timeZone':
|
|
27
|
-
return getSupportedTimeZones()
|
|
28
|
-
case 'unit':
|
|
29
|
-
return getSupportedUnits()
|
|
30
|
-
default:
|
|
31
|
-
throw RangeError('Invalid key: ' + key)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const numberingSystemNames: ReadonlyArray<string> = ["adlm","ahom","arab","arabext","armn","armnlow","bali","beng","bhks","brah","cakm","cham","cyrl","deva","diak","ethi","fullwide","geor","gong","gonm","grek","greklow","gujr","guru","hanidays","hanidec","hans","hansfin","hant","hantfin","hebr","hmng","hmnp","java","jpan","jpanfin","jpanyear","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","roman","romanlow","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","taml","tamldec","telu","thai","tibt","tirh","tnsa","vaii","wara","wcho"];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
export const timezones = ["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia_Banderas","America/Bahia","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson_Creek","America/Dawson","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"] as const
|
|
4
|
-
export type Timezone = typeof timezones[number]
|
|
5
|
-
|
package/src/units.generated.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
export const units = ["degree","acre","hectare","percent","bit","byte","gigabit","gigabyte","kilobit","kilobyte","megabit","megabyte","petabyte","terabit","terabyte","day","hour","millisecond","minute","month","second","week","year","centimeter","foot","inch","kilometer","meter","mile-scandinavian","mile","millimeter","yard","gram","kilogram","ounce","pound","stone","celsius","fahrenheit","fluid-ounce","gallon","liter","milliliter"] as const
|
|
4
|
-
export type Unit = typeof units[number]
|
package/tests/index.test.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {supportedValuesOf} from '../src'
|
|
2
|
-
|
|
3
|
-
describe('Intl.supportedValueOf("calendar")', () => {
|
|
4
|
-
it('should return an array of supported calendars', () => {
|
|
5
|
-
expect(supportedValuesOf('calendar')).toEqual(expect.any(Array))
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
it('should throw a range error when given an unsupported or misspelled key', () => {
|
|
9
|
-
// @ts-expect-error
|
|
10
|
-
expect(() => supportedValuesOf('calendars')).toThrowError(
|
|
11
|
-
'Invalid key: calendars'
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
// @ts-expect-error
|
|
15
|
-
expect(() => supportedValuesOf('calendarz')).toThrowError(RangeError)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
describe('Intl.supportedValueOf("collation")', () => {
|
|
20
|
-
it('should return an array of supported collations', () => {
|
|
21
|
-
expect(supportedValuesOf('collation')).toEqual(expect.any(Array))
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
describe('Intl.supportedValueOf("currency")', () => {
|
|
26
|
-
it('should return an array of supported currencies', () => {
|
|
27
|
-
expect(supportedValuesOf('currency')).toEqual(expect.any(Array))
|
|
28
|
-
})
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
describe('Intl.supportedValueOf("numberingSystem")', () => {
|
|
32
|
-
it('should return an array of supported numbering systems', () => {
|
|
33
|
-
expect(supportedValuesOf('numberingSystem')).toEqual(expect.any(Array))
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
describe('Intl.supportedValueOf("timeZone")', () => {
|
|
38
|
-
it('should return an array of supported time zones', () => {
|
|
39
|
-
expect(supportedValuesOf('timeZone')).toEqual(expect.any(Array))
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
describe('Intl.supportedValueOf("unit")', () => {
|
|
44
|
-
it('should return an array of supported units', () => {
|
|
45
|
-
expect(supportedValuesOf('unit')).toEqual(expect.any(Array))
|
|
46
|
-
})
|
|
47
|
-
})
|