-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@formatjs/intl-getcanonicallocales): expose polyfill-force varia…
…nt (#3997)
- Loading branch information
1 parent
31561be
commit d513ce6
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {getCanonicalLocales} from './' | ||
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: {}, | ||
}) | ||
} | ||
} | ||
Object.defineProperty(Intl, 'getCanonicalLocales', { | ||
value: getCanonicalLocales, | ||
writable: true, | ||
enumerable: false, | ||
configurable: true, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters