Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
915 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | exports.__esModule = true;
|
---|
| 4 | exports.default = _default;
|
---|
| 5 |
|
---|
| 6 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
---|
| 7 |
|
---|
| 8 | const webPolyfills = {
|
---|
| 9 | "web.timers": {},
|
---|
| 10 | "web.immediate": {},
|
---|
| 11 | "web.dom.iterable": {}
|
---|
| 12 | };
|
---|
| 13 | const purePolyfills = {
|
---|
| 14 | "es6.parse-float": {},
|
---|
| 15 | "es6.parse-int": {},
|
---|
| 16 | "es7.string.at": {}
|
---|
| 17 | };
|
---|
| 18 |
|
---|
| 19 | function _default(targets, method, polyfills) {
|
---|
| 20 | const targetNames = Object.keys(targets);
|
---|
| 21 | const isAnyTarget = !targetNames.length;
|
---|
| 22 | const isWebTarget = targetNames.some(name => name !== "node");
|
---|
| 23 | return _extends({}, polyfills, method === "usage-pure" ? purePolyfills : null, isAnyTarget || isWebTarget ? webPolyfills : null);
|
---|
| 24 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.