Intl.supportedValuesOf
A spec-compliant polyfill/ponyfill for Intl.supportedValuesOf
.
Installationâ
- npm
- yarn
npm i @formatjs/intl-enumerator
yarn add @formatjs/intl-enumerator
Requirementsâ
Usageâ
Simpleâ
import '@formatjs/intl-enumerator/polyfill'
Dynamic import + capability detectionâ
import {shouldPolyfill} from '@formatjs/intl-enumerator/should-polyfill'
async function polyfill() {
// This platform already supports Intl.supportedValuesOf
if (shouldPolyfill()) {
await import('@formatjs/intl-enumerator/polyfill')
}
// Alternatively, force the polyfill regardless of support
await import('@formatjs/intl-enumerator/polyfill-force')
}
Testsâ
This library is test262-compliant.