@mitre/inspec-objects 0.0.20 → 0.0.23
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/utilities/update.js +8 -2
- package/package-lock.json +2 -2
- package/package.json +1 -1
package/lib/utilities/update.js
CHANGED
|
@@ -39,9 +39,15 @@ function getExistingDescribeFromControl(control) {
|
|
|
39
39
|
let existingDescribeBlock = '';
|
|
40
40
|
let currentQuoteEscape = '';
|
|
41
41
|
let inQuoteBlock = false;
|
|
42
|
-
|
|
42
|
+
let inMetadataValueOverride = false;
|
|
43
|
+
const splitLines = control.code.split('\n');
|
|
44
|
+
splitLines.forEach((line, lineIndex) => {
|
|
45
|
+
// Special case - Multi-line arrayed metadata value
|
|
46
|
+
if (knownInSpecKeywords.indexOf(splitLines[lineIndex - 1].trim().split(' ')[0]) !== -1 && splitLines[lineIndex - 1].trim().split(' ')[1].startsWith('[')) {
|
|
47
|
+
inMetadataValueOverride = true;
|
|
48
|
+
}
|
|
43
49
|
const wordSplit = line.trim().split(' ');
|
|
44
|
-
if (!inQuoteBlock) {
|
|
50
|
+
if (!inQuoteBlock && !inMetadataValueOverride) {
|
|
45
51
|
// Get the number of spaces at the beggining of the current line
|
|
46
52
|
const spaces = line.substring(0, line.indexOf(wordSplit[0])).length;
|
|
47
53
|
if (spaces >= 2) {
|
package/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mitre/inspec-objects",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@mitre/inspec-objects",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.23",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@types/flat": "^5.0.2",
|