Intl.supportedValuesOf
Traduction Bêta Non Officielle
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Un polyfill/ponyfill conforme à la spécification pour Intl.supportedValuesOf.
Installation
- npm
- yarn
npm i @formatjs/intl-enumerator
yarn add @formatjs/intl-enumerator
Prérequis
Utilisation
Exemple simple
import '@formatjs/intl-enumerator/polyfill'
Import dynamique + détection de capacités
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
Cette bibliothèque est conforme à test262.