bare-script 3.0.9 → 3.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/library.js CHANGED
@@ -1983,6 +1983,10 @@ function systemPartial(args) {
1983
1983
  throw new ValueArgsError('args', funcArgs);
1984
1984
  }
1985
1985
 
1986
+ if (func.constructor.name === 'AsyncFunction') {
1987
+ // eslint-disable-next-line require-await
1988
+ return async (argsExtra, options) => func([...funcArgs, ...argsExtra], options);
1989
+ }
1986
1990
  return (argsExtra, options) => func([...funcArgs, ...argsExtra], options);
1987
1991
  }
1988
1992
 
@@ -99,7 +99,8 @@ async function executeScriptHelperAsync(statements, options, locals) {
99
99
  // Function?
100
100
  } else if (statementKey === 'function') {
101
101
  if (statement.function.async) {
102
- globals[statement.function.name] = (args, fnOptions) => scriptFunctionAsync(statement.function, args, fnOptions);
102
+ // eslint-disable-next-line require-await
103
+ globals[statement.function.name] = async (args, fnOptions) => scriptFunctionAsync(statement.function, args, fnOptions);
103
104
  } else {
104
105
  globals[statement.function.name] = (args, fnOptions) => scriptFunction(statement.function, args, fnOptions);
105
106
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.0.9",
4
+ "version": "3.0.11",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "c8": "~9.1",
34
- "eslint": "~9.1",
34
+ "eslint": "~9.2",
35
35
  "jsdoc": "~4.0"
36
36
  }
37
37
  }