core-js-compat 3.0.0-beta.6 → 3.0.0
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/README.md +37 -1
- package/data.json +1418 -1175
- package/entries.json +7413 -0
- package/get-modules-list-for-target-version.js +17 -0
- package/index.js +21 -10
- package/modules-by-versions.json +294 -0
- package/package.json +9 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const { coerce, lte } = require('semver');
|
|
3
|
+
const modulesByVersions = require('./modules-by-versions');
|
|
4
|
+
|
|
5
|
+
module.exports = function (raw) {
|
|
6
|
+
const corejs = coerce(String(raw));
|
|
7
|
+
if (corejs.major !== 3) {
|
|
8
|
+
throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');
|
|
9
|
+
}
|
|
10
|
+
const result = [];
|
|
11
|
+
for (const version of Object.keys(modulesByVersions)) {
|
|
12
|
+
if (lte(coerce(version), corejs)) {
|
|
13
|
+
result.push(...modulesByVersions[version]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
};
|
package/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const { coerce, lt, lte } = require('semver');
|
|
3
3
|
const browserslist = require('browserslist');
|
|
4
4
|
const data = require('./data');
|
|
5
|
+
const getModulesListForTargetVersion = require('./get-modules-list-for-target-version');
|
|
6
|
+
const intersection = require('core-js-pure/features/set/intersection');
|
|
5
7
|
const has = Function.call.bind({}.hasOwnProperty);
|
|
6
8
|
|
|
7
9
|
const mapping = new Map([
|
|
@@ -11,16 +13,18 @@ const mapping = new Map([
|
|
|
11
13
|
]);
|
|
12
14
|
|
|
13
15
|
const validTargets = new Set([
|
|
14
|
-
'ie',
|
|
15
|
-
'chrome',
|
|
16
|
-
'opera',
|
|
17
|
-
'node',
|
|
18
16
|
'android',
|
|
17
|
+
'chrome',
|
|
18
|
+
'edge',
|
|
19
|
+
'electron',
|
|
19
20
|
'firefox',
|
|
21
|
+
'ie',
|
|
22
|
+
'ios',
|
|
23
|
+
'node',
|
|
24
|
+
'opera',
|
|
25
|
+
'phantom',
|
|
20
26
|
'safari',
|
|
21
|
-
'edge',
|
|
22
27
|
'samsung',
|
|
23
|
-
'ios',
|
|
24
28
|
]);
|
|
25
29
|
|
|
26
30
|
function coercedLte(a, b) {
|
|
@@ -66,7 +70,7 @@ function checkModule(name, targets) {
|
|
|
66
70
|
return result;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
function compat({ targets, filter, version }) {
|
|
70
74
|
const list = browserslist(targets);
|
|
71
75
|
const engines = normalizeBrowsersList(list);
|
|
72
76
|
const reducedTargets = reduceByMinVersion(engines);
|
|
@@ -76,11 +80,14 @@ module.exports = function ({ targets, modules, filter }) {
|
|
|
76
80
|
targets: {},
|
|
77
81
|
};
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
let modules = Array.isArray(filter) ? filter : Object.keys(data);
|
|
80
84
|
|
|
81
85
|
if (filter instanceof RegExp) modules = modules.filter(it => filter.test(it));
|
|
82
86
|
else if (typeof filter == 'string') modules = modules.filter(it => it.startsWith(filter));
|
|
83
|
-
|
|
87
|
+
|
|
88
|
+
if (version) {
|
|
89
|
+
modules = [...intersection(new Set(getModulesListForTargetVersion(version)), new Set(modules))];
|
|
90
|
+
}
|
|
84
91
|
|
|
85
92
|
modules.forEach(key => {
|
|
86
93
|
const check = checkModule(key, reducedTargets);
|
|
@@ -91,4 +98,8 @@ module.exports = function ({ targets, modules, filter }) {
|
|
|
91
98
|
});
|
|
92
99
|
|
|
93
100
|
return result;
|
|
94
|
-
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
module.exports = compat;
|
|
104
|
+
module.exports.compat = compat;
|
|
105
|
+
module.exports.getModulesListForTargetVersion = getModulesListForTargetVersion;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
{
|
|
2
|
+
"3.0": [
|
|
3
|
+
"es.symbol",
|
|
4
|
+
"es.symbol.description",
|
|
5
|
+
"es.symbol.async-iterator",
|
|
6
|
+
"es.symbol.has-instance",
|
|
7
|
+
"es.symbol.is-concat-spreadable",
|
|
8
|
+
"es.symbol.iterator",
|
|
9
|
+
"es.symbol.match",
|
|
10
|
+
"es.symbol.replace",
|
|
11
|
+
"es.symbol.search",
|
|
12
|
+
"es.symbol.species",
|
|
13
|
+
"es.symbol.split",
|
|
14
|
+
"es.symbol.to-primitive",
|
|
15
|
+
"es.symbol.to-string-tag",
|
|
16
|
+
"es.symbol.unscopables",
|
|
17
|
+
"es.array.concat",
|
|
18
|
+
"es.array.copy-within",
|
|
19
|
+
"es.array.every",
|
|
20
|
+
"es.array.fill",
|
|
21
|
+
"es.array.filter",
|
|
22
|
+
"es.array.find",
|
|
23
|
+
"es.array.find-index",
|
|
24
|
+
"es.array.flat",
|
|
25
|
+
"es.array.flat-map",
|
|
26
|
+
"es.array.for-each",
|
|
27
|
+
"es.array.from",
|
|
28
|
+
"es.array.includes",
|
|
29
|
+
"es.array.index-of",
|
|
30
|
+
"es.array.is-array",
|
|
31
|
+
"es.array.iterator",
|
|
32
|
+
"es.array.join",
|
|
33
|
+
"es.array.last-index-of",
|
|
34
|
+
"es.array.map",
|
|
35
|
+
"es.array.of",
|
|
36
|
+
"es.array.reduce",
|
|
37
|
+
"es.array.reduce-right",
|
|
38
|
+
"es.array.reverse",
|
|
39
|
+
"es.array.slice",
|
|
40
|
+
"es.array.some",
|
|
41
|
+
"es.array.sort",
|
|
42
|
+
"es.array.species",
|
|
43
|
+
"es.array.splice",
|
|
44
|
+
"es.array.unscopables.flat",
|
|
45
|
+
"es.array.unscopables.flat-map",
|
|
46
|
+
"es.array-buffer.constructor",
|
|
47
|
+
"es.array-buffer.is-view",
|
|
48
|
+
"es.array-buffer.slice",
|
|
49
|
+
"es.data-view",
|
|
50
|
+
"es.date.now",
|
|
51
|
+
"es.date.to-iso-string",
|
|
52
|
+
"es.date.to-json",
|
|
53
|
+
"es.date.to-primitive",
|
|
54
|
+
"es.date.to-string",
|
|
55
|
+
"es.function.bind",
|
|
56
|
+
"es.function.has-instance",
|
|
57
|
+
"es.function.name",
|
|
58
|
+
"es.json.to-string-tag",
|
|
59
|
+
"es.map",
|
|
60
|
+
"es.math.acosh",
|
|
61
|
+
"es.math.asinh",
|
|
62
|
+
"es.math.atanh",
|
|
63
|
+
"es.math.cbrt",
|
|
64
|
+
"es.math.clz32",
|
|
65
|
+
"es.math.cosh",
|
|
66
|
+
"es.math.expm1",
|
|
67
|
+
"es.math.fround",
|
|
68
|
+
"es.math.hypot",
|
|
69
|
+
"es.math.imul",
|
|
70
|
+
"es.math.log10",
|
|
71
|
+
"es.math.log1p",
|
|
72
|
+
"es.math.log2",
|
|
73
|
+
"es.math.sign",
|
|
74
|
+
"es.math.sinh",
|
|
75
|
+
"es.math.tanh",
|
|
76
|
+
"es.math.to-string-tag",
|
|
77
|
+
"es.math.trunc",
|
|
78
|
+
"es.number.constructor",
|
|
79
|
+
"es.number.epsilon",
|
|
80
|
+
"es.number.is-finite",
|
|
81
|
+
"es.number.is-integer",
|
|
82
|
+
"es.number.is-nan",
|
|
83
|
+
"es.number.is-safe-integer",
|
|
84
|
+
"es.number.max-safe-integer",
|
|
85
|
+
"es.number.min-safe-integer",
|
|
86
|
+
"es.number.parse-float",
|
|
87
|
+
"es.number.parse-int",
|
|
88
|
+
"es.number.to-fixed",
|
|
89
|
+
"es.number.to-precision",
|
|
90
|
+
"es.object.assign",
|
|
91
|
+
"es.object.create",
|
|
92
|
+
"es.object.define-getter",
|
|
93
|
+
"es.object.define-properties",
|
|
94
|
+
"es.object.define-property",
|
|
95
|
+
"es.object.define-setter",
|
|
96
|
+
"es.object.entries",
|
|
97
|
+
"es.object.freeze",
|
|
98
|
+
"es.object.from-entries",
|
|
99
|
+
"es.object.get-own-property-descriptor",
|
|
100
|
+
"es.object.get-own-property-descriptors",
|
|
101
|
+
"es.object.get-own-property-names",
|
|
102
|
+
"es.object.get-prototype-of",
|
|
103
|
+
"es.object.is",
|
|
104
|
+
"es.object.is-extensible",
|
|
105
|
+
"es.object.is-frozen",
|
|
106
|
+
"es.object.is-sealed",
|
|
107
|
+
"es.object.keys",
|
|
108
|
+
"es.object.lookup-getter",
|
|
109
|
+
"es.object.lookup-setter",
|
|
110
|
+
"es.object.prevent-extensions",
|
|
111
|
+
"es.object.seal",
|
|
112
|
+
"es.object.set-prototype-of",
|
|
113
|
+
"es.object.to-string",
|
|
114
|
+
"es.object.values",
|
|
115
|
+
"es.parse-float",
|
|
116
|
+
"es.parse-int",
|
|
117
|
+
"es.promise",
|
|
118
|
+
"es.promise.finally",
|
|
119
|
+
"es.reflect.apply",
|
|
120
|
+
"es.reflect.construct",
|
|
121
|
+
"es.reflect.define-property",
|
|
122
|
+
"es.reflect.delete-property",
|
|
123
|
+
"es.reflect.get",
|
|
124
|
+
"es.reflect.get-own-property-descriptor",
|
|
125
|
+
"es.reflect.get-prototype-of",
|
|
126
|
+
"es.reflect.has",
|
|
127
|
+
"es.reflect.is-extensible",
|
|
128
|
+
"es.reflect.own-keys",
|
|
129
|
+
"es.reflect.prevent-extensions",
|
|
130
|
+
"es.reflect.set",
|
|
131
|
+
"es.reflect.set-prototype-of",
|
|
132
|
+
"es.regexp.constructor",
|
|
133
|
+
"es.regexp.exec",
|
|
134
|
+
"es.regexp.flags",
|
|
135
|
+
"es.regexp.to-string",
|
|
136
|
+
"es.set",
|
|
137
|
+
"es.string.code-point-at",
|
|
138
|
+
"es.string.ends-with",
|
|
139
|
+
"es.string.from-code-point",
|
|
140
|
+
"es.string.includes",
|
|
141
|
+
"es.string.iterator",
|
|
142
|
+
"es.string.match",
|
|
143
|
+
"es.string.pad-end",
|
|
144
|
+
"es.string.pad-start",
|
|
145
|
+
"es.string.raw",
|
|
146
|
+
"es.string.repeat",
|
|
147
|
+
"es.string.replace",
|
|
148
|
+
"es.string.search",
|
|
149
|
+
"es.string.split",
|
|
150
|
+
"es.string.starts-with",
|
|
151
|
+
"es.string.trim",
|
|
152
|
+
"es.string.trim-end",
|
|
153
|
+
"es.string.trim-start",
|
|
154
|
+
"es.string.anchor",
|
|
155
|
+
"es.string.big",
|
|
156
|
+
"es.string.blink",
|
|
157
|
+
"es.string.bold",
|
|
158
|
+
"es.string.fixed",
|
|
159
|
+
"es.string.fontcolor",
|
|
160
|
+
"es.string.fontsize",
|
|
161
|
+
"es.string.italics",
|
|
162
|
+
"es.string.link",
|
|
163
|
+
"es.string.small",
|
|
164
|
+
"es.string.strike",
|
|
165
|
+
"es.string.sub",
|
|
166
|
+
"es.string.sup",
|
|
167
|
+
"es.typed-array.float32-array",
|
|
168
|
+
"es.typed-array.float64-array",
|
|
169
|
+
"es.typed-array.int8-array",
|
|
170
|
+
"es.typed-array.int16-array",
|
|
171
|
+
"es.typed-array.int32-array",
|
|
172
|
+
"es.typed-array.uint8-array",
|
|
173
|
+
"es.typed-array.uint8-clamped-array",
|
|
174
|
+
"es.typed-array.uint16-array",
|
|
175
|
+
"es.typed-array.uint32-array",
|
|
176
|
+
"es.typed-array.copy-within",
|
|
177
|
+
"es.typed-array.every",
|
|
178
|
+
"es.typed-array.fill",
|
|
179
|
+
"es.typed-array.filter",
|
|
180
|
+
"es.typed-array.find",
|
|
181
|
+
"es.typed-array.find-index",
|
|
182
|
+
"es.typed-array.for-each",
|
|
183
|
+
"es.typed-array.from",
|
|
184
|
+
"es.typed-array.includes",
|
|
185
|
+
"es.typed-array.index-of",
|
|
186
|
+
"es.typed-array.iterator",
|
|
187
|
+
"es.typed-array.join",
|
|
188
|
+
"es.typed-array.last-index-of",
|
|
189
|
+
"es.typed-array.map",
|
|
190
|
+
"es.typed-array.of",
|
|
191
|
+
"es.typed-array.reduce",
|
|
192
|
+
"es.typed-array.reduce-right",
|
|
193
|
+
"es.typed-array.reverse",
|
|
194
|
+
"es.typed-array.set",
|
|
195
|
+
"es.typed-array.slice",
|
|
196
|
+
"es.typed-array.some",
|
|
197
|
+
"es.typed-array.sort",
|
|
198
|
+
"es.typed-array.subarray",
|
|
199
|
+
"es.typed-array.to-locale-string",
|
|
200
|
+
"es.typed-array.to-string",
|
|
201
|
+
"es.weak-map",
|
|
202
|
+
"es.weak-set",
|
|
203
|
+
"esnext.aggregate-error",
|
|
204
|
+
"esnext.array.last-index",
|
|
205
|
+
"esnext.array.last-item",
|
|
206
|
+
"esnext.composite-key",
|
|
207
|
+
"esnext.composite-symbol",
|
|
208
|
+
"esnext.global-this",
|
|
209
|
+
"esnext.map.delete-all",
|
|
210
|
+
"esnext.map.every",
|
|
211
|
+
"esnext.map.filter",
|
|
212
|
+
"esnext.map.find",
|
|
213
|
+
"esnext.map.find-key",
|
|
214
|
+
"esnext.map.from",
|
|
215
|
+
"esnext.map.group-by",
|
|
216
|
+
"esnext.map.includes",
|
|
217
|
+
"esnext.map.key-by",
|
|
218
|
+
"esnext.map.key-of",
|
|
219
|
+
"esnext.map.map-keys",
|
|
220
|
+
"esnext.map.map-values",
|
|
221
|
+
"esnext.map.merge",
|
|
222
|
+
"esnext.map.of",
|
|
223
|
+
"esnext.map.reduce",
|
|
224
|
+
"esnext.map.some",
|
|
225
|
+
"esnext.map.update",
|
|
226
|
+
"esnext.math.clamp",
|
|
227
|
+
"esnext.math.deg-per-rad",
|
|
228
|
+
"esnext.math.degrees",
|
|
229
|
+
"esnext.math.fscale",
|
|
230
|
+
"esnext.math.iaddh",
|
|
231
|
+
"esnext.math.imulh",
|
|
232
|
+
"esnext.math.isubh",
|
|
233
|
+
"esnext.math.rad-per-deg",
|
|
234
|
+
"esnext.math.radians",
|
|
235
|
+
"esnext.math.scale",
|
|
236
|
+
"esnext.math.seeded-prng",
|
|
237
|
+
"esnext.math.signbit",
|
|
238
|
+
"esnext.math.umulh",
|
|
239
|
+
"esnext.number.from-string",
|
|
240
|
+
"esnext.observable",
|
|
241
|
+
"esnext.promise.all-settled",
|
|
242
|
+
"esnext.promise.any",
|
|
243
|
+
"esnext.promise.try",
|
|
244
|
+
"esnext.reflect.define-metadata",
|
|
245
|
+
"esnext.reflect.delete-metadata",
|
|
246
|
+
"esnext.reflect.get-metadata",
|
|
247
|
+
"esnext.reflect.get-metadata-keys",
|
|
248
|
+
"esnext.reflect.get-own-metadata",
|
|
249
|
+
"esnext.reflect.get-own-metadata-keys",
|
|
250
|
+
"esnext.reflect.has-metadata",
|
|
251
|
+
"esnext.reflect.has-own-metadata",
|
|
252
|
+
"esnext.reflect.metadata",
|
|
253
|
+
"esnext.set.add-all",
|
|
254
|
+
"esnext.set.delete-all",
|
|
255
|
+
"esnext.set.difference",
|
|
256
|
+
"esnext.set.every",
|
|
257
|
+
"esnext.set.filter",
|
|
258
|
+
"esnext.set.find",
|
|
259
|
+
"esnext.set.from",
|
|
260
|
+
"esnext.set.intersection",
|
|
261
|
+
"esnext.set.is-disjoint-from",
|
|
262
|
+
"esnext.set.is-subset-of",
|
|
263
|
+
"esnext.set.is-superset-of",
|
|
264
|
+
"esnext.set.join",
|
|
265
|
+
"esnext.set.map",
|
|
266
|
+
"esnext.set.of",
|
|
267
|
+
"esnext.set.reduce",
|
|
268
|
+
"esnext.set.some",
|
|
269
|
+
"esnext.set.symmetric-difference",
|
|
270
|
+
"esnext.set.union",
|
|
271
|
+
"esnext.string.at",
|
|
272
|
+
"esnext.string.code-points",
|
|
273
|
+
"esnext.string.match-all",
|
|
274
|
+
"esnext.string.replace-all",
|
|
275
|
+
"esnext.symbol.dispose",
|
|
276
|
+
"esnext.symbol.observable",
|
|
277
|
+
"esnext.symbol.pattern-match",
|
|
278
|
+
"esnext.weak-map.delete-all",
|
|
279
|
+
"esnext.weak-map.from",
|
|
280
|
+
"esnext.weak-map.of",
|
|
281
|
+
"esnext.weak-set.add-all",
|
|
282
|
+
"esnext.weak-set.delete-all",
|
|
283
|
+
"esnext.weak-set.from",
|
|
284
|
+
"esnext.weak-set.of",
|
|
285
|
+
"web.dom-collections.for-each",
|
|
286
|
+
"web.dom-collections.iterator",
|
|
287
|
+
"web.immediate",
|
|
288
|
+
"web.queue-microtask",
|
|
289
|
+
"web.timers",
|
|
290
|
+
"web.url",
|
|
291
|
+
"web.url.to-json",
|
|
292
|
+
"web.url-search-params"
|
|
293
|
+
]
|
|
294
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-js-compat",
|
|
3
3
|
"description": "core-js compat",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/zloirock/core-js.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"browserslist": "^4.
|
|
11
|
+
"browserslist": "^4.5.1",
|
|
12
|
+
"core-js": "3.0.0",
|
|
13
|
+
"core-js-pure": "3.0.0",
|
|
12
14
|
"semver": "^5.6.0"
|
|
13
15
|
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"detective": "^5.2.0",
|
|
18
|
+
"electron-to-chromium": "^1.3.116",
|
|
19
|
+
"glob": "^7.1.3"
|
|
20
|
+
},
|
|
14
21
|
"license": "MIT"
|
|
15
22
|
}
|