From aa773172311dcada759dfbaac485f4bc6e00bc21 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:31:11 +0800 Subject: added babel --- node_modules/regenerator-transform/lib/util.js | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 node_modules/regenerator-transform/lib/util.js (limited to 'node_modules/regenerator-transform/lib/util.js') diff --git a/node_modules/regenerator-transform/lib/util.js b/node_modules/regenerator-transform/lib/util.js new file mode 100644 index 00000000..535cbed4 --- /dev/null +++ b/node_modules/regenerator-transform/lib/util.js @@ -0,0 +1,49 @@ +"use strict"; + +exports.__esModule = true; +exports.getTypes = getTypes; +exports.isReference = isReference; +exports.replaceWithOrRemove = replaceWithOrRemove; +exports.runtimeProperty = runtimeProperty; +exports.wrapWithTypes = wrapWithTypes; +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var currentTypes = null; +function wrapWithTypes(types, fn) { + return function () { + var oldTypes = currentTypes; + currentTypes = types; + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return fn.apply(this, args); + } finally { + currentTypes = oldTypes; + } + }; +} +function getTypes() { + return currentTypes; +} +function runtimeProperty(name) { + var t = getTypes(); + return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false); +} +function isReference(path) { + return path.isReferenced() || path.parentPath.isAssignmentExpression({ + left: path.node + }); +} +function replaceWithOrRemove(path, replacement) { + if (replacement) { + path.replaceWith(replacement); + } else { + path.remove(); + } +} \ No newline at end of file -- cgit v1.2.3