bare-script 3.7.3 → 3.7.4

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.
Files changed (2) hide show
  1. package/lib/model.js +3 -10
  2. package/package.json +1 -1
package/lib/model.js CHANGED
@@ -500,16 +500,9 @@ export function lintScript(script) {
500
500
 
501
501
  // Helper to format static analysis warnings
502
502
  function lintScriptWarning(warnings, script, statement, message) {
503
- let warning;
504
- if (script && statement) {
505
- const [statementKey] = Object.keys(statement);
506
- const scriptName = script.scriptName ?? '';
507
- const lineno = statement[statementKey].lineNumber ?? '';
508
- warning = (scriptName || lineno) ? `${scriptName}:${lineno}: ${message}` : message;
509
- } else {
510
- warning = message;
511
- }
512
- warnings.push(warning);
503
+ const scriptName = script.scriptName ?? '';
504
+ const lineno = (statement !== null ? (statement[Object.keys(statement)[0]].lineNumber ?? 1) : 1);
505
+ warnings.push(`${scriptName}:${lineno}: ${message}`);
513
506
  }
514
507
 
515
508
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.7.3",
4
+ "version": "3.7.4",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",