UNPKG

@formatjs/intl-getcanonicallocales

Version:

Intl.getCanonicalLocales polyfill

27 lines (26 loc) 839 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _1 = require("./"); var should_polyfill_1 = require("./should-polyfill"); if (typeof Intl === 'undefined') { if (typeof window !== 'undefined') { Object.defineProperty(window, 'Intl', { value: {}, }); // @ts-ignore we don't include @types/node so global isn't a thing } else if (typeof global !== 'undefined') { // @ts-ignore we don't include @types/node so global isn't a thing Object.defineProperty(global, 'Intl', { value: {}, }); } } if ((0, should_polyfill_1.shouldPolyfill)()) { Object.defineProperty(Intl, 'getCanonicalLocales', { value: _1.getCanonicalLocales, writable: true, enumerable: false, configurable: true, }); }