Skip to content

Commit

Permalink
update playground.js (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
wirekang authored Feb 14, 2024
1 parent c560e6f commit 6fab0c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
22 changes: 4 additions & 18 deletions public/playground.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
let interceptor;
export function init(kyselyConstructor, adapter, introspector, queryCompiler, i) {
interceptor = i;
Expand Down Expand Up @@ -42,7 +30,7 @@ class PlaygroundDialect {
}
const resolved = Promise.resolve();
function dispatch(method, detail = {}) {
window.dispatchEvent(new CustomEvent("playground", { detail: Object.assign({ method }, detail) }));
window.dispatchEvent(new CustomEvent("playground", { detail: { method, ...detail } }));
}
class PlaygroundDriver {
init() {
Expand Down Expand Up @@ -81,16 +69,14 @@ class PlaygroundConnection {
}
streamQuery(compiledQuery, chunkSize) {
dispatch("streamQuery", { compiledQuery, chunkSize });
return (function g() {
return __asyncGenerator(this, arguments, function* g_1() {
yield yield __await(playgroundResult());
});
return (async function* g() {
yield playgroundResult();
})();
}
}
function playgroundResult() {
if (interceptor === null || interceptor === void 0 ? void 0 : interceptor.result) {
return interceptor.result;
}
return { rows: [] };
return { rows: [{}] };
}
2 changes: 1 addition & 1 deletion tsconfig.pub.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2015",
"target": "ES2018",
"skipLibCheck": true,
"strict": true,
"module": "ES2015",
Expand Down

0 comments on commit 6fab0c1

Please sign in to comment.