@mitre/inspec-objects 0.0.27 → 0.0.28

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.
@@ -41,6 +41,7 @@ function getExistingDescribeFromControl(control) {
41
41
  let inQuoteBlock = false;
42
42
  let inMetadataValueOverride = false;
43
43
  let indentedMetadataOverride = false;
44
+ let inDescribeBlock = false;
44
45
  let mostSpacesSeen = 0;
45
46
  control.code.split('\n').forEach((line) => {
46
47
  const wordSplit = line.trim().split(' ');
@@ -52,11 +53,16 @@ function getExistingDescribeFromControl(control) {
52
53
  mostSpacesSeen = spaces;
53
54
  indentedMetadataOverride = false;
54
55
  }
55
- if (!inQuoteBlock && !inMetadataValueOverride && !indentedMetadataOverride) {
56
+ if (control.id === 'SV-204392') {
57
+ console.log(line);
58
+ console.log(inDescribeBlock);
59
+ }
60
+ if ((!inQuoteBlock && !inMetadataValueOverride && !indentedMetadataOverride) || inDescribeBlock) {
56
61
  // Get the number of spaces at the beggining of the current line
57
62
  if (spaces >= 2) {
58
63
  const firstWord = wordSplit[0];
59
- if (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) === -1 || (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) !== -1 && spaces > 2)) {
64
+ if (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) === -1 || (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) !== -1 && spaces > 2) || inDescribeBlock) {
65
+ inDescribeBlock = true;
60
66
  existingDescribeBlock += line + '\n';
61
67
  }
62
68
  }
@@ -82,10 +88,6 @@ function getExistingDescribeFromControl(control) {
82
88
  }
83
89
  });
84
90
  });
85
- if (control.id === 'SV-204392') {
86
- console.log(line);
87
- console.log(inQuoteBlock);
88
- }
89
91
  });
90
92
  return existingDescribeBlock;
91
93
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitre/inspec-objects",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Typescript objects for normalizing between InSpec profiles and XCCDF benchmarks",
5
5
  "main": "lib/index.js",
6
6
  "publishConfig": {
Binary file