Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/runtime-corejs2

Package Overview
Dependencies
Maintainers
6
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/runtime-corejs2 - npm Package Compare versions

Comparing version 7.15.4 to 7.16.0

helpers/classCheckPrivateInstanceAccess2.js

77

helpers/asyncIterator.js

@@ -5,17 +5,80 @@ var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");

var _Promise = require("@babel/runtime-corejs2/core-js/promise");
function _asyncIterator(iterable) {
var method;
var method,
async,
sync,
retry = 2;
if (typeof _Symbol !== "undefined") {
if (_Symbol.asyncIterator) method = iterable[_Symbol.asyncIterator];
if (method == null && _Symbol$iterator) method = iterable[_Symbol$iterator];
async = _Symbol.asyncIterator;
sync = _Symbol$iterator;
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
while (retry--) {
if (async && (method = iterable[async]) != null) {
return method.call(iterable);
}
if (sync && (method = iterable[sync]) != null) {
return new AsyncFromSyncIterator(method.call(iterable));
}
async = "@@asyncIterator";
sync = "@@iterator";
}
throw new TypeError("Object is not async iterable");
}
function AsyncFromSyncIterator(s) {
AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {
this.s = s;
this.n = s.next;
};
AsyncFromSyncIterator.prototype = {
s: null,
n: null,
next: function next() {
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
},
"return": function _return(value) {
var ret = this.s["return"];
if (ret === undefined) {
return _Promise.resolve({
value: value,
done: true
});
}
return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
},
"throw": function _throw(value) {
var thr = this.s["return"];
if (thr === undefined) return _Promise.reject(value);
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
}
};
function AsyncFromSyncIteratorContinuation(r) {
if (Object(r) !== r) {
return _Promise.reject(new TypeError(r + " is not an object."));
}
var done = r.done;
return _Promise.resolve(r.value).then(function (value) {
return {
value: value,
done: done
};
});
}
return new AsyncFromSyncIterator(s);
}
module.exports = _asyncIterator;
module.exports["default"] = module.exports, module.exports.__esModule = true;
import _Symbol from "@babel/runtime-corejs2/core-js/symbol";
import _Symbol$iterator from "@babel/runtime-corejs2/core-js/symbol/iterator";
import _Promise from "@babel/runtime-corejs2/core-js/promise";
export default function _asyncIterator(iterable) {
var method;
var method,
async,
sync,
retry = 2;
if (typeof _Symbol !== "undefined") {
if (_Symbol.asyncIterator) method = iterable[_Symbol.asyncIterator];
if (method == null && _Symbol$iterator) method = iterable[_Symbol$iterator];
async = _Symbol.asyncIterator;
sync = _Symbol$iterator;
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
while (retry--) {
if (async && (method = iterable[async]) != null) {
return method.call(iterable);
}
if (sync && (method = iterable[sync]) != null) {
return new AsyncFromSyncIterator(method.call(iterable));
}
async = "@@asyncIterator";
sync = "@@iterator";
}
throw new TypeError("Object is not async iterable");
}
function AsyncFromSyncIterator(s) {
AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {
this.s = s;
this.n = s.next;
};
AsyncFromSyncIterator.prototype = {
s: null,
n: null,
next: function next() {
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
},
"return": function _return(value) {
var ret = this.s["return"];
if (ret === undefined) {
return _Promise.resolve({
value: value,
done: true
});
}
return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
},
"throw": function _throw(value) {
var thr = this.s["return"];
if (thr === undefined) return _Promise.reject(value);
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
}
};
function AsyncFromSyncIteratorContinuation(r) {
if (Object(r) !== r) {
return _Promise.reject(new TypeError(r + " is not an object."));
}
var done = r.done;
return _Promise.resolve(r.value).then(function (value) {
return {
value: value,
done: done
};
});
}
return new AsyncFromSyncIterator(s);
}

20

package.json
{
"name": "@babel/runtime-corejs2",
"version": "7.15.4",
"version": "7.16.0",
"description": "babel's modular runtime helpers with core-js@2 polyfilling",

@@ -21,2 +21,11 @@ "license": "MIT",

"exports": {
"./helpers/asyncIterator": [
{
"node": "./helpers/asyncIterator.js",
"import": "./helpers/esm/asyncIterator.js",
"default": "./helpers/asyncIterator.js"
},
"./helpers/asyncIterator.js"
],
"./helpers/esm/asyncIterator": "./helpers/esm/asyncIterator.js",
"./helpers/jsx": [

@@ -58,11 +67,2 @@ {

"./helpers/esm/wrapRegExp": "./helpers/esm/wrapRegExp.js",
"./helpers/asyncIterator": [
{
"node": "./helpers/asyncIterator.js",
"import": "./helpers/esm/asyncIterator.js",
"default": "./helpers/asyncIterator.js"
},
"./helpers/asyncIterator.js"
],
"./helpers/esm/asyncIterator": "./helpers/esm/asyncIterator.js",
"./helpers/AwaitValue": [

@@ -69,0 +69,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc