Skip to content

Commit

Permalink
fix: extra transformer preview and type err
Browse files Browse the repository at this point in the history
  • Loading branch information
sarike committed Feb 9, 2023
1 parent d3c1429 commit bcc2dc4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/packages/openblocks-core/lib/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ function evalFunction(unevaledValue, context, methods, isAsync) {
if (runInHost === void 0) { runInHost = false; }
return evalFunc(unevaledValue.startsWith("return")
? unevaledValue + "\n"
: "return function(){'use strict'; " + unevaledValue + "\n}()", args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost }, isAsync);
: "return ".concat(isAsync ? "async " : "", "function(){'use strict'; ").concat(unevaledValue, "\n}()"), args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost }, isAsync);
});
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion client/packages/openblocks-core/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ function evalFunction(unevaledValue, context, methods, isAsync) {
if (runInHost === void 0) { runInHost = false; }
return evalFunc(unevaledValue.startsWith("return")
? unevaledValue + "\n"
: "return function(){'use strict'; " + unevaledValue + "\n}()", args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost }, isAsync);
: "return ".concat(isAsync ? "async " : "", "function(){'use strict'; ").concat(unevaledValue, "\n}()"), args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost }, isAsync);
});
}
catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function evalFunction(
evalFunc(
unevaledValue.startsWith("return")
? unevaledValue + "\n"
: "return function(){'use strict'; " + unevaledValue + "\n}()",
: `return ${isAsync ? "async " : ""}function(){'use strict'; ${unevaledValue}\n}()`,
args ? { ...context, ...args } : context,
methods,
{ disableLimit: runInHost },
Expand Down
2 changes: 1 addition & 1 deletion client/packages/openblocks/src/constants/queryConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type DatasourceType =

export type ResourceType = DatasourceType | "js" | "libraryQuery" | "view";

export const QueryMap: Record<ResourceType, MultiCompConstructor> = {
export const QueryMap = {
js: JSQuery,
mysql: SQLQuery,
restApi: HttpQuery,
Expand Down

0 comments on commit bcc2dc4

Please sign in to comment.