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