@mitre/inspec-objects 0.0.20 → 0.0.21
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 +13 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
package/lib/utilities/update.js
CHANGED
|
@@ -39,6 +39,7 @@ function getExistingDescribeFromControl(control) {
|
|
|
39
39
|
let existingDescribeBlock = '';
|
|
40
40
|
let currentQuoteEscape = '';
|
|
41
41
|
let inQuoteBlock = false;
|
|
42
|
+
let haveUsedSpecialCasingForArrays = false;
|
|
42
43
|
control.code.split('\n').forEach((line) => {
|
|
43
44
|
const wordSplit = line.trim().split(' ');
|
|
44
45
|
if (!inQuoteBlock) {
|
|
@@ -72,6 +73,18 @@ function getExistingDescribeFromControl(control) {
|
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
});
|
|
76
|
+
// Special casing for arrays split across multiple lines
|
|
77
|
+
if (line.endsWith(']')) {
|
|
78
|
+
if (line.trim().startsWith('"') || line.trim().startsWith("'")) {
|
|
79
|
+
inQuoteBlock = true;
|
|
80
|
+
haveUsedSpecialCasingForArrays = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (haveUsedSpecialCasingForArrays) {
|
|
85
|
+
inQuoteBlock = false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
75
88
|
});
|
|
76
89
|
return existingDescribeBlock;
|
|
77
90
|
}
|
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.21",
|
|
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.21",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@types/flat": "^5.0.2",
|