Put back ESM helpers in a folder where we can use .js (#12919)
This commit is contained in:
@@ -1 +1,3 @@
|
||||
export { default } from "../iterableToArray/_index.mjs"
|
||||
export default function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
@@ -1 +1,5 @@
|
||||
export { default } from "../temporalRef/_index.mjs"
|
||||
import undef from "./temporalUndefined.js";
|
||||
import err from "./tdz.js";
|
||||
export default function _temporalRef(val, name) {
|
||||
return val === undef ? err(name) : val;
|
||||
}
|
||||
@@ -1 +1,7 @@
|
||||
export { default } from "../toArray/_index.mjs"
|
||||
import arrayWithHoles from "./arrayWithHoles.js";
|
||||
import iterableToArray from "./iterableToArray.js";
|
||||
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
|
||||
import nonIterableRest from "./nonIterableRest.js";
|
||||
export default function _toArray(arr) {
|
||||
return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
var temporalUndefined = require("@babel/runtime/helpers/temporalUndefined");
|
||||
var temporalUndefined = require("./temporalUndefined.js");
|
||||
|
||||
var tdz = require("@babel/runtime/helpers/tdz");
|
||||
var tdz = require("./tdz.js");
|
||||
|
||||
function _temporalRef(val, name) {
|
||||
return val === temporalUndefined ? tdz(name) : val;
|
||||
@@ -1,5 +0,0 @@
|
||||
import undef from "../temporalUndefined/_index.mjs";
|
||||
import err from "../tdz/_index.mjs";
|
||||
export default function _temporalRef(val, name) {
|
||||
return val === undef ? err(name) : val;
|
||||
}
|
||||
14
packages/babel-runtime/helpers/toArray.js
Normal file
14
packages/babel-runtime/helpers/toArray.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var arrayWithHoles = require("./arrayWithHoles.js");
|
||||
|
||||
var iterableToArray = require("./iterableToArray.js");
|
||||
|
||||
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
|
||||
|
||||
var nonIterableRest = require("./nonIterableRest.js");
|
||||
|
||||
function _toArray(arr) {
|
||||
return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
||||
}
|
||||
|
||||
module.exports = _toArray;
|
||||
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
||||
@@ -1,7 +0,0 @@
|
||||
import arrayWithHoles from "../arrayWithHoles/_index.mjs";
|
||||
import iterableToArray from "../iterableToArray/_index.mjs";
|
||||
import unsupportedIterableToArray from "../unsupportedIterableToArray/_index.mjs";
|
||||
import nonIterableRest from "../nonIterableRest/_index.mjs";
|
||||
export default function _toArray(arr) {
|
||||
return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
var arrayWithHoles = require("@babel/runtime/helpers/arrayWithHoles");
|
||||
|
||||
var iterableToArray = require("@babel/runtime/helpers/iterableToArray");
|
||||
|
||||
var unsupportedIterableToArray = require("@babel/runtime/helpers/unsupportedIterableToArray");
|
||||
|
||||
var nonIterableRest = require("@babel/runtime/helpers/nonIterableRest");
|
||||
|
||||
function _toArray(arr) {
|
||||
return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
||||
}
|
||||
|
||||
module.exports = _toArray;
|
||||
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
||||
@@ -1,15 +0,0 @@
|
||||
export default function _typeof(obj) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
||||
_typeof = function _typeof(obj) {
|
||||
return typeof obj;
|
||||
};
|
||||
} else {
|
||||
_typeof = function _typeof(obj) {
|
||||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
||||
};
|
||||
}
|
||||
|
||||
return _typeof(obj);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user