Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import(/* webpackChunkName: "locale.[request]" */ `intl/locale-data/jsonp/${locale}`),
)
}
if (!window.Intl.PluralRules) {
log(`Polyfilling Intl.PluralRules`)
promises.push(import('intl-pluralrules'))
}
if (!window.Intl.RelativeTimeFormat) {
log(`Polyfilling Intl.RelativeTimeFormat data for language ${language}`)
promises.push(import('@formatjs/intl-relativetimeformat/polyfill'))
promises.push(import(`@formatjs/intl-relativetimeformat/dist/locale-data/${language}`))
}
return CancelablePromise.resolve(Promise.all(promises))
.then(result => this.success(result, withLocale))
.catch(this.fail)
}