mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 00:32:15 +03:00
feat(es/generator): Replace generator implementation with one from tsc (#5173)
This commit is contained in:
parent
87fa49c03d
commit
2aa009018f
29
crates/swc/tests/exec/generator/1-object/exec.js
Normal file
29
crates/swc/tests/exec/generator/1-object/exec.js
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
function* foo() {
|
||||
const obj = {
|
||||
a: 1,
|
||||
b: yield true,
|
||||
c: 2,
|
||||
};
|
||||
|
||||
expect(obj.b).toEqual(1);
|
||||
|
||||
yield 2;
|
||||
|
||||
return obj.c;
|
||||
}
|
||||
|
||||
const g = foo();
|
||||
expect(g.next(0)).toEqual({
|
||||
value: true,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next(1)).toEqual({
|
||||
value: 2,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next()).toEqual({
|
||||
done: true,
|
||||
value: 2
|
||||
})
|
29
crates/swc/tests/exec/generator/2-array/exec.js
Normal file
29
crates/swc/tests/exec/generator/2-array/exec.js
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
function* foo() {
|
||||
const arr = [
|
||||
1,
|
||||
yield true,
|
||||
2,
|
||||
];
|
||||
|
||||
expect(arr[1]).toEqual(1);
|
||||
|
||||
yield 2;
|
||||
|
||||
return arr[2];
|
||||
}
|
||||
|
||||
const g = foo();
|
||||
expect(g.next(0)).toEqual({
|
||||
value: true,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next(1)).toEqual({
|
||||
value: 2,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next()).toEqual({
|
||||
done: true,
|
||||
value: 2
|
||||
})
|
31
crates/swc/tests/exec/generator/3-object-accessor/exec.js
Normal file
31
crates/swc/tests/exec/generator/3-object-accessor/exec.js
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
function* foo() {
|
||||
const obj = {
|
||||
a: 1,
|
||||
get foo() { },
|
||||
b: yield true,
|
||||
set foo(v) { },
|
||||
c: 2,
|
||||
};
|
||||
|
||||
expect(obj.b).toEqual(1);
|
||||
|
||||
yield 2;
|
||||
|
||||
return obj.c;
|
||||
}
|
||||
|
||||
const g = foo();
|
||||
expect(g.next(0)).toEqual({
|
||||
value: true,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next(1)).toEqual({
|
||||
value: 2,
|
||||
done: false,
|
||||
})
|
||||
expect(g.next()).toEqual({
|
||||
done: true,
|
||||
value: 2
|
||||
})
|
@ -1,20 +1,29 @@
|
||||
import regeneratorRuntime from "custom";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(gen);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function gen() {
|
||||
return regeneratorRuntime.wrap(function gen$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return 1;
|
||||
return [
|
||||
4,
|
||||
1
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
4,
|
||||
2
|
||||
];
|
||||
case 2:
|
||||
_ctx.next = 4;
|
||||
return 2;
|
||||
case 4:
|
||||
_ctx.next = 6;
|
||||
return 3;
|
||||
case 6:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
4,
|
||||
3
|
||||
];
|
||||
case 3:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var source = Math.random() < 2 ? "matilda" : "fred";
|
||||
var details = {
|
||||
_id: "1"
|
||||
@ -8,44 +8,45 @@ function request(path) {
|
||||
return _request.apply(this, arguments);
|
||||
}
|
||||
function _request() {
|
||||
_request = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(path) {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", "success:".concat(path));
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_request = _async_to_generator(function(path) {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2,
|
||||
"success:".concat(path)
|
||||
];
|
||||
});
|
||||
});
|
||||
return _request.apply(this, arguments);
|
||||
}
|
||||
_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var obj;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_async_to_generator(function() {
|
||||
var obj, _tmp, _tmp1;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
if (!(source === "matilda")) {
|
||||
_ctx.next = 4;
|
||||
break;
|
||||
}
|
||||
_ctx.t0 = details;
|
||||
_ctx.next = 7;
|
||||
break;
|
||||
case 4:
|
||||
_ctx.next = 6;
|
||||
return request("/".concat(details._id, "?source=").concat(source));
|
||||
case 6:
|
||||
_ctx.t0 = _ctx.sent;
|
||||
case 7:
|
||||
obj = _ctx.t0;
|
||||
console.log({
|
||||
obj: obj
|
||||
});
|
||||
case 9:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
if (!(source === "matilda")) return [
|
||||
3,
|
||||
1
|
||||
];
|
||||
_tmp = details;
|
||||
return [
|
||||
3,
|
||||
3
|
||||
];
|
||||
case 1:
|
||||
return [
|
||||
4,
|
||||
request("/".concat(details._id, "?source=").concat(source))
|
||||
];
|
||||
case 2:
|
||||
_tmp = _state.sent();
|
||||
_state.label = 3;
|
||||
case 3:
|
||||
obj = _tmp;
|
||||
_tmp1 = {};
|
||||
console.log((_tmp1.obj = obj, _tmp1));
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -1,5 +1,5 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var source = Math.random() < 2 ? "matilda" : "fred";
|
||||
var details = {
|
||||
_id: "1"
|
||||
@ -8,44 +8,45 @@ function request(path) {
|
||||
return _request.apply(this, arguments);
|
||||
}
|
||||
function _request() {
|
||||
_request = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(path) {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", "success:".concat(path));
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_request = _async_to_generator(function(path) {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2,
|
||||
"success:".concat(path)
|
||||
];
|
||||
});
|
||||
});
|
||||
return _request.apply(this, arguments);
|
||||
}
|
||||
_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var obj;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_async_to_generator(function() {
|
||||
var obj, _tmp, _tmp1;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
if (!(source === "matilda")) {
|
||||
_ctx.next = 4;
|
||||
break;
|
||||
}
|
||||
_ctx.t0 = details;
|
||||
_ctx.next = 7;
|
||||
break;
|
||||
case 4:
|
||||
_ctx.next = 6;
|
||||
return request("/".concat(details._id, "?source=").concat(source));
|
||||
case 6:
|
||||
_ctx.t0 = _ctx.sent;
|
||||
case 7:
|
||||
obj = _ctx.t0;
|
||||
console.log({
|
||||
obj: obj
|
||||
});
|
||||
case 9:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
if (!(source === "matilda")) return [
|
||||
3,
|
||||
1
|
||||
];
|
||||
_tmp = details;
|
||||
return [
|
||||
3,
|
||||
3
|
||||
];
|
||||
case 1:
|
||||
return [
|
||||
4,
|
||||
request("/".concat(details._id, "?source=").concat(source))
|
||||
];
|
||||
case 2:
|
||||
_tmp = _state.sent();
|
||||
_state.label = 3;
|
||||
case 3:
|
||||
obj = _tmp;
|
||||
_tmp1 = {};
|
||||
console.log((_tmp1.obj = obj, _tmp1));
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -1,32 +1,35 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
var val;
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
var val, _tmp, _tmp1;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
if (!true) {
|
||||
_ctx.next = 4;
|
||||
break;
|
||||
}
|
||||
_ctx.t0 = 1;
|
||||
_ctx.next = 7;
|
||||
break;
|
||||
case 4:
|
||||
_ctx.next = 6;
|
||||
return 0;
|
||||
case 6:
|
||||
_ctx.t0 = _ctx.sent;
|
||||
case 7:
|
||||
val = _ctx.t0;
|
||||
console.log({
|
||||
val: val
|
||||
});
|
||||
case 9:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
if (!true) return [
|
||||
3,
|
||||
1
|
||||
];
|
||||
_tmp = 1;
|
||||
return [
|
||||
3,
|
||||
3
|
||||
];
|
||||
case 1:
|
||||
return [
|
||||
4,
|
||||
0
|
||||
];
|
||||
case 2:
|
||||
_tmp = _state.sent();
|
||||
_state.label = 3;
|
||||
case 3:
|
||||
val = _tmp;
|
||||
_tmp1 = {};
|
||||
console.log((_tmp1.val = val, _tmp1));
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
var v = foo();
|
||||
console.log(v.next());
|
||||
|
@ -1,21 +1,19 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _throw from "@swc/helpers/src/_throw.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return _foo.apply(this, arguments);
|
||||
}
|
||||
function _foo() {
|
||||
_foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var tmp, ref, ref;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
tmp = baz.bar, ref = tmp === void 0 ? {} : tmp, ref = ref !== null ? ref : _throw(new TypeError("Cannot destructure undefined"));
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_foo = _async_to_generator(function() {
|
||||
var tmp, ref, ref, _tmp;
|
||||
return _ts_generator(this, function(_state) {
|
||||
_tmp = {};
|
||||
tmp = baz.bar, ref = tmp === void 0 ? _tmp : tmp, ref = ref !== null ? ref : _throw(new TypeError("Cannot destructure undefined"));
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return _foo.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var obj = {
|
||||
find: function find(param) {
|
||||
var platform = param.platform;
|
||||
@ -8,26 +8,27 @@ var obj = {
|
||||
};
|
||||
},
|
||||
byPlatform: function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(platform) {
|
||||
var result;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
var _ref = _async_to_generator(function(platform) {
|
||||
var result, _tmp;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return this.find({
|
||||
platform: {
|
||||
_tmp = {};
|
||||
return [
|
||||
4,
|
||||
this.find((_tmp.platform = {
|
||||
$eq: platform
|
||||
}
|
||||
});
|
||||
case 2:
|
||||
result = _ctx.sent;
|
||||
return _ctx.abrupt("return", result);
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}, _tmp))
|
||||
];
|
||||
case 1:
|
||||
result = _state.sent();
|
||||
return [
|
||||
2,
|
||||
result
|
||||
];
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
});
|
||||
});
|
||||
return function(platform) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,21 +1,18 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function f(a, b) {
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
function _f() {
|
||||
_f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a, b) {
|
||||
_f = _async_to_generator(function(a, b) {
|
||||
var ref, ref1, tmp, a_;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
ref = _sliced_to_array(JSON.parse(b), 1), ref1 = ref[0], tmp = ref1.a, a_ = tmp === void 0 ? 1 : tmp;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _ts_generator(this, function(_state) {
|
||||
ref = _sliced_to_array(JSON.parse(b), 1), ref1 = ref[0], tmp = ref1.a, a_ = tmp === void 0 ? 1 : tmp;
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,19 +1,16 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
Vue.component("test", {
|
||||
methods: {
|
||||
onSend: function onSend() {
|
||||
return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
if (this.msg === "") {}
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee, this);
|
||||
})).apply(this);
|
||||
return _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
if (this.msg === "") {}
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}).apply(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,19 +1,16 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var obj = {
|
||||
foo: 5,
|
||||
method: function method() {
|
||||
return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", this.foo);
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee, this);
|
||||
})).apply(this);
|
||||
return _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2,
|
||||
this.foo
|
||||
];
|
||||
});
|
||||
}).apply(this);
|
||||
}
|
||||
};
|
||||
obj.method().then(function(v) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import "core-js/modules/es.object.to-string.js";
|
||||
import "core-js/modules/es.promise.js";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useEffect, useState } from "react";
|
||||
import { render } from "react-dom";
|
||||
@ -11,22 +11,24 @@ import { Button, ConfigProvider } from "antd";
|
||||
function App() {
|
||||
var ref = _sliced_to_array(useState({}), 2), state = ref[0], setState = ref[1];
|
||||
useEffect(function() {
|
||||
_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.t0 = setState;
|
||||
_ctx.next = 3;
|
||||
return fetch("/api/user");
|
||||
case 3:
|
||||
_ctx.t1 = _ctx.sent;
|
||||
(0, _ctx.t0)(_ctx.t1);
|
||||
case 5:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
fetch("/api/user")
|
||||
];
|
||||
case 1:
|
||||
setState.apply(void 0, [
|
||||
_state.sent()
|
||||
]);
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
}, []);
|
||||
return /*#__PURE__*/ _jsxs(ConfigProvider, {
|
||||
locale: zhCN,
|
||||
|
@ -1,93 +1,101 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function scanUser(groups) {
|
||||
return _scanUser.apply(this, arguments);
|
||||
}
|
||||
function _scanUser() {
|
||||
_scanUser = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(groups) {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_scanUser = _async_to_generator(function(groups) {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return Promise.all(groups.map(function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(param) {
|
||||
var users, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, user;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
users = param.users;
|
||||
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
||||
_ctx.prev = 2;
|
||||
_iterator = users[Symbol.iterator]();
|
||||
case 4:
|
||||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
|
||||
_ctx.next = 12;
|
||||
break;
|
||||
}
|
||||
user = _step.value;
|
||||
console.log("user", user);
|
||||
_ctx.next = 9;
|
||||
return new Promise(function(resolve) {
|
||||
return setTimeout(resolve, 30);
|
||||
});
|
||||
case 9:
|
||||
_iteratorNormalCompletion = true;
|
||||
_ctx.next = 4;
|
||||
break;
|
||||
case 12:
|
||||
_ctx.next = 18;
|
||||
break;
|
||||
case 14:
|
||||
_ctx.prev = 14;
|
||||
_ctx.t0 = _ctx["catch"](2);
|
||||
_didIteratorError = true;
|
||||
_iteratorError = _ctx.t0;
|
||||
case 18:
|
||||
_ctx.prev = 18;
|
||||
_ctx.prev = 19;
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
case 21:
|
||||
_ctx.prev = 21;
|
||||
if (!_didIteratorError) {
|
||||
_ctx.next = 24;
|
||||
break;
|
||||
}
|
||||
throw _iteratorError;
|
||||
case 24:
|
||||
return _ctx.finish(21);
|
||||
case 25:
|
||||
return _ctx.finish(18);
|
||||
case 26:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
2,
|
||||
14,
|
||||
18,
|
||||
26
|
||||
],
|
||||
[
|
||||
19,
|
||||
,
|
||||
21,
|
||||
25
|
||||
]
|
||||
]);
|
||||
}));
|
||||
return function(_) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
}()));
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
Promise.all(groups.map(function() {
|
||||
var _ref = _async_to_generator(function(param) {
|
||||
var users, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, user, err;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
users = param.users;
|
||||
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
_state.trys.push([
|
||||
1,
|
||||
6,
|
||||
7,
|
||||
8
|
||||
]);
|
||||
_iterator = users[Symbol.iterator]();
|
||||
_state.label = 2;
|
||||
case 2:
|
||||
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
||||
3,
|
||||
5
|
||||
];
|
||||
user = _step.value;
|
||||
console.log("user", user);
|
||||
return [
|
||||
4,
|
||||
new Promise(function(resolve) {
|
||||
return setTimeout(resolve, 30);
|
||||
})
|
||||
];
|
||||
case 3:
|
||||
_state.sent();
|
||||
_state.label = 4;
|
||||
case 4:
|
||||
_iteratorNormalCompletion = true;
|
||||
return [
|
||||
3,
|
||||
2
|
||||
];
|
||||
case 5:
|
||||
return [
|
||||
3,
|
||||
8
|
||||
];
|
||||
case 6:
|
||||
err = _state.sent();
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
return [
|
||||
3,
|
||||
8
|
||||
];
|
||||
case 7:
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally{
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 8:
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
});
|
||||
});
|
||||
return function(_) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
}()))
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
});
|
||||
});
|
||||
return _scanUser.apply(this, arguments);
|
||||
}
|
||||
scanUser([
|
||||
|
@ -1,23 +1,30 @@
|
||||
import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function lol() {
|
||||
return _lol.apply(this, arguments);
|
||||
}
|
||||
function _lol() {
|
||||
_lol = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_lol = _wrap_async_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return 1;
|
||||
return [
|
||||
4,
|
||||
1
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
4,
|
||||
2
|
||||
];
|
||||
case 2:
|
||||
_ctx.next = 4;
|
||||
return 2;
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
});
|
||||
});
|
||||
return _lol.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,104 +1,129 @@
|
||||
import _async_iterator from "@swc/helpers/src/_async_iterator.mjs";
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function lol() {
|
||||
return _lol.apply(this, arguments);
|
||||
}
|
||||
function _lol() {
|
||||
_lol = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_lol = _wrap_async_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return 1;
|
||||
return [
|
||||
4,
|
||||
1
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
4,
|
||||
2
|
||||
];
|
||||
case 2:
|
||||
_ctx.next = 4;
|
||||
return 2;
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
});
|
||||
});
|
||||
return _lol.apply(this, arguments);
|
||||
}
|
||||
function main() {
|
||||
return _main.apply(this, arguments);
|
||||
}
|
||||
function _main() {
|
||||
_main = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_main = _async_to_generator(function() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, err;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
||||
_ctx.prev = 1;
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
_state.trys.push([
|
||||
1,
|
||||
6,
|
||||
7,
|
||||
12
|
||||
]);
|
||||
_iterator = _async_iterator(lol());
|
||||
_state.label = 2;
|
||||
case 2:
|
||||
return [
|
||||
4,
|
||||
_iterator.next()
|
||||
];
|
||||
case 3:
|
||||
_ctx.next = 5;
|
||||
return _iterator.next();
|
||||
case 5:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _ctx.sent).done)) {
|
||||
_ctx.next = 10;
|
||||
break;
|
||||
}
|
||||
{
|
||||
_value = _step.value;
|
||||
x = _value;
|
||||
console.log(x);
|
||||
}
|
||||
case 7:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
||||
3,
|
||||
5
|
||||
];
|
||||
_value = _step.value;
|
||||
x = _value;
|
||||
console.log(x);
|
||||
_state.label = 4;
|
||||
case 4:
|
||||
_iteratorAbruptCompletion = false;
|
||||
_ctx.next = 3;
|
||||
break;
|
||||
case 10:
|
||||
_ctx.next = 16;
|
||||
break;
|
||||
case 12:
|
||||
_ctx.prev = 12;
|
||||
_ctx.t0 = _ctx["catch"](1);
|
||||
return [
|
||||
3,
|
||||
2
|
||||
];
|
||||
case 5:
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 6:
|
||||
err = _state.sent();
|
||||
_didIteratorError = true;
|
||||
_iteratorError = _ctx.t0;
|
||||
case 16:
|
||||
_ctx.prev = 16;
|
||||
_ctx.prev = 17;
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
||||
_ctx.next = 21;
|
||||
break;
|
||||
_iteratorError = err;
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 7:
|
||||
_state.trys.push([
|
||||
7,
|
||||
,
|
||||
10,
|
||||
11
|
||||
]);
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
||||
3,
|
||||
9
|
||||
];
|
||||
return [
|
||||
4,
|
||||
_iterator.return()
|
||||
];
|
||||
case 8:
|
||||
_state.sent();
|
||||
_state.label = 9;
|
||||
case 9:
|
||||
return [
|
||||
3,
|
||||
11
|
||||
];
|
||||
case 10:
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
_ctx.next = 21;
|
||||
return _iterator.return();
|
||||
case 21:
|
||||
_ctx.prev = 21;
|
||||
if (!_didIteratorError) {
|
||||
_ctx.next = 24;
|
||||
break;
|
||||
}
|
||||
throw _iteratorError;
|
||||
case 24:
|
||||
return _ctx.finish(21);
|
||||
case 25:
|
||||
return _ctx.finish(16);
|
||||
case 26:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 11:
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 12:
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
1,
|
||||
12,
|
||||
16,
|
||||
26
|
||||
],
|
||||
[
|
||||
17,
|
||||
,
|
||||
21,
|
||||
25
|
||||
]
|
||||
]);
|
||||
}));
|
||||
});
|
||||
});
|
||||
return _main.apply(this, arguments);
|
||||
}
|
||||
main();
|
||||
|
@ -1,17 +1,14 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
(function() {
|
||||
var _main = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
console.log(1);
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
var _main = _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
console.log(1);
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
function main() {
|
||||
return _main.apply(this, arguments);
|
||||
}
|
||||
|
@ -10,22 +10,26 @@ Object.defineProperty(exports, "default", {
|
||||
});
|
||||
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
var _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
|
||||
function Foo() {
|
||||
return /*#__PURE__*/ _react.default.createElement("div", {
|
||||
onClick: /*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee(e) {
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
onClick: /*#__PURE__*/ _asyncToGenerator(function(e) {
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return doSomething();
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
doSomething()
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
Foo.displayName = "Foo";
|
||||
|
@ -10,20 +10,24 @@ Object.defineProperty(exports, "default", {
|
||||
});
|
||||
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
var _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
|
||||
function Foo() {
|
||||
return call(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee(e) {
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return call(/*#__PURE__*/ _asyncToGenerator(function(e) {
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return doSomething();
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
doSomething()
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
})));
|
||||
});
|
||||
}));
|
||||
}
|
||||
Foo.displayName = "Foo";
|
||||
|
@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _defineProperty = require("@swc/helpers/lib/_define_property.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
function _asyncIterator(iterable) {
|
||||
var method;
|
||||
if (typeof Symbol === "function") {
|
||||
@ -48,137 +47,159 @@ function _asyncToGenerator(fn) {
|
||||
});
|
||||
};
|
||||
}
|
||||
_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() {
|
||||
var counter, resolve, promise, iterable, res, _i, _iter, v, oldresolve;
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_asyncToGenerator(function() {
|
||||
var counter, resolve, promise, iterable, _tmp, res, _i, _iter, v, oldresolve, _tmp1, _tmp2;
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
counter = 0;
|
||||
;
|
||||
promise = new Promise(function(r) {
|
||||
return resolve = r;
|
||||
});
|
||||
iterable = _defineProperty({}, Symbol.asyncIterator, function() {
|
||||
_tmp = {};
|
||||
iterable = _defineProperty(_tmp, Symbol.asyncIterator, function() {
|
||||
return {
|
||||
next: function next() {
|
||||
return promise;
|
||||
}
|
||||
};
|
||||
});
|
||||
res = _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value;
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
res = _asyncToGenerator(function() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value, err;
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
||||
_ctx.prev = 1;
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
_state.trys.push([
|
||||
1,
|
||||
6,
|
||||
7,
|
||||
12
|
||||
]);
|
||||
_iterator = _asyncIterator(iterable);
|
||||
_state.label = 2;
|
||||
case 2:
|
||||
return [
|
||||
4,
|
||||
_iterator.next()
|
||||
];
|
||||
case 3:
|
||||
_ctx.next = 5;
|
||||
return _iterator.next();
|
||||
case 5:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _ctx.sent).done)) {
|
||||
_ctx.next = 10;
|
||||
break;
|
||||
}
|
||||
{
|
||||
_value = _step.value;
|
||||
value = _value;
|
||||
counter++;
|
||||
console.log(value);
|
||||
}
|
||||
case 7:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
||||
3,
|
||||
5
|
||||
];
|
||||
_value = _step.value;
|
||||
value = _value;
|
||||
counter++;
|
||||
console.log(value);
|
||||
_state.label = 4;
|
||||
case 4:
|
||||
_iteratorAbruptCompletion = false;
|
||||
_ctx.next = 3;
|
||||
break;
|
||||
case 10:
|
||||
_ctx.next = 16;
|
||||
break;
|
||||
case 12:
|
||||
_ctx.prev = 12;
|
||||
_ctx.t0 = _ctx["catch"](1);
|
||||
return [
|
||||
3,
|
||||
2
|
||||
];
|
||||
case 5:
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 6:
|
||||
err = _state.sent();
|
||||
_didIteratorError = true;
|
||||
_iteratorError = _ctx.t0;
|
||||
case 16:
|
||||
_ctx.prev = 16;
|
||||
_ctx.prev = 17;
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
||||
_ctx.next = 21;
|
||||
break;
|
||||
_iteratorError = err;
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 7:
|
||||
_state.trys.push([
|
||||
7,
|
||||
,
|
||||
10,
|
||||
11
|
||||
]);
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
||||
3,
|
||||
9
|
||||
];
|
||||
return [
|
||||
4,
|
||||
_iteratorError.return()
|
||||
];
|
||||
case 8:
|
||||
_state.sent();
|
||||
_state.label = 9;
|
||||
case 9:
|
||||
return [
|
||||
3,
|
||||
11
|
||||
];
|
||||
case 10:
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
_ctx.next = 21;
|
||||
return _iteratorError.return();
|
||||
case 21:
|
||||
_ctx.prev = 21;
|
||||
if (!_didIteratorError) {
|
||||
_ctx.next = 24;
|
||||
break;
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 11:
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 12:
|
||||
if (counter !== 2) {
|
||||
throw new Error("");
|
||||
}
|
||||
throw _iteratorError;
|
||||
case 24:
|
||||
return _ctx.finish(21);
|
||||
case 25:
|
||||
return _ctx.finish(16);
|
||||
case 26:
|
||||
if (!(counter !== 2)) {
|
||||
_ctx.next = 28;
|
||||
break;
|
||||
}
|
||||
throw new Error("");
|
||||
case 28:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
1,
|
||||
12,
|
||||
16,
|
||||
26
|
||||
],
|
||||
[
|
||||
17,
|
||||
,
|
||||
21,
|
||||
25
|
||||
]
|
||||
]);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
_i = 0, _iter = [
|
||||
0,
|
||||
1
|
||||
];
|
||||
case 6:
|
||||
if (!(_i < _iter.length)) {
|
||||
_ctx.next = 16;
|
||||
break;
|
||||
}
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
if (!(_i < _iter.length)) return [
|
||||
3,
|
||||
4
|
||||
];
|
||||
v = _iter[_i];
|
||||
_ctx.next = 10;
|
||||
return null;
|
||||
case 10:
|
||||
return [
|
||||
4,
|
||||
null
|
||||
];
|
||||
case 2:
|
||||
_state.sent();
|
||||
oldresolve = resolve;
|
||||
promise = new Promise(function(r) {
|
||||
return resolve = r;
|
||||
});
|
||||
oldresolve({
|
||||
value: v,
|
||||
done: false
|
||||
});
|
||||
case 13:
|
||||
_tmp1 = {};
|
||||
oldresolve((_tmp1.value = v, _tmp1.done = false, _tmp1));
|
||||
_state.label = 3;
|
||||
case 3:
|
||||
_i++;
|
||||
_ctx.next = 6;
|
||||
break;
|
||||
case 16:
|
||||
resolve({
|
||||
value: undefined,
|
||||
done: true
|
||||
});
|
||||
_ctx.next = 19;
|
||||
return res;
|
||||
case 19:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
3,
|
||||
1
|
||||
];
|
||||
case 4:
|
||||
_tmp2 = {};
|
||||
resolve((_tmp2.value = undefined, _tmp2.done = true, _tmp2));
|
||||
return [
|
||||
4,
|
||||
res
|
||||
];
|
||||
case 5:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -5,139 +5,160 @@ Object.defineProperty(exports, "__esModule", {
|
||||
var _asyncIterator = require("@swc/helpers/lib/_async_iterator.js").default;
|
||||
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
||||
var _defineProperty = require("@swc/helpers/lib/_define_property.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() {
|
||||
var counter, resolve, promise, iterable, res, _i, _iter, v, oldresolve;
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
_asyncToGenerator(function() {
|
||||
var counter, resolve, promise, iterable, _tmp, res, _i, _iter, v, oldresolve, _tmp1, _tmp2;
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
counter = 0;
|
||||
;
|
||||
promise = new Promise(function(r) {
|
||||
return resolve = r;
|
||||
});
|
||||
iterable = _defineProperty({}, Symbol.asyncIterator, function() {
|
||||
_tmp = {};
|
||||
iterable = _defineProperty(_tmp, Symbol.asyncIterator, function() {
|
||||
return {
|
||||
next: function next() {
|
||||
return promise;
|
||||
}
|
||||
};
|
||||
});
|
||||
res = _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value;
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
res = _asyncToGenerator(function() {
|
||||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value, err;
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
||||
_ctx.prev = 1;
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
_state.trys.push([
|
||||
1,
|
||||
6,
|
||||
7,
|
||||
12
|
||||
]);
|
||||
_iterator = _asyncIterator(iterable);
|
||||
_state.label = 2;
|
||||
case 2:
|
||||
return [
|
||||
4,
|
||||
_iterator.next()
|
||||
];
|
||||
case 3:
|
||||
_ctx.next = 5;
|
||||
return _iterator.next();
|
||||
case 5:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _ctx.sent).done)) {
|
||||
_ctx.next = 10;
|
||||
break;
|
||||
}
|
||||
{
|
||||
_value = _step.value;
|
||||
value = _value;
|
||||
counter++;
|
||||
console.log(value);
|
||||
}
|
||||
case 7:
|
||||
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
||||
3,
|
||||
5
|
||||
];
|
||||
_value = _step.value;
|
||||
value = _value;
|
||||
counter++;
|
||||
console.log(value);
|
||||
_state.label = 4;
|
||||
case 4:
|
||||
_iteratorAbruptCompletion = false;
|
||||
_ctx.next = 3;
|
||||
break;
|
||||
case 10:
|
||||
_ctx.next = 16;
|
||||
break;
|
||||
case 12:
|
||||
_ctx.prev = 12;
|
||||
_ctx.t0 = _ctx["catch"](1);
|
||||
return [
|
||||
3,
|
||||
2
|
||||
];
|
||||
case 5:
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 6:
|
||||
err = _state.sent();
|
||||
_didIteratorError = true;
|
||||
_iteratorError = _ctx.t0;
|
||||
case 16:
|
||||
_ctx.prev = 16;
|
||||
_ctx.prev = 17;
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
||||
_ctx.next = 21;
|
||||
break;
|
||||
_iteratorError = err;
|
||||
return [
|
||||
3,
|
||||
12
|
||||
];
|
||||
case 7:
|
||||
_state.trys.push([
|
||||
7,
|
||||
,
|
||||
10,
|
||||
11
|
||||
]);
|
||||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
||||
3,
|
||||
9
|
||||
];
|
||||
return [
|
||||
4,
|
||||
_iterator.return()
|
||||
];
|
||||
case 8:
|
||||
_state.sent();
|
||||
_state.label = 9;
|
||||
case 9:
|
||||
return [
|
||||
3,
|
||||
11
|
||||
];
|
||||
case 10:
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
_ctx.next = 21;
|
||||
return _iterator.return();
|
||||
case 21:
|
||||
_ctx.prev = 21;
|
||||
if (!_didIteratorError) {
|
||||
_ctx.next = 24;
|
||||
break;
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 11:
|
||||
return [
|
||||
7
|
||||
];
|
||||
case 12:
|
||||
if (counter !== 2) {
|
||||
throw new Error("");
|
||||
}
|
||||
throw _iteratorError;
|
||||
case 24:
|
||||
return _ctx.finish(21);
|
||||
case 25:
|
||||
return _ctx.finish(16);
|
||||
case 26:
|
||||
if (!(counter !== 2)) {
|
||||
_ctx.next = 28;
|
||||
break;
|
||||
}
|
||||
throw new Error("");
|
||||
case 28:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
1,
|
||||
12,
|
||||
16,
|
||||
26
|
||||
],
|
||||
[
|
||||
17,
|
||||
,
|
||||
21,
|
||||
25
|
||||
]
|
||||
]);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
_i = 0, _iter = [
|
||||
0,
|
||||
1
|
||||
];
|
||||
case 6:
|
||||
if (!(_i < _iter.length)) {
|
||||
_ctx.next = 16;
|
||||
break;
|
||||
}
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
if (!(_i < _iter.length)) return [
|
||||
3,
|
||||
4
|
||||
];
|
||||
v = _iter[_i];
|
||||
_ctx.next = 10;
|
||||
return null;
|
||||
case 10:
|
||||
return [
|
||||
4,
|
||||
null
|
||||
];
|
||||
case 2:
|
||||
_state.sent();
|
||||
oldresolve = resolve;
|
||||
promise = new Promise(function(r) {
|
||||
return resolve = r;
|
||||
});
|
||||
oldresolve({
|
||||
value: v,
|
||||
done: false
|
||||
});
|
||||
case 13:
|
||||
_tmp1 = {};
|
||||
oldresolve((_tmp1.value = v, _tmp1.done = false, _tmp1));
|
||||
_state.label = 3;
|
||||
case 3:
|
||||
_i++;
|
||||
_ctx.next = 6;
|
||||
break;
|
||||
case 16:
|
||||
resolve({
|
||||
value: undefined,
|
||||
done: true
|
||||
});
|
||||
_ctx.next = 19;
|
||||
return res;
|
||||
case 19:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
3,
|
||||
1
|
||||
];
|
||||
case 4:
|
||||
_tmp2 = {};
|
||||
resolve((_tmp2.value = undefined, _tmp2.done = true, _tmp2));
|
||||
return [
|
||||
4,
|
||||
res
|
||||
];
|
||||
case 5:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -2,15 +2,11 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
var _marked = /*#__PURE__*/ _regeneratorRuntime.default.mark(foo);
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
function foo() {
|
||||
return _regeneratorRuntime.default.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
return _tsGenerator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime"));
|
||||
_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() {
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
_asyncToGenerator(function() {
|
||||
var sleep, result;
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _tsGenerator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
sleep = function() {
|
||||
return new Promise(function(resolve) {
|
||||
@ -17,21 +16,16 @@ _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _calle
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
_ctx.next = 3;
|
||||
return sleep();
|
||||
case 3:
|
||||
_ctx.t0 = _ctx.sent;
|
||||
if (_ctx.t0) {
|
||||
_ctx.next = 6;
|
||||
break;
|
||||
}
|
||||
_ctx.t0 = "fallback";
|
||||
case 6:
|
||||
result = _ctx.t0;
|
||||
return [
|
||||
4,
|
||||
sleep()
|
||||
];
|
||||
case 1:
|
||||
result = _state.sent() || "fallback";
|
||||
console.log(result);
|
||||
case 8:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -1,9 +1,9 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
_async_to_generator(function() {
|
||||
var sleep, result;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
sleep = function() {
|
||||
return new Promise(function(resolve) {
|
||||
@ -12,21 +12,16 @@ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
_ctx.next = 3;
|
||||
return sleep();
|
||||
case 3:
|
||||
_ctx.t0 = _ctx.sent;
|
||||
if (_ctx.t0) {
|
||||
_ctx.next = 6;
|
||||
break;
|
||||
}
|
||||
_ctx.t0 = "fallback";
|
||||
case 6:
|
||||
result = _ctx.t0;
|
||||
return [
|
||||
4,
|
||||
sleep()
|
||||
];
|
||||
case 1:
|
||||
result = _state.sent() || "fallback";
|
||||
console.log(result);
|
||||
case 8:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
|
@ -1,20 +1,18 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function fn() {
|
||||
return _fn.apply(this, arguments);
|
||||
}
|
||||
function _fn() {
|
||||
_fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var key;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
for(key in {});
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_fn = _async_to_generator(function() {
|
||||
var key, _tmp;
|
||||
return _ts_generator(this, function(_state) {
|
||||
_tmp = {};
|
||||
for(var key in _tmp);
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return _fn.apply(this, arguments);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _create_class from "@swc/helpers/src/_create_class.mjs";
|
||||
import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var Foo = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function Foo() {
|
||||
@ -12,21 +12,18 @@ var Foo = /*#__PURE__*/ function() {
|
||||
{
|
||||
key: "sendSomeMessage",
|
||||
value: function sendSomeMessage(_parent, _param, _param1) {
|
||||
return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return _async_to_generator(function() {
|
||||
var _input, toNumber, messageBody, all, dataSources;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_input = _param.input, toNumber = _input.toNumber, messageBody = _input.messageBody, all = _object_without_properties(_param.input, [
|
||||
"toNumber",
|
||||
"messageBody"
|
||||
]), dataSources = _param1.dataSources;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
return _ts_generator(this, function(_state) {
|
||||
_input = _param.input, toNumber = _input.toNumber, messageBody = _input.messageBody, all = _object_without_properties(_param.input, [
|
||||
"toNumber",
|
||||
"messageBody"
|
||||
]), dataSources = _param1.dataSources;
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
})();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
@ -1,23 +1,20 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var resolver = {
|
||||
sendSomeMessage: function sendSomeMessage(_parent, _param, _param1) {
|
||||
return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return _async_to_generator(function() {
|
||||
var _input, toNumber, messageBody, all, dataSources;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_input = _param.input, toNumber = _input.toNumber, messageBody = _input.messageBody, all = _object_without_properties(_param.input, [
|
||||
"toNumber",
|
||||
"messageBody"
|
||||
]), dataSources = _param1.dataSources;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
return _ts_generator(this, function(_state) {
|
||||
_input = _param.input, toNumber = _input.toNumber, messageBody = _input.messageBody, all = _object_without_properties(_param.input, [
|
||||
"toNumber",
|
||||
"messageBody"
|
||||
]), dataSources = _param1.dataSources;
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
})();
|
||||
}
|
||||
};
|
||||
export default resolver;
|
||||
|
@ -1,21 +1,18 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
export var foo = function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
try {
|
||||
console.log(1);
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
}
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
var _ref = _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
try {
|
||||
console.log(1);
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return function foo() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,36 +1,43 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var handleSubmit = useMutation(/*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var res, errors;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var handleSubmit = useMutation(/*#__PURE__*/ _async_to_generator(function() {
|
||||
var res, _tmp, param, errors;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.prev = 0;
|
||||
_ctx.next = 3;
|
||||
return gate.register({
|
||||
username: phoneNumber
|
||||
});
|
||||
case 3:
|
||||
res = _ctx.sent;
|
||||
_state.trys.push([
|
||||
0,
|
||||
2,
|
||||
,
|
||||
3
|
||||
]);
|
||||
_tmp = {};
|
||||
return [
|
||||
4,
|
||||
gate.register((_tmp.username = phoneNumber, _tmp))
|
||||
];
|
||||
case 1:
|
||||
res = _state.sent();
|
||||
setstep(function(prev) {
|
||||
return prev + 1;
|
||||
});
|
||||
toast.success(res.message);
|
||||
_ctx.next = 12;
|
||||
break;
|
||||
case 8:
|
||||
_ctx.prev = 8;
|
||||
_ctx.t0 = _ctx["catch"](0);
|
||||
errors = _ctx.t0.data.errors;
|
||||
return [
|
||||
3,
|
||||
3
|
||||
];
|
||||
case 2:
|
||||
param = _state.sent();
|
||||
errors = param.data.errors;
|
||||
showErrorMessage(errors);
|
||||
case 12:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
3,
|
||||
3
|
||||
];
|
||||
case 3:
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
0,
|
||||
8
|
||||
]
|
||||
]);
|
||||
})));
|
||||
});
|
||||
}));
|
||||
|
@ -1,40 +1,41 @@
|
||||
import e from "regenerator-runtime";
|
||||
var t = e.mark(saveTheme);
|
||||
import { takeLatest as r, select as o } from "redux-saga/effects";
|
||||
import { CHANGE_THEME as s, CHANGE_THEME_CUSTOM_PALETTE as a, CHANGE_THEME_SWITCH_MODE as n } from "core/actions/changeTheme";
|
||||
import e from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import { takeLatest as t, select as r } from "redux-saga/effects";
|
||||
import { CHANGE_THEME as o, CHANGE_THEME_CUSTOM_PALETTE as s, CHANGE_THEME_SWITCH_MODE as n } from "core/actions/changeTheme";
|
||||
export var selectThemeObject = function(e) {
|
||||
return e.theme;
|
||||
};
|
||||
export function saveTheme(r) {
|
||||
var s, a, c;
|
||||
return e.wrap(function(e) {
|
||||
for(;;)switch(e.prev = e.next){
|
||||
export function saveTheme(t) {
|
||||
var o, s, c, m;
|
||||
return e(this, function(e) {
|
||||
switch(e.label){
|
||||
case 0:
|
||||
return s = r.type, e.next = 3, o(selectThemeObject);
|
||||
case 3:
|
||||
a = e.sent, window.localStorage.setItem("theme", JSON.stringify({
|
||||
theme: a.theme,
|
||||
mode: a.mode,
|
||||
palette: a.palette
|
||||
})), s === n && (c = window.document.querySelector("body")) && (c.classList.add("light" === a.mode ? "light" : "dark"), c.classList.remove("light" === a.mode ? "dark" : "light"));
|
||||
case 6:
|
||||
case "end":
|
||||
return e.stop();
|
||||
return o = t.type, [
|
||||
4,
|
||||
r(selectThemeObject)
|
||||
];
|
||||
case 1:
|
||||
return s = e.sent(), c = {}, window.localStorage.setItem("theme", JSON.stringify((c.theme = s.theme, c.mode = s.mode, c.palette = s.palette, c))), o === n && (m = window.document.querySelector("body")) && (m.classList.add("light" === s.mode ? "light" : "dark"), m.classList.remove("light" === s.mode ? "dark" : "light")), [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, t);
|
||||
});
|
||||
}
|
||||
export default function c() {
|
||||
return e.wrap(function(e) {
|
||||
for(;;)switch(e.prev = e.next){
|
||||
return e(this, function(e) {
|
||||
switch(e.label){
|
||||
case 0:
|
||||
return e.next = 2, r([
|
||||
s,
|
||||
a,
|
||||
n
|
||||
], saveTheme);
|
||||
case 2:
|
||||
case "end":
|
||||
return e.stop();
|
||||
return [
|
||||
4,
|
||||
t([
|
||||
o,
|
||||
s,
|
||||
n
|
||||
], saveTheme)
|
||||
];
|
||||
case 1:
|
||||
return e.sent(), [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, c);
|
||||
});
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,20 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
export var CompanyBgStore = function CompanyBgStore() {
|
||||
"use strict";
|
||||
_class_call_check(this, CompanyBgStore);
|
||||
this.corpName = 123;
|
||||
var _this = this;
|
||||
this.getBusinessInfo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
|
||||
var corpName, _args = arguments;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
corpName = _args.length > 0 && _args[0] !== void 0 ? _args[0] : _this.corpName;
|
||||
console.log(corpName);
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
this.getBusinessInfo = _async_to_generator(function() {
|
||||
var corpName;
|
||||
var _arguments = arguments;
|
||||
return _ts_generator(this, function(_state) {
|
||||
corpName = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : _this.corpName;
|
||||
console.log(corpName);
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1,32 +1,26 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var A = function A() {
|
||||
"use strict";
|
||||
_class_call_check(this, A);
|
||||
var _this = this;
|
||||
this.foo = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_this.x();
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
this.foo = /*#__PURE__*/ _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
_this.x();
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
var _this1 = this;
|
||||
this.bar = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_this1.x();
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
this.bar = /*#__PURE__*/ _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
_this1.x();
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
};
|
||||
console.log(A);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _create_class from "@swc/helpers/src/_create_class.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var A = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function A() {
|
||||
@ -12,29 +12,23 @@ var A = /*#__PURE__*/ function() {
|
||||
key: "method",
|
||||
value: function method() {
|
||||
var _this = this;
|
||||
this.foo = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_this.x();
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
this.foo = /*#__PURE__*/ _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
_this.x();
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
var _this1 = this;
|
||||
this.bar = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_this1.x();
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
this.bar = /*#__PURE__*/ _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
_this1.x();
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
@ -1,18 +1,15 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import "reflect-metadata";
|
||||
var v0 = function() {
|
||||
var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(v1) {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", v1);
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
var _ref = _async_to_generator(function(v1) {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2,
|
||||
v1
|
||||
];
|
||||
});
|
||||
});
|
||||
return function(v1) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -3,21 +3,17 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
||||
var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
||||
var _regeneratorRuntime = _interopRequireDefault(require("regenerator-runtime"));
|
||||
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
||||
require("reflect-metadata");
|
||||
var v0 = function() {
|
||||
var _ref = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(v1) {
|
||||
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", v1);
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
var _ref = _asyncToGenerator(function(v1) {
|
||||
return _tsGenerator(this, function(_state) {
|
||||
return [
|
||||
2,
|
||||
v1
|
||||
];
|
||||
});
|
||||
});
|
||||
return function(v1) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var app;
|
||||
var ctx;
|
||||
x = function x() {
|
||||
@ -9,24 +9,25 @@ x = function x() {
|
||||
type: "all",
|
||||
disable: app.config.env === "local"
|
||||
},
|
||||
task: regeneratorRuntime.mark(function task(ctx) {
|
||||
var res;
|
||||
return regeneratorRuntime.wrap(function task$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
task: function task(ctx) {
|
||||
var res, _tmp;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return ctx.curl("http://www.api.com/cache", {
|
||||
contentType: "json"
|
||||
});
|
||||
case 2:
|
||||
res = _ctx.sent;
|
||||
_tmp = {};
|
||||
return [
|
||||
4,
|
||||
ctx.curl("http://www.api.com/cache", (_tmp.contentType = "json", _tmp))
|
||||
];
|
||||
case 1:
|
||||
res = _state.sent();
|
||||
ctx.app.cache = res.data;
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, task);
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _create_class from "@swc/helpers/src/_create_class.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var Foo = function() {
|
||||
"use strict";
|
||||
function Foo() {
|
||||
@ -11,20 +11,22 @@ var Foo = function() {
|
||||
{
|
||||
key: "bar",
|
||||
value: function bar() {
|
||||
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _async_to_generator(regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return 1;
|
||||
case 2:
|
||||
return _ctx.abrupt("return", _ctx.sent);
|
||||
case 3:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
1
|
||||
];
|
||||
case 1:
|
||||
return [
|
||||
2,
|
||||
_state.sent()
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var Router = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function Router() {
|
||||
@ -9,18 +9,18 @@ var Router = /*#__PURE__*/ function() {
|
||||
var _proto = Router.prototype;
|
||||
_proto.change = function change(method, url, as, options, forcedScroll) {
|
||||
var _this = this;
|
||||
return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var shouldResolveHref, prevLocale, parsedAs, localePathResult, didNavigate, ref, detectedDomain, asNoBasePath, _shallow, shallow, routeProps, cleanedAs, localeChange, parsed, pathname, query, pages, rewrites, ref1, resolvedAs, rewritesResult, route, parsedAs1, asPathname, routeRegex, routeMatch, shouldInterpolate, interpolatedAs, missingParams, ref2, ref3, routeInfo, error, props, __N_SSG, __N_SSP, destination, parsedHref, ref4, newUrl, newAs, notFoundRoute, isValidShallowRoute, _scroll, shouldScroll, resetScroll;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _async_to_generator(function() {
|
||||
var shouldResolveHref, prevLocale, parsedAs, localePathResult, didNavigate, ref, detectedDomain, asNoBasePath, _shallow, shallow, routeProps, _tmp, cleanedAs, localeChange, parsed, pathname, query, pages, rewrites, ref1, err, resolvedAs, rewritesResult, route, parsedAs1, asPathname, routeRegex, routeMatch, shouldInterpolate, interpolatedAs, _tmp1, missingParams, ref2, ref3, routeInfo, error, props, __N_SSG, __N_SSP, destination, parsedHref, ref4, newUrl, newAs, notFoundRoute, _, _tmp2, isValidShallowRoute, _scroll, shouldScroll, resetScroll, _tmp3, err1;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
if (isLocalURL(url)) {
|
||||
_ctx.next = 3;
|
||||
break;
|
||||
if (!isLocalURL(url)) {
|
||||
window.location.href = url;
|
||||
return [
|
||||
2,
|
||||
false
|
||||
];
|
||||
}
|
||||
window.location.href = url;
|
||||
return _ctx.abrupt("return", false);
|
||||
case 3:
|
||||
shouldResolveHref = options._h || options._shouldResolveHref || pathNoQueryHash(url) === pathNoQueryHash(as);
|
||||
// for static pages with query params in the URL we delay
|
||||
// marking the router ready until after the query is updated
|
||||
@ -28,56 +28,54 @@ var Router = /*#__PURE__*/ function() {
|
||||
_this.isReady = true;
|
||||
}
|
||||
prevLocale = _this.locale;
|
||||
if (!process.env.__NEXT_I18N_SUPPORT) {
|
||||
_ctx.next = 18;
|
||||
break;
|
||||
}
|
||||
_this.locale = options.locale === false ? _this.defaultLocale : options.locale || _this.locale;
|
||||
if (typeof options.locale === "undefined") {
|
||||
options.locale = _this.locale;
|
||||
}
|
||||
parsedAs = parseRelativeUrl(hasBasePath(as) ? delBasePath(as) : as);
|
||||
localePathResult = normalizeLocalePath(parsedAs.pathname, _this.locales);
|
||||
if (localePathResult.detectedLocale) {
|
||||
_this.locale = localePathResult.detectedLocale;
|
||||
parsedAs.pathname = addBasePath(parsedAs.pathname);
|
||||
as = formatWithValidation(parsedAs);
|
||||
url = addBasePath(normalizeLocalePath(hasBasePath(url) ? delBasePath(url) : url, _this.locales).pathname);
|
||||
}
|
||||
didNavigate = false;
|
||||
// we need to wrap this in the env check again since regenerator runtime
|
||||
// moves this on its own due to the return
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
;
|
||||
// if the locale isn't configured hard navigate to show 404 page
|
||||
if (!((ref = _this.locales) === null || ref === void 0 ? void 0 : ref.includes(_this.locale))) {
|
||||
parsedAs.pathname = addLocale(parsedAs.pathname, _this.locale);
|
||||
window.location.href = formatWithValidation(parsedAs);
|
||||
// this was previously a return but was removed in favor
|
||||
// of better dead code elimination with regenerator runtime
|
||||
didNavigate = true;
|
||||
_this.locale = options.locale === false ? _this.defaultLocale : options.locale || _this.locale;
|
||||
if (typeof options.locale === "undefined") {
|
||||
options.locale = _this.locale;
|
||||
}
|
||||
parsedAs = parseRelativeUrl(hasBasePath(as) ? delBasePath(as) : as);
|
||||
localePathResult = normalizeLocalePath(parsedAs.pathname, _this.locales);
|
||||
if (localePathResult.detectedLocale) {
|
||||
_this.locale = localePathResult.detectedLocale;
|
||||
parsedAs.pathname = addBasePath(parsedAs.pathname);
|
||||
as = formatWithValidation(parsedAs);
|
||||
url = addBasePath(normalizeLocalePath(hasBasePath(url) ? delBasePath(url) : url, _this.locales).pathname);
|
||||
}
|
||||
didNavigate = false;
|
||||
// we need to wrap this in the env check again since regenerator runtime
|
||||
// moves this on its own due to the return
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
;
|
||||
// if the locale isn't configured hard navigate to show 404 page
|
||||
if (!((ref = _this.locales) === null || ref === void 0 ? void 0 : ref.includes(_this.locale))) {
|
||||
parsedAs.pathname = addLocale(parsedAs.pathname, _this.locale);
|
||||
window.location.href = formatWithValidation(parsedAs);
|
||||
// this was previously a return but was removed in favor
|
||||
// of better dead code elimination with regenerator runtime
|
||||
didNavigate = true;
|
||||
}
|
||||
}
|
||||
detectedDomain = detectDomainLocale(_this.domainLocales, undefined, _this.locale);
|
||||
// we need to wrap this in the env check again since regenerator runtime
|
||||
// moves this on its own due to the return
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
// if we are navigating to a domain locale ensure we redirect to the
|
||||
// correct domain
|
||||
if (!didNavigate && detectedDomain && _this.isLocaleDomain && self.location.hostname !== detectedDomain.domain) {
|
||||
asNoBasePath = delBasePath(as);
|
||||
window.location.href = "http".concat(detectedDomain.http ? "" : "s", "://").concat(detectedDomain.domain).concat(addBasePath("".concat(_this.locale === detectedDomain.defaultLocale ? "" : "/".concat(_this.locale)).concat(asNoBasePath === "/" ? "" : asNoBasePath) || "/"));
|
||||
// this was previously a return but was removed in favor
|
||||
// of better dead code elimination with regenerator runtime
|
||||
didNavigate = true;
|
||||
}
|
||||
}
|
||||
if (didNavigate) {
|
||||
return [
|
||||
2,
|
||||
new Promise(function() {})
|
||||
];
|
||||
}
|
||||
}
|
||||
detectedDomain = detectDomainLocale(_this.domainLocales, undefined, _this.locale);
|
||||
// we need to wrap this in the env check again since regenerator runtime
|
||||
// moves this on its own due to the return
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
// if we are navigating to a domain locale ensure we redirect to the
|
||||
// correct domain
|
||||
if (!didNavigate && detectedDomain && _this.isLocaleDomain && self.location.hostname !== detectedDomain.domain) {
|
||||
asNoBasePath = delBasePath(as);
|
||||
window.location.href = "http".concat(detectedDomain.http ? "" : "s", "://").concat(detectedDomain.domain).concat(addBasePath("".concat(_this.locale === detectedDomain.defaultLocale ? "" : "/".concat(_this.locale)).concat(asNoBasePath === "/" ? "" : asNoBasePath) || "/"));
|
||||
// this was previously a return but was removed in favor
|
||||
// of better dead code elimination with regenerator runtime
|
||||
didNavigate = true;
|
||||
}
|
||||
}
|
||||
if (!didNavigate) {
|
||||
_ctx.next = 18;
|
||||
break;
|
||||
}
|
||||
return _ctx.abrupt("return", new Promise(function() {}));
|
||||
case 18:
|
||||
if (!options._h) {
|
||||
_this.isSsr = false;
|
||||
}
|
||||
@ -86,9 +84,8 @@ var Router = /*#__PURE__*/ function() {
|
||||
performance.mark("routeChange");
|
||||
}
|
||||
_shallow = options.shallow, shallow = _shallow === void 0 ? false : _shallow;
|
||||
routeProps = {
|
||||
shallow: shallow
|
||||
};
|
||||
_tmp = {};
|
||||
routeProps = (_tmp.shallow = shallow, _tmp);
|
||||
if (_this._inFlightRoute) {
|
||||
_this.abortComponentLoad(_this._inFlightRoute, routeProps);
|
||||
}
|
||||
@ -96,44 +93,60 @@ var Router = /*#__PURE__*/ function() {
|
||||
cleanedAs = delLocale(hasBasePath(as) ? delBasePath(as) : as, _this.locale);
|
||||
_this._inFlightRoute = as;
|
||||
localeChange = prevLocale !== _this.locale;
|
||||
if (!(!options._h && _this.onlyAHashChange(cleanedAs) && !localeChange)) {
|
||||
_ctx.next = 35;
|
||||
break;
|
||||
// If the url change is only related to a hash change
|
||||
// We should not proceed. We should only change the state.
|
||||
// WARNING: `_h` is an internal option for handing Next.js client-side
|
||||
// hydration. Your app should _never_ use this property. It may change at
|
||||
// any time without notice.
|
||||
if (!options._h && _this.onlyAHashChange(cleanedAs) && !localeChange) {
|
||||
_this.asPath = cleanedAs;
|
||||
Router.events.emit("hashChangeStart", as, routeProps);
|
||||
// TODO: do we need the resolved href when only a hash change?
|
||||
_this.changeState(method, url, as, options);
|
||||
_this.scrollToHash(cleanedAs);
|
||||
_this.notify(_this.components[_this.route], null);
|
||||
Router.events.emit("hashChangeComplete", as, routeProps);
|
||||
return [
|
||||
2,
|
||||
true
|
||||
];
|
||||
}
|
||||
_this.asPath = cleanedAs;
|
||||
Router.events.emit("hashChangeStart", as, routeProps);
|
||||
// TODO: do we need the resolved href when only a hash change?
|
||||
_this.changeState(method, url, as, options);
|
||||
_this.scrollToHash(cleanedAs);
|
||||
_this.notify(_this.components[_this.route], null);
|
||||
Router.events.emit("hashChangeComplete", as, routeProps);
|
||||
return _ctx.abrupt("return", true);
|
||||
case 35:
|
||||
parsed = parseRelativeUrl(url);
|
||||
pathname = parsed.pathname, query = parsed.query;
|
||||
;
|
||||
_ctx.prev = 38;
|
||||
_ctx.next = 41;
|
||||
return _this.pageLoader.getPageList();
|
||||
case 41:
|
||||
pages = _ctx.sent;
|
||||
;
|
||||
_ctx.next = 45;
|
||||
return getClientBuildManifest();
|
||||
case 45:
|
||||
ref1 = _ctx.sent;
|
||||
rewrites = ref1.__rewrites;
|
||||
ref1;
|
||||
_ctx.next = 54;
|
||||
break;
|
||||
case 50:
|
||||
_ctx.prev = 50;
|
||||
_ctx.t0 = _ctx["catch"](38);
|
||||
_state.label = 1;
|
||||
case 1:
|
||||
_state.trys.push([
|
||||
1,
|
||||
4,
|
||||
,
|
||||
5
|
||||
]);
|
||||
return [
|
||||
4,
|
||||
_this.pageLoader.getPageList()
|
||||
];
|
||||
case 2:
|
||||
pages = _state.sent();
|
||||
return [
|
||||
4,
|
||||
getClientBuildManifest()
|
||||
];
|
||||
case 3:
|
||||
ref1 = _state.sent(), rewrites = ref1.__rewrites, ref1;
|
||||
return [
|
||||
3,
|
||||
5
|
||||
];
|
||||
case 4:
|
||||
err = _state.sent();
|
||||
// If we fail to resolve the page list or client-build manifest, we must
|
||||
// do a server-side transition:
|
||||
window.location.href = as;
|
||||
return _ctx.abrupt("return", false);
|
||||
case 54:
|
||||
return [
|
||||
2,
|
||||
false
|
||||
];
|
||||
case 5:
|
||||
// If asked to change the current URL we should reload the current page
|
||||
// (not location.reload() but reload getInitialProps and other Next.js stuffs)
|
||||
// We also need to set the method = replaceState always
|
||||
@ -171,113 +184,126 @@ var Router = /*#__PURE__*/ function() {
|
||||
}
|
||||
}
|
||||
route = removePathTrailingSlash(pathname);
|
||||
if (isLocalURL(as)) {
|
||||
_ctx.next = 64;
|
||||
break;
|
||||
if (!isLocalURL(as)) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
throw new Error('Invalid href: "'.concat(url, '" and as: "').concat(as, '", received relative href and external as') + "\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as");
|
||||
}
|
||||
window.location.href = as;
|
||||
return [
|
||||
2,
|
||||
false
|
||||
];
|
||||
}
|
||||
if (!(process.env.NODE_ENV !== "production")) {
|
||||
_ctx.next = 62;
|
||||
break;
|
||||
}
|
||||
throw new Error('Invalid href: "'.concat(url, '" and as: "').concat(as, '", received relative href and external as') + "\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as");
|
||||
case 62:
|
||||
window.location.href = as;
|
||||
return _ctx.abrupt("return", false);
|
||||
case 64:
|
||||
resolvedAs = delLocale(delBasePath(resolvedAs), _this.locale);
|
||||
if (!isDynamicRoute(route)) {
|
||||
_ctx.next = 80;
|
||||
break;
|
||||
_tmp1 = {};
|
||||
if (isDynamicRoute(route)) {
|
||||
parsedAs1 = parseRelativeUrl(resolvedAs);
|
||||
asPathname = parsedAs1.pathname;
|
||||
routeRegex = getRouteRegex(route);
|
||||
routeMatch = getRouteMatcher(routeRegex)(asPathname);
|
||||
shouldInterpolate = route === asPathname;
|
||||
interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : _tmp1;
|
||||
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
|
||||
missingParams = Object.keys(routeRegex.groups).filter(function(param) {
|
||||
return !query[param];
|
||||
});
|
||||
if (missingParams.length > 0) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.warn("".concat(shouldInterpolate ? "Interpolating href" : "Mismatching `as` and `href`", " failed to manually provide ") + "the params: ".concat(missingParams.join(", "), " in the `href`'s `query`"));
|
||||
}
|
||||
throw new Error((shouldInterpolate ? "The provided `href` (".concat(url, ") value is missing query values (").concat(missingParams.join(", "), ") to be interpolated properly. ") : "The provided `as` value (".concat(asPathname, ") is incompatible with the `href` value (").concat(route, "). ")) + "Read more: https://nextjs.org/docs/messages/".concat(shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"));
|
||||
}
|
||||
} else if (shouldInterpolate) {
|
||||
as = formatWithValidation(Object.assign({}, parsedAs1, {
|
||||
pathname: interpolatedAs.result,
|
||||
query: omitParmsFromQuery(query, interpolatedAs.params)
|
||||
}));
|
||||
} else {
|
||||
// Merge params into `query`, overwriting any specified in search
|
||||
Object.assign(query, routeMatch);
|
||||
}
|
||||
}
|
||||
parsedAs1 = parseRelativeUrl(resolvedAs);
|
||||
asPathname = parsedAs1.pathname;
|
||||
routeRegex = getRouteRegex(route);
|
||||
routeMatch = getRouteMatcher(routeRegex)(asPathname);
|
||||
shouldInterpolate = route === asPathname;
|
||||
interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
|
||||
if (!(!routeMatch || shouldInterpolate && !interpolatedAs.result)) {
|
||||
_ctx.next = 79;
|
||||
break;
|
||||
}
|
||||
missingParams = Object.keys(routeRegex.groups).filter(function(param) {
|
||||
return !query[param];
|
||||
});
|
||||
if (!(missingParams.length > 0)) {
|
||||
_ctx.next = 77;
|
||||
break;
|
||||
}
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.warn("".concat(shouldInterpolate ? "Interpolating href" : "Mismatching `as` and `href`", " failed to manually provide ") + "the params: ".concat(missingParams.join(", "), " in the `href`'s `query`"));
|
||||
}
|
||||
throw new Error((shouldInterpolate ? "The provided `href` (".concat(url, ") value is missing query values (").concat(missingParams.join(", "), ") to be interpolated properly. ") : "The provided `as` value (".concat(asPathname, ") is incompatible with the `href` value (").concat(route, "). ")) + "Read more: https://nextjs.org/docs/messages/".concat(shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"));
|
||||
case 77:
|
||||
_ctx.next = 80;
|
||||
break;
|
||||
case 79:
|
||||
if (shouldInterpolate) {
|
||||
as = formatWithValidation(Object.assign({}, parsedAs1, {
|
||||
pathname: interpolatedAs.result,
|
||||
query: omitParmsFromQuery(query, interpolatedAs.params)
|
||||
}));
|
||||
} else {
|
||||
// Merge params into `query`, overwriting any specified in search
|
||||
Object.assign(query, routeMatch);
|
||||
}
|
||||
case 80:
|
||||
Router.events.emit("routeChangeStart", as, routeProps);
|
||||
_ctx.prev = 81;
|
||||
;
|
||||
_ctx.next = 85;
|
||||
return _this.getRouteInfo(route, pathname, query, as, resolvedAs, routeProps);
|
||||
case 85:
|
||||
routeInfo = _ctx.sent;
|
||||
_state.label = 6;
|
||||
case 6:
|
||||
_state.trys.push([
|
||||
6,
|
||||
15,
|
||||
,
|
||||
16
|
||||
]);
|
||||
return [
|
||||
4,
|
||||
_this.getRouteInfo(route, pathname, query, as, resolvedAs, routeProps)
|
||||
];
|
||||
case 7:
|
||||
routeInfo = _state.sent();
|
||||
error = routeInfo.error, props = routeInfo.props, __N_SSG = routeInfo.__N_SSG, __N_SSP = routeInfo.__N_SSP;
|
||||
if (!((__N_SSG || __N_SSP) && props)) {
|
||||
_ctx.next = 112;
|
||||
break;
|
||||
if (!((__N_SSG || __N_SSP) && props)) return [
|
||||
3,
|
||||
13
|
||||
];
|
||||
if (props.pageProps && props.pageProps.__N_REDIRECT) {
|
||||
destination = props.pageProps.__N_REDIRECT;
|
||||
// check if destination is internal (resolves to a page) and attempt
|
||||
// client-navigation if it is falling back to hard navigation if
|
||||
// it's not
|
||||
if (destination.startsWith("/") && props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
|
||||
parsedHref = parseRelativeUrl(destination);
|
||||
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
|
||||
ref4 = prepareUrlAs(_this, destination, destination), newUrl = ref4.url, newAs = ref4.as;
|
||||
return [
|
||||
2,
|
||||
_this.change(method, newUrl, newAs, options)
|
||||
];
|
||||
}
|
||||
window.location.href = destination;
|
||||
return [
|
||||
2,
|
||||
new Promise(function() {})
|
||||
];
|
||||
}
|
||||
if (!(props.pageProps && props.pageProps.__N_REDIRECT)) {
|
||||
_ctx.next = 97;
|
||||
break;
|
||||
}
|
||||
destination = props.pageProps.__N_REDIRECT;
|
||||
if (!(destination.startsWith("/") && props.pageProps.__N_REDIRECT_BASE_PATH !== false)) {
|
||||
_ctx.next = 95;
|
||||
break;
|
||||
}
|
||||
parsedHref = parseRelativeUrl(destination);
|
||||
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
|
||||
ref4 = prepareUrlAs(_this, destination, destination), newUrl = ref4.url, newAs = ref4.as;
|
||||
return _ctx.abrupt("return", _this.change(method, newUrl, newAs, options));
|
||||
case 95:
|
||||
window.location.href = destination;
|
||||
return _ctx.abrupt("return", new Promise(function() {}));
|
||||
case 97:
|
||||
_this.isPreview = !!props.__N_PREVIEW;
|
||||
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
|
||||
_ctx.next = 112;
|
||||
break;
|
||||
}
|
||||
;
|
||||
_ctx.prev = 100;
|
||||
_ctx.next = 103;
|
||||
return _this.fetchComponent("/404");
|
||||
case 103:
|
||||
if (!(props.notFound === SSG_DATA_NOT_FOUND)) return [
|
||||
3,
|
||||
13
|
||||
];
|
||||
_state.label = 8;
|
||||
case 8:
|
||||
_state.trys.push([
|
||||
8,
|
||||
10,
|
||||
,
|
||||
11
|
||||
]);
|
||||
return [
|
||||
4,
|
||||
_this.fetchComponent("/404")
|
||||
];
|
||||
case 9:
|
||||
_state.sent();
|
||||
notFoundRoute = "/404";
|
||||
_ctx.next = 109;
|
||||
break;
|
||||
case 106:
|
||||
_ctx.prev = 106;
|
||||
_ctx.t1 = _ctx["catch"](100);
|
||||
return [
|
||||
3,
|
||||
11
|
||||
];
|
||||
case 10:
|
||||
_ = _state.sent();
|
||||
notFoundRoute = "/_error";
|
||||
case 109:
|
||||
_ctx.next = 111;
|
||||
return _this.getRouteInfo(notFoundRoute, notFoundRoute, query, as, resolvedAs, {
|
||||
shallow: false
|
||||
});
|
||||
case 111:
|
||||
routeInfo = _ctx.sent;
|
||||
case 112:
|
||||
return [
|
||||
3,
|
||||
11
|
||||
];
|
||||
case 11:
|
||||
_tmp2 = {};
|
||||
return [
|
||||
4,
|
||||
_this.getRouteInfo(notFoundRoute, notFoundRoute, query, as, resolvedAs, (_tmp2.shallow = false, _tmp2))
|
||||
];
|
||||
case 12:
|
||||
routeInfo = _state.sent();
|
||||
_state.label = 13;
|
||||
case 13:
|
||||
Router.events.emit("beforeHistoryChange", as, routeProps);
|
||||
_this.changeState(method, url, as, options);
|
||||
if (options._h && pathname === "/_error" && ((ref2 = self.__NEXT_DATA__.props) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.pageProps) === null || ref3 === void 0 ? void 0 : ref3.statusCode) === 500 && (props === null || props === void 0 ? void 0 : props.pageProps)) {
|
||||
@ -286,61 +312,48 @@ var Router = /*#__PURE__*/ function() {
|
||||
props.pageProps.statusCode = 500;
|
||||
}
|
||||
isValidShallowRoute = options.shallow && _this.route === route;
|
||||
;
|
||||
shouldScroll = (_scroll = options.scroll) !== null && _scroll !== void 0 ? _scroll : !isValidShallowRoute;
|
||||
resetScroll = shouldScroll ? {
|
||||
x: 0,
|
||||
y: 0
|
||||
} : null;
|
||||
_ctx.next = 121;
|
||||
return _this.set(route, pathname, query, cleanedAs, routeInfo, forcedScroll !== null && forcedScroll !== void 0 ? forcedScroll : resetScroll).catch(function(e) {
|
||||
if (e.cancelled) error = error || e;
|
||||
else throw e;
|
||||
});
|
||||
case 121:
|
||||
if (!error) {
|
||||
_ctx.next = 124;
|
||||
break;
|
||||
_tmp3 = {};
|
||||
resetScroll = shouldScroll ? (_tmp3.x = 0, _tmp3.y = 0, _tmp3) : null;
|
||||
return [
|
||||
4,
|
||||
_this.set(route, pathname, query, cleanedAs, routeInfo, forcedScroll !== null && forcedScroll !== void 0 ? forcedScroll : resetScroll).catch(function(e) {
|
||||
if (e.cancelled) error = error || e;
|
||||
else throw e;
|
||||
})
|
||||
];
|
||||
case 14:
|
||||
_state.sent();
|
||||
if (error) {
|
||||
Router.events.emit("routeChangeError", error, cleanedAs, routeProps);
|
||||
throw error;
|
||||
}
|
||||
Router.events.emit("routeChangeError", error, cleanedAs, routeProps);
|
||||
throw error;
|
||||
case 124:
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
if (_this.locale) {
|
||||
document.documentElement.lang = _this.locale;
|
||||
}
|
||||
}
|
||||
Router.events.emit("routeChangeComplete", as, routeProps);
|
||||
return _ctx.abrupt("return", true);
|
||||
case 129:
|
||||
_ctx.prev = 129;
|
||||
_ctx.t2 = _ctx["catch"](81);
|
||||
if (!(isError(_ctx.t2) && _ctx.t2.cancelled)) {
|
||||
_ctx.next = 133;
|
||||
break;
|
||||
return [
|
||||
2,
|
||||
true
|
||||
];
|
||||
case 15:
|
||||
err1 = _state.sent();
|
||||
if (isError(err1) && err1.cancelled) {
|
||||
return [
|
||||
2,
|
||||
false
|
||||
];
|
||||
}
|
||||
return _ctx.abrupt("return", false);
|
||||
case 133:
|
||||
throw _ctx.t2;
|
||||
case 134:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
throw err1;
|
||||
case 16:
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee, null, [
|
||||
[
|
||||
38,
|
||||
50
|
||||
],
|
||||
[
|
||||
81,
|
||||
129
|
||||
],
|
||||
[
|
||||
100,
|
||||
106
|
||||
]
|
||||
]);
|
||||
}))();
|
||||
});
|
||||
})();
|
||||
};
|
||||
return Router;
|
||||
}();
|
||||
|
@ -1,5 +1,5 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
export default function StaticPage(param) {
|
||||
var data = param.data;
|
||||
return /*#__PURE__*/ React.createElement("div", null, data.foo);
|
||||
@ -8,22 +8,19 @@ export function getStaticProps() {
|
||||
return _getStaticProps.apply(this, arguments);
|
||||
}
|
||||
function _getStaticProps() {
|
||||
_getStaticProps = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.abrupt("return", {
|
||||
props: {
|
||||
data: {
|
||||
foo: "bar"
|
||||
}
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_getStaticProps = _async_to_generator(function() {
|
||||
var _tmp;
|
||||
return _ts_generator(this, function(_state) {
|
||||
_tmp = {};
|
||||
return [
|
||||
2,
|
||||
(_tmp.props = {
|
||||
data: {
|
||||
foo: "bar"
|
||||
}
|
||||
}, _tmp)
|
||||
];
|
||||
});
|
||||
});
|
||||
return _getStaticProps.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAA;;AAAA,eAAe,SAASA,UAAU,CAAC,KAAQ,EAAE;QAAV,AAAEC,IAAI,GAAN,KAAQ,CAANA,IAAI,AAAE;IACvC,qBAAO,oBAACC,KAAG,QAAED,IAAI,CAACE,GAAG,CAAO,CAAC;AACjC,CAAC,CAAA;AAED,gBAAsBC,cAAc;WAAdA,eAAc;CAQnC;SARqBA,eAAc;IAAdA,eAAc,GAA7B,0DAAA,mBAAgC;;;;iDAC5B;wBACHC,KAAK,EAAE;4BACHJ,IAAI,EAAE;gCACFE,GAAG,EAAE,KAAK;6BACb;yBACJ;qBACJ;;;;;;IACL,CAAC,EAAA;WARqBC,eAAc",
|
||||
"mappings": "AAAA;;AAAA,eAAe,SAASA,UAAU,CAAC,KAAQ,EAAE;QAAV,AAAEC,IAAI,GAAN,KAAQ,CAANA,IAAI,AAAE;IACvC,qBAAO,oBAACC,KAAG,QAAED,IAAI,CAACE,GAAG,CAAO,CAAC;AACjC,CAAC,CAAA;AAED,gBAAsBC,cAAc;WAAdA,eAAc;CAQnC;SARqBA,eAAc;IAAdA,eAAc,GAA7B,oBAAA,WAAgC;;;;YACnC;;sBACIC,KAAK,GAAE;oBACHJ,IAAI,EAAE;wBACFE,GAAG,EAAE,KAAK;qBACb;iBACJ;cACH;;IACN,CAAC,CAAA;WARqBC,eAAc",
|
||||
"names": [
|
||||
"StaticPage",
|
||||
"data",
|
||||
|
@ -1 +1 @@
|
||||
import t from"@swc/helpers/src/_async_to_generator.mjs";import r from"regenerator-runtime";export default function e(t){var r=t.data;return React.createElement("div",null,r.foo)};export function getStaticProps(){return n.apply(this,arguments)}function n(){return(n=t(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{props:{data:{foo:"bar"}}});case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}
|
||||
import t from"@swc/helpers/src/_async_to_generator.mjs";import r from"@swc/helpers/src/_ts_generator.mjs";export default function n(t){var r=t.data;return React.createElement("div",null,r.foo)};export function getStaticProps(){return o.apply(this,arguments)}function o(){return(o=t(function(){var t;return r(this,function(r){return[2,((t={}).props={data:{foo:"bar"}},t)]})})).apply(this,arguments)}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAA,0FAAA,gBAAe,SAASA,CAAU,CAAC,CAAQ,CAAE,KAAV,AAAEC,CAAI,CAAN,CAAQ,CAANA,IAAI,AAAE,AACvC,QAAO,oBAACC,KAAG,MAAED,CAAI,CAACE,GAAG,CAAO,AAAC,AACjC,CAAC,AAED,iBAAsBC,cAAc,UAAdA,CAAc,uBAQnC,SARqBA,CAAc,UAAdA,CAAc,CAA7B,SAAA,YAAgC,wFAC5B,CACHC,KAAK,CAAE,CACHJ,IAAI,CAAE,CACFE,GAAG,CAAE,KAAK,CACb,CACJ,CACJ,uCACL,CAAC,EAAA,wBAAA",
|
||||
"mappings": "AAAA,yGAAA,gBAAe,SAASA,CAAU,CAAC,CAAQ,CAAE,KAAV,AAAEC,CAAI,CAAN,CAAQ,CAANA,IAAI,AAAE,AACvC,QAAO,oBAACC,KAAG,MAAED,CAAI,CAACE,GAAG,CAAO,AAAC,AACjC,CAAC,AAED,iBAAsBC,cAAc,UAAdA,CAAc,uBAQnC,SARqBA,CAAc,UAAdA,CAAc,CAA7B,EAAA,UAAgC,iCACnC,iBACIC,KAAK,CAAE,CACHJ,IAAI,CAAE,CACFE,GAAG,CAAE,KAAK,CACb,CACJ,IACH,EACN,CAAC,CAAA,wBAAA",
|
||||
"names": [
|
||||
"StaticPage",
|
||||
"data",
|
||||
|
@ -1,69 +1,70 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var query, res1, res2, res3, avif, webp, jpeg;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(function() {
|
||||
var query, _tmp, res1, _tmp1, res2, _tmp2, res3, _tmp3, avif, webp, jpeg, _tmp4;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
query = {
|
||||
url: "/test.jpg",
|
||||
w: w,
|
||||
q: 75
|
||||
};
|
||||
_ctx.next = 3;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp = {};
|
||||
query = (_tmp.url = "/test.jpg", _tmp.w = w, _tmp.q = 75, _tmp);
|
||||
_tmp1 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp1.headers = {
|
||||
accept: "image/avif"
|
||||
}
|
||||
});
|
||||
case 3:
|
||||
res1 = _ctx.sent;
|
||||
}, _tmp1))
|
||||
];
|
||||
case 1:
|
||||
res1 = _state.sent();
|
||||
expect(res1.status).toBe(200);
|
||||
expect(res1.headers.get("Content-Type")).toBe("image/avif");
|
||||
_ctx.next = 8;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp2 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp2.headers = {
|
||||
accept: "image/webp"
|
||||
}
|
||||
});
|
||||
case 8:
|
||||
res2 = _ctx.sent;
|
||||
}, _tmp2))
|
||||
];
|
||||
case 2:
|
||||
res2 = _state.sent();
|
||||
expect(res2.status).toBe(200);
|
||||
expect(res2.headers.get("Content-Type")).toBe("image/webp");
|
||||
_ctx.next = 13;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp3 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp3.headers = {
|
||||
accept: "image/jpeg"
|
||||
}
|
||||
});
|
||||
case 13:
|
||||
res3 = _ctx.sent;
|
||||
}, _tmp3))
|
||||
];
|
||||
case 3:
|
||||
res3 = _state.sent();
|
||||
expect(res3.status).toBe(200);
|
||||
expect(res3.headers.get("Content-Type")).toBe("image/jpeg");
|
||||
_ctx.next = 18;
|
||||
return res1.buffer();
|
||||
case 18:
|
||||
avif = _ctx.sent.byteLength;
|
||||
_ctx.next = 21;
|
||||
return res2.buffer();
|
||||
case 21:
|
||||
webp = _ctx.sent.byteLength;
|
||||
_ctx.next = 24;
|
||||
return res3.buffer();
|
||||
case 24:
|
||||
jpeg = _ctx.sent.byteLength;
|
||||
console.log({
|
||||
isSharp: isSharp,
|
||||
w: w,
|
||||
avif: avif,
|
||||
webp: webp,
|
||||
jpeg: jpeg
|
||||
});
|
||||
return [
|
||||
4,
|
||||
res1.buffer()
|
||||
];
|
||||
case 4:
|
||||
avif = _state.sent().byteLength;
|
||||
return [
|
||||
4,
|
||||
res2.buffer()
|
||||
];
|
||||
case 5:
|
||||
webp = _state.sent().byteLength;
|
||||
return [
|
||||
4,
|
||||
res3.buffer()
|
||||
];
|
||||
case 6:
|
||||
jpeg = _state.sent().byteLength;
|
||||
_tmp4 = {};
|
||||
console.log((_tmp4.isSharp = isSharp, _tmp4.w = w, _tmp4.avif = avif, _tmp4.webp = webp, _tmp4.jpeg = jpeg, _tmp4));
|
||||
expect(webp).toBeLessThan(jpeg);
|
||||
expect(avif).toBeLessThan(webp);
|
||||
case 28:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
})));
|
||||
});
|
||||
}));
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,0DAAA,mBAAY;QACpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;AACpC,CAAC,EAAA,CAAC,CAAC",
|
||||
"mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,oBAAA,WAAY;QACpEC,KAAK,QACLC,IAAI,SAQJC,IAAI,SAQJC,IAAI,SAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;;gBA3BJN,KAAK,SAAKO,GAAG,GAAE,WAAW,OAAEC,CAAC,GAADA,CAAC,OAAEC,CAAC,GAAE,EAAE,OAAE,CAAC;;gBAChC;;oBAAMC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIZ,IAAI,GAAG,aAIX,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;gBAE/C;;oBAAMN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIX,IAAI,GAAG,aAIX,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;gBAE/C;;oBAAMN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIV,IAAI,GAAG,aAIX,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;gBAE9C;;oBAAMf,IAAI,CAACiB,MAAM,EAAE;kBAAA;;gBAA3Bd,IAAI,GAAG,AAAC,aAAmB,CAAEe,UAAU,CAAA;gBAC/B;;oBAAMjB,IAAI,CAACgB,MAAM,EAAE;kBAAA;;gBAA3Bb,IAAI,GAAG,AAAC,aAAmB,CAAEc,UAAU,CAAA;gBAC/B;;oBAAMhB,IAAI,CAACe,MAAM,EAAE;kBAAA;;gBAA3BZ,IAAI,GAAG,AAAC,aAAmB,CAAEa,UAAU,CAAA;;gBAE7CC,OAAO,CAACC,GAAG,QAAGC,OAAO,GAAPA,OAAO,QAAEd,CAAC,GAADA,CAAC,QAAEJ,IAAI,GAAJA,IAAI,QAAEC,IAAI,GAAJA,IAAI,QAAEC,IAAI,GAAJA,IAAI,SAAG,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;AACpC,CAAC,CAAA,CAAC,CAAC",
|
||||
"names": [
|
||||
"it",
|
||||
"query",
|
||||
|
@ -1,69 +1,70 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var query, res1, res2, res3, avif, webp, jpeg;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(function() {
|
||||
var query, _tmp, res1, _tmp1, res2, _tmp2, res3, _tmp3, avif, webp, jpeg, _tmp4;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
query = {
|
||||
url: "/test.jpg",
|
||||
w: w,
|
||||
q: 75
|
||||
};
|
||||
_ctx.next = 3;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp = {};
|
||||
query = (_tmp.url = "/test.jpg", _tmp.w = w, _tmp.q = 75, _tmp);
|
||||
_tmp1 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp1.headers = {
|
||||
accept: "image/avif"
|
||||
}
|
||||
});
|
||||
case 3:
|
||||
res1 = _ctx.sent;
|
||||
}, _tmp1))
|
||||
];
|
||||
case 1:
|
||||
res1 = _state.sent();
|
||||
expect(res1.status).toBe(200);
|
||||
expect(res1.headers.get("Content-Type")).toBe("image/avif");
|
||||
_ctx.next = 8;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp2 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp2.headers = {
|
||||
accept: "image/webp"
|
||||
}
|
||||
});
|
||||
case 8:
|
||||
res2 = _ctx.sent;
|
||||
}, _tmp2))
|
||||
];
|
||||
case 2:
|
||||
res2 = _state.sent();
|
||||
expect(res2.status).toBe(200);
|
||||
expect(res2.headers.get("Content-Type")).toBe("image/webp");
|
||||
_ctx.next = 13;
|
||||
return fetchViaHTTP(appPort, "/_next/image", query, {
|
||||
headers: {
|
||||
_tmp3 = {};
|
||||
return [
|
||||
4,
|
||||
fetchViaHTTP(appPort, "/_next/image", query, (_tmp3.headers = {
|
||||
accept: "image/jpeg"
|
||||
}
|
||||
});
|
||||
case 13:
|
||||
res3 = _ctx.sent;
|
||||
}, _tmp3))
|
||||
];
|
||||
case 3:
|
||||
res3 = _state.sent();
|
||||
expect(res3.status).toBe(200);
|
||||
expect(res3.headers.get("Content-Type")).toBe("image/jpeg");
|
||||
_ctx.next = 18;
|
||||
return res1.buffer();
|
||||
case 18:
|
||||
avif = _ctx.sent.byteLength;
|
||||
_ctx.next = 21;
|
||||
return res2.buffer();
|
||||
case 21:
|
||||
webp = _ctx.sent.byteLength;
|
||||
_ctx.next = 24;
|
||||
return res3.buffer();
|
||||
case 24:
|
||||
jpeg = _ctx.sent.byteLength;
|
||||
console.log({
|
||||
isSharp: isSharp,
|
||||
w: w,
|
||||
avif: avif,
|
||||
webp: webp,
|
||||
jpeg: jpeg
|
||||
});
|
||||
return [
|
||||
4,
|
||||
res1.buffer()
|
||||
];
|
||||
case 4:
|
||||
avif = _state.sent().byteLength;
|
||||
return [
|
||||
4,
|
||||
res2.buffer()
|
||||
];
|
||||
case 5:
|
||||
webp = _state.sent().byteLength;
|
||||
return [
|
||||
4,
|
||||
res3.buffer()
|
||||
];
|
||||
case 6:
|
||||
jpeg = _state.sent().byteLength;
|
||||
_tmp4 = {};
|
||||
console.log((_tmp4.isSharp = isSharp, _tmp4.w = w, _tmp4.avif = avif, _tmp4.webp = webp, _tmp4.jpeg = jpeg, _tmp4));
|
||||
expect(webp).toBeLessThan(jpeg);
|
||||
expect(avif).toBeLessThan(webp);
|
||||
case 28:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _callee);
|
||||
})));
|
||||
});
|
||||
}));
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,0DAAA,mBAAY;QAOpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;AACpC,CAAC,EAAA,CAAC,CAAC",
|
||||
"mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,oBAAA,WAAY;QAOpEC,KAAK,QACLC,IAAI,SAQJC,IAAI,SAQJC,IAAI,SAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;;gBA3BJN,KAAK,SAAKO,GAAG,GAAE,WAAW,OAAEC,CAAC,GAADA,CAAC,OAAEC,CAAC,GAAE,EAAE,OAAE,CAAC;;gBAChC;;oBAAMC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIZ,IAAI,GAAG,aAIX,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;gBAE/C;;oBAAMN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIX,IAAI,GAAG,aAIX,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;gBAE/C;;oBAAMN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,SAC1DY,OAAO,GAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB,SACH;kBAAA;;gBAJIV,IAAI,GAAG,aAIX,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;gBAE9C;;oBAAMf,IAAI,CAACiB,MAAM,EAAE;kBAAA;;gBAA3Bd,IAAI,GAAG,AAAC,aAAmB,CAAEe,UAAU,CAAA;gBAC/B;;oBAAMjB,IAAI,CAACgB,MAAM,EAAE;kBAAA;;gBAA3Bb,IAAI,GAAG,AAAC,aAAmB,CAAEc,UAAU,CAAA;gBAC/B;;oBAAMhB,IAAI,CAACe,MAAM,EAAE;kBAAA;;gBAA3BZ,IAAI,GAAG,AAAC,aAAmB,CAAEa,UAAU,CAAA;;gBAE7CC,OAAO,CAACC,GAAG,QAAGC,OAAO,GAAPA,OAAO,QAAEd,CAAC,GAADA,CAAC,QAAEJ,IAAI,GAAJA,IAAI,QAAEC,IAAI,GAAJA,IAAI,QAAEC,IAAI,GAAJA,IAAI,SAAG,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;AACpC,CAAC,CAAA,CAAC,CAAC",
|
||||
"names": [
|
||||
"it",
|
||||
"query",
|
||||
|
@ -3,10 +3,13 @@ $DIR/tests/stacktrace/issue-622/input/index.js:3
|
||||
^
|
||||
|
||||
ReferenceError: call is not defined
|
||||
at null._callee$ ($DIR/tests/stacktrace/issue-622/input/index.js:3:9)
|
||||
at null.<anonymous> ($DIR/tests/stacktrace/issue-622/input/index.js:3:9)
|
||||
at null.step ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at Object.next ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at null.asyncGeneratorStep ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at null._next ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at null.<anonymous> ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at new Promise (<anonymous>)
|
||||
at null.<anonymous> ($DIR/tests/stacktrace/issue-622/input/index.js:1:1)
|
||||
at null._foo ($DIR/tests/stacktrace/issue-622/input/index.js:1:19)
|
||||
at null.foo ($DIR/tests/stacktrace/issue-622/input/index.js:1:19)
|
||||
|
@ -1,15 +1,10 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
var v;
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,12 +1,9 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,23 +1,23 @@
|
||||
// @target: es6
|
||||
import _define_property from "@swc/helpers/src/_define_property.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
var v;
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
var v, _tmp, _tmp1;
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.t0 = _define_property;
|
||||
_ctx.t1 = {};
|
||||
_ctx.next = 4;
|
||||
return;
|
||||
case 4:
|
||||
_ctx.t2 = _ctx.sent;
|
||||
_ctx.t3 = foo;
|
||||
v = (0, _ctx.t0)(_ctx.t1, _ctx.t2, _ctx.t3);
|
||||
case 7:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_tmp1 = {};
|
||||
_tmp = [
|
||||
_tmp1
|
||||
];
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 1:
|
||||
v = _define_property.apply(void 0, _tmp.concat(_state.sent(), foo));
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _define_property from "@swc/helpers/src/_define_property.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,11 +1,9 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var v = /*#__PURE__*/ regeneratorRuntime.mark(function v() {
|
||||
return regeneratorRuntime.wrap(function v$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, v);
|
||||
});
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = function v() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,11 +1,9 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var v = /*#__PURE__*/ regeneratorRuntime.mark(function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, foo);
|
||||
});
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = function foo() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,13 +1,11 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = {
|
||||
foo: /*#__PURE__*/ regeneratorRuntime.mark(function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, foo);
|
||||
})
|
||||
foo: function foo() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,12 +1,10 @@
|
||||
// @target: es6
|
||||
import _define_property from "@swc/helpers/src/_define_property.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var v = _define_property({}, foo(), /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = _define_property({}, foo(), function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
|
@ -1,11 +1,9 @@
|
||||
import _define_property from "@swc/helpers/src/_define_property.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
_define_property({}, foo(), regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function(_ctx) {
|
||||
for(;;)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
_define_property({}, foo(), function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
|
@ -1,20 +1,18 @@
|
||||
// @target: es6
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var C = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function C() {
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
_proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, foo);
|
||||
});
|
||||
_proto.foo = function foo() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
return C;
|
||||
}();
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,20 +1,18 @@
|
||||
// @target: es6
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var C = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function C() {
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
_proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, foo);
|
||||
});
|
||||
_proto.foo = function foo() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
return C;
|
||||
}();
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,20 +1,18 @@
|
||||
// @target: es6
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var C = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function C() {
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
_proto[foo] = /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
});
|
||||
_proto[foo] = function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
return C;
|
||||
}();
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,20 +1,18 @@
|
||||
// @target: es6
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var C = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function C() {
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
_proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, foo);
|
||||
});
|
||||
_proto.foo = function foo() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
};
|
||||
return C;
|
||||
}();
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,16 +1,20 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = {
|
||||
foo: /*#__PURE__*/ regeneratorRuntime.mark(function foo1() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
foo: function foo1() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return foo;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
foo
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, foo1);
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,23 +1,27 @@
|
||||
// @target: es6
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var C = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function C() {
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
_proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo1() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
_proto.foo = function foo1() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return foo;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
foo
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, foo1);
|
||||
});
|
||||
});
|
||||
};
|
||||
return C;
|
||||
}();
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,15 +1,17 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,29 +1,28 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
var bar;
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
bar = function bar() {
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(quux);
|
||||
function quux() {
|
||||
return regeneratorRuntime.wrap(function quux$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return foo;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
return _ts_generator(this, function(_state) {
|
||||
bar = function bar() {
|
||||
function quux() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
return [
|
||||
4,
|
||||
foo
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
};
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
};
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,18 +1,22 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return;
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 2:
|
||||
_ctx.next = 4;
|
||||
return;
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,18 +1,22 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return;
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
4
|
||||
];
|
||||
case 2:
|
||||
_ctx.next = 4;
|
||||
return;
|
||||
case 4:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,14 +1,19 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import _ts_values from "@swc/helpers/src/_ts_values.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
return _ctx.delegateYield(foo, "t0", 1);
|
||||
return [
|
||||
5,
|
||||
_ts_values(foo)
|
||||
];
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1,13 +1,2 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = regeneratorRuntime.mark(foo);
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function(_ctx) {
|
||||
for(;;)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
return _ctx.delegateYield(foo, "t0", 1);
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _marked);
|
||||
}
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import _ts_values from "@swc/helpers/src/_ts_values.mjs";
|
||||
|
@ -1,15 +1,18 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return foo;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
foo
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,14 +1,18 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var v = /*#__PURE__*/ regeneratorRuntime.mark(function v() {
|
||||
return regeneratorRuntime.wrap(function v$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var v = function v() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
_ctx.next = 2;
|
||||
return foo;
|
||||
case 2:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
return [
|
||||
4,
|
||||
foo
|
||||
];
|
||||
case 1:
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, v);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,14 +1,19 @@
|
||||
// @target: es6
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g);
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import _ts_values from "@swc/helpers/src/_ts_values.mjs";
|
||||
function g() {
|
||||
return regeneratorRuntime.wrap(function g$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
return _ts_generator(this, function(_state) {
|
||||
switch(_state.label){
|
||||
case 0:
|
||||
return _ctx.delegateYield([], "t0", 1);
|
||||
return [
|
||||
5,
|
||||
_ts_values([])
|
||||
];
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
_state.sent();
|
||||
return [
|
||||
2
|
||||
];
|
||||
}
|
||||
}, _marked);
|
||||
});
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
import _ts_values from "@swc/helpers/src/_ts_values.mjs";
|
||||
|
@ -2,19 +2,17 @@
|
||||
// @lib: es5,es2015.promise
|
||||
// @noEmitHelpers: true
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function f() {
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
function _f() {
|
||||
_f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_f = _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,19 +1,17 @@
|
||||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
function f() {
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
function _f() {
|
||||
_f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
_f = _async_to_generator(function() {
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return _f.apply(this, arguments);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,20 +1,16 @@
|
||||
// @target: es2017
|
||||
// @noEmitHelpers: true
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var foo = function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var _ref = _async_to_generator(function() {
|
||||
var v;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return function foo() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -2,20 +2,16 @@
|
||||
// @lib: es5,es2015.promise
|
||||
// @noEmitHelpers: true
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var foo = function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var _ref = _async_to_generator(function() {
|
||||
var v;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return function foo() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
@ -1,20 +1,16 @@
|
||||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
var foo = function() {
|
||||
var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
||||
var _ref = _async_to_generator(function() {
|
||||
var v;
|
||||
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
||||
while(1)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
;
|
||||
case 1:
|
||||
case "end":
|
||||
return _ctx.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _ts_generator(this, function(_state) {
|
||||
return [
|
||||
2
|
||||
];
|
||||
});
|
||||
});
|
||||
return function foo() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
|
@ -1,2 +1,2 @@
|
||||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
||||
import regeneratorRuntime from "regenerator-runtime";
|
||||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user