babel-plugin-polyfill-corejs2 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/built-in-definitions.js +11 -2
- package/package.json +2 -2
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.StaticProperties = exports.InstanceProperties = exports.BuiltIns = exports.CommonIterators = void 0;
|
|
5
5
|
|
|
6
|
+
var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
6
10
|
const define = (name, pure, global = [], meta) => {
|
|
7
11
|
return {
|
|
8
12
|
name,
|
|
@@ -91,7 +95,6 @@ const InstanceProperties = {
|
|
|
91
95
|
repeat: globalOnly(["es6.string.repeat"]),
|
|
92
96
|
replace: globalOnly(["es6.regexp.replace"]),
|
|
93
97
|
search: globalOnly(["es6.regexp.search"]),
|
|
94
|
-
slice: globalOnly(["es6.array.slice"]),
|
|
95
98
|
small: globalOnly(["es6.string.small"]),
|
|
96
99
|
some: globalOnly(["es6.array.some"]),
|
|
97
100
|
sort: globalOnly(["es6.array.sort"]),
|
|
@@ -109,8 +112,14 @@ const InstanceProperties = {
|
|
|
109
112
|
trimRight: globalOnly(["es7.string.trim-right"]),
|
|
110
113
|
trimStart: globalOnly(["es7.string.trim-left"]),
|
|
111
114
|
values: globalOnly(ArrayNatureIterators)
|
|
112
|
-
};
|
|
115
|
+
}; // This isn't present in older @babel/compat-data versions
|
|
116
|
+
|
|
113
117
|
exports.InstanceProperties = InstanceProperties;
|
|
118
|
+
|
|
119
|
+
if ("es6.array.slice" in _corejs2BuiltIns.default) {
|
|
120
|
+
InstanceProperties.slice = globalOnly(["es6.array.slice"]);
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
const StaticProperties = {
|
|
115
124
|
Array: {
|
|
116
125
|
from: pureAndGlobal("array/from", ["es6.symbol", "es6.array.from", ...CommonIterators]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-polyfill-corejs2",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A Babel plugin to inject imports to core-js@2 polyfills",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@babel/core": "^7.0.0-0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8a59cefc151aa2104f4e4f921ec9c743a9d4eb72"
|
|
33
33
|
}
|