multicloud_rule_manager 1.1.13 → 1.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multicloud_rule_manager",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "CLI interna per retrieve/upload con token",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -75,13 +75,12 @@ export function validateRule(fileName, content) {
75
75
  }
76
76
 
77
77
  function hasWhenThenBlock(content, fileName) {
78
- // regex: quando compare 'when' seguito da {, e '} then {' con eventuali spazi
79
- const whenRegex = /when\s*\{/i;
80
- const thenRegex = /\}\s*then\s*\{/i;
78
+ const whenThenRegex = /when\s*{[\s\S]*?}\s*[\r\n\s]*then\s*{/i;
81
79
 
82
- if (!whenRegex.test(content) || !thenRegex.test(content)) {
80
+ if (!whenThenRegex.test(content)) {
83
81
  console.error(`❌ Il file ${fileName} deve contenere un blocco "when {} then {}"`);
84
82
  return false;
85
83
  }
84
+
86
85
  return true;
87
86
  }