MCPcopy
hub / github.com/formatjs/formatjs / shouldPolyfill

Function shouldPolyfill

packages/intl-listformat/should-polyfill.ts:15–23  ·  view source on GitHub ↗
(locale = 'en')

Source from the content-addressed store, hash-verified

13}
14
15export function shouldPolyfill(locale = 'en'): string | undefined {
16 if (
17 typeof Intl === 'undefined' ||
18 !('ListFormat' in Intl) ||
19 !supportedLocalesOf(locale)
20 ) {
21 return locale ? match([locale], supportedLocales, 'en') : undefined
22 }
23}

Callers 1

polyfill.tsFile · 0.70

Calls 2

matchFunction · 0.90
supportedLocalesOfFunction · 0.70

Tested by

no test coverage detected