Comparing version 0.0.66 to 0.0.67
{ | ||
"name": "webdetta", | ||
"version": "0.0.66", | ||
"version": "0.0.67", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -7,3 +7,3 @@ import { processCall } from '../rpc/proto.js'; | ||
export const parseFn = val => { | ||
const { args, defaults, body, isArrow } = parser.parse(val); | ||
const { args, defaults, body, isArrow, isAsync } = parser.parse(val); | ||
if (isArrow) throw new Error('Arrow functions are not allowed.'); | ||
@@ -13,3 +13,3 @@ const args_ = args | ||
.join(', '); | ||
return { args: args_, body }; | ||
return { args: args_, body, isAsync }; | ||
} | ||
@@ -16,0 +16,0 @@ |
@@ -7,4 +7,7 @@ import { validateSdkEntry } from './defs.js'; | ||
if (typeof obj == 'function') { | ||
const { args, body } = parseFn(obj); | ||
return `function (${args}) {var ${vars.join(',')};${body.trim()}}`; | ||
const { args, body, isAsync } = parseFn(obj); | ||
return ( | ||
`${isAsync ? 'async' : ''} function (${args})` + | ||
`{var ${vars.join(',')};${body.trim()}}` | ||
); | ||
} | ||
@@ -11,0 +14,0 @@ if (Array.isArray(obj)) |
31581
928