forked from andyearnshaw/Intl.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (16 loc) · 727 Bytes
/
Copy pathindex.js
File metadata and controls
20 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var m = require('./lib/core.js'),
IntlPolyfill = m['default'];
// Expose `IntlPolyfill` as global to add locale data into runtime later on.
global.IntlPolyfill = IntlPolyfill;
// Require all locale data for `Intl`. This module will be
// ignored when bundling for the browser with Browserify/Webpack.
require('./locale-data/complete.js');
// hack to export the polyfill as global Intl if needed
if (!global.Intl) {
global.Intl = IntlPolyfill;
IntlPolyfill.__applyLocaleSensitivePrototypes();
}
// providing an idiomatic api for the nodejs version of this module
module.exports = exports = IntlPolyfill;
// preserving the original api in case another module is relying on that
exports['default'] = IntlPolyfill;