Skip to main content

Intl.supportedValuesOf

A spec-compliant polyfill/ponyfill for Intl.supportedValuesOf.

npm Version size

Installation

npm i @formatjs/intl-enumerator

Requirements

Usage

Via polyfill.io

You can use polyfill.io URL Builder to create a polyfill script tag for Intl.supportedValuesOf. For example:

<!-- Polyfill Intl.supportedValuesOf & its dependencies -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.supportedValuesOf"></script>

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.