js-code-detector 0.0.30 → 0.0.31
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.
|
@@ -32,7 +32,7 @@ __export(AstFeatUtil_exports, {
|
|
|
32
32
|
default: () => AstFeatUtil
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(AstFeatUtil_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_lodash = require("lodash");
|
|
36
36
|
var import_sha1 = __toESM(require("crypto-js/sha1"));
|
|
37
37
|
var import_enc_base64 = __toESM(require("crypto-js/enc-base64"));
|
|
38
38
|
var import_featureLevel = require("../shared/featureLevel");
|
|
@@ -202,7 +202,7 @@ var AstFeatUtil = class {
|
|
|
202
202
|
let listOfCollection = listOfNodeInfo.map((e) => e.edgeNodeCollection);
|
|
203
203
|
for (let i = 1; i <= maxDepth; i++) {
|
|
204
204
|
const hashKeyList = listOfCollection.map((nodes) => nodes.map((node) => node._util.mapDepthDiffToHashKey.get(1)).filter(Boolean));
|
|
205
|
-
const commonHashKeyList = (0,
|
|
205
|
+
const commonHashKeyList = (0, import_lodash.intersection)(...hashKeyList);
|
|
206
206
|
listOfCollection = listOfCollection.map((nodes) => nodes.filter((node) => commonHashKeyList.includes(node._util.mapDepthDiffToHashKey.get(1))));
|
|
207
207
|
if (listOfCollection.every((collection) => collection.length > 0)) {
|
|
208
208
|
listOfCollection.forEach((col, index) => {
|
|
@@ -32,7 +32,7 @@ __export(Core_exports, {
|
|
|
32
32
|
default: () => Core
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Core_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_lodash = require("lodash");
|
|
36
36
|
var import_FileUtil = __toESM(require("./FileUtil"));
|
|
37
37
|
var import_AstFeatUtil = __toESM(require("./AstFeatUtil"));
|
|
38
38
|
var Core = class {
|
|
@@ -86,13 +86,13 @@ ${content}
|
|
|
86
86
|
const newList = listOfNodeInfo.map(({ rootNode, edgeNodeCollection }) => {
|
|
87
87
|
var _a;
|
|
88
88
|
const { filePath, startLine, endLine } = rootNode._util;
|
|
89
|
-
const linesNums = (0,
|
|
89
|
+
const linesNums = (0, import_lodash.range)(startLine, endLine + 1);
|
|
90
90
|
const edgeNodesLines = edgeNodeCollection.map((edgeNode) => {
|
|
91
91
|
const { startLine: itemStartLine, endLine: itemEndLine } = edgeNode._util;
|
|
92
92
|
if (itemStartLine === startLine || itemEndLine === endLine) {
|
|
93
93
|
return [];
|
|
94
94
|
}
|
|
95
|
-
return itemStartLine + 1 >= itemEndLine ? [] : (0,
|
|
95
|
+
return itemStartLine + 1 >= itemEndLine ? [] : (0, import_lodash.range)(itemStartLine + 1, itemEndLine);
|
|
96
96
|
}).flat();
|
|
97
97
|
const listOfRatedContent = [
|
|
98
98
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-code-detector",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/crypto-js": "^4.2.2",
|
|
32
|
-
"@types/lodash
|
|
32
|
+
"@types/lodash": "^4.17.20",
|
|
33
33
|
"@types/madge": "^5.0.3",
|
|
34
34
|
"father": "^4.6.3"
|
|
35
35
|
},
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"await-to-js": "^3.0.0",
|
|
41
41
|
"crypto-js": "^4.2.0",
|
|
42
42
|
"dayjs": "^1.11.13",
|
|
43
|
-
"lodash
|
|
43
|
+
"lodash": "^4.17.21",
|
|
44
44
|
"madge": "^8.0.0",
|
|
45
45
|
"vue-eslint-parser": "^10.2.0"
|
|
46
46
|
}
|