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

Function shouldPolyfill

packages/intl-numberformat/should-polyfill.ts:73–84  ·  view source on GitHub ↗
(locale = 'en')

Source from the content-addressed store, hash-verified

71}
72
73export function shouldPolyfill(locale = 'en'): string | undefined {
74 if (
75 typeof Intl === 'undefined' ||
76 !('NumberFormat' in Intl) ||
77 !supportsES2020() ||
78 !supportsES2023() ||
79 onlySupportsEn() ||
80 !supportedLocalesOf(locale)
81 ) {
82 return locale ? match([locale], supportedLocales, 'en') : undefined
83 }
84}

Callers 1

polyfill.tsFile · 0.70

Calls 5

matchFunction · 0.90
supportsES2020Function · 0.85
supportsES2023Function · 0.85
onlySupportsEnFunction · 0.85
supportedLocalesOfFunction · 0.70

Tested by

no test coverage detected