@mitre/inspec-objects 0.0.19 → 0.0.20
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 +10 -10
- package/package-lock.json +2 -2
- package/package.json +1 -1
package/lib/utilities/update.js
CHANGED
|
@@ -41,6 +41,16 @@ function getExistingDescribeFromControl(control) {
|
|
|
41
41
|
let inQuoteBlock = false;
|
|
42
42
|
control.code.split('\n').forEach((line) => {
|
|
43
43
|
const wordSplit = line.trim().split(' ');
|
|
44
|
+
if (!inQuoteBlock) {
|
|
45
|
+
// Get the number of spaces at the beggining of the current line
|
|
46
|
+
const spaces = line.substring(0, line.indexOf(wordSplit[0])).length;
|
|
47
|
+
if (spaces >= 2) {
|
|
48
|
+
const firstWord = wordSplit[0];
|
|
49
|
+
if (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) === -1 || (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) !== -1 && spaces > 2)) {
|
|
50
|
+
existingDescribeBlock += line + '\n';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
44
54
|
wordSplit.forEach((word, index) => {
|
|
45
55
|
const charSplit = word.split('');
|
|
46
56
|
charSplit.forEach((char, index) => {
|
|
@@ -62,16 +72,6 @@ function getExistingDescribeFromControl(control) {
|
|
|
62
72
|
}
|
|
63
73
|
});
|
|
64
74
|
});
|
|
65
|
-
if (!inQuoteBlock) {
|
|
66
|
-
// Get the number of spaces at the beggining of the current line
|
|
67
|
-
const spaces = line.substring(0, line.indexOf(wordSplit[0])).length;
|
|
68
|
-
if (spaces >= 2) {
|
|
69
|
-
const firstWord = wordSplit[0];
|
|
70
|
-
if (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) === -1 || (knownInSpecKeywords.indexOf(firstWord.toLowerCase()) !== -1 && spaces > 2)) {
|
|
71
|
-
existingDescribeBlock += line + '\n';
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
75
|
});
|
|
76
76
|
return existingDescribeBlock;
|
|
77
77
|
}
|
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.20",
|
|
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.20",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@types/flat": "^5.0.2",
|