@mitre/inspec-objects 0.0.17 → 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 +22 -8
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/lib/utilities/CciNistMappingData.d.ts +0 -5100
- package/lib/utilities/CciNistMappingData.js +0 -5103
- package/out.json +0 -107055
package/lib/utilities/update.js
CHANGED
|
@@ -37,17 +37,10 @@ function projectValuesOntoExistingObj(dst, src, currentPath = '') {
|
|
|
37
37
|
function getExistingDescribeFromControl(control) {
|
|
38
38
|
if (control.code) {
|
|
39
39
|
let existingDescribeBlock = '';
|
|
40
|
+
let currentQuoteEscape = '';
|
|
40
41
|
let inQuoteBlock = false;
|
|
41
42
|
control.code.split('\n').forEach((line) => {
|
|
42
43
|
const wordSplit = line.trim().split(' ');
|
|
43
|
-
wordSplit.forEach((word, index) => {
|
|
44
|
-
const charSplit = word.split('');
|
|
45
|
-
charSplit.forEach((char, index) => {
|
|
46
|
-
if (char === '"' && charSplit[index - 1] !== '\\') {
|
|
47
|
-
inQuoteBlock = !inQuoteBlock;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
44
|
if (!inQuoteBlock) {
|
|
52
45
|
// Get the number of spaces at the beggining of the current line
|
|
53
46
|
const spaces = line.substring(0, line.indexOf(wordSplit[0])).length;
|
|
@@ -58,6 +51,27 @@ function getExistingDescribeFromControl(control) {
|
|
|
58
51
|
}
|
|
59
52
|
}
|
|
60
53
|
}
|
|
54
|
+
wordSplit.forEach((word, index) => {
|
|
55
|
+
const charSplit = word.split('');
|
|
56
|
+
charSplit.forEach((char, index) => {
|
|
57
|
+
if (char === '"' && charSplit[index - 1] !== '\\') {
|
|
58
|
+
if (!currentQuoteEscape) {
|
|
59
|
+
currentQuoteEscape = '"';
|
|
60
|
+
}
|
|
61
|
+
if (currentQuoteEscape === '"') {
|
|
62
|
+
inQuoteBlock = !inQuoteBlock;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (char === "'" && charSplit[index - 1] !== '\\') {
|
|
66
|
+
if (!currentQuoteEscape) {
|
|
67
|
+
currentQuoteEscape = "'";
|
|
68
|
+
}
|
|
69
|
+
if (currentQuoteEscape === "'") {
|
|
70
|
+
inQuoteBlock = !inQuoteBlock;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
61
75
|
});
|
|
62
76
|
return existingDescribeBlock;
|
|
63
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",
|