scancscode 1.0.25 → 1.0.27
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/dist/LiteralCollector.js
CHANGED
|
@@ -91,6 +91,12 @@ class LiteralCollector {
|
|
|
91
91
|
filterLiterals(literals) {
|
|
92
92
|
let literalsSet = new Set(literals);
|
|
93
93
|
literalsSet.delete("");
|
|
94
|
+
for (let literal of literals) {
|
|
95
|
+
let match = literal.match(/^[\da-zA-Z!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+$/m);
|
|
96
|
+
if (match != null) {
|
|
97
|
+
literalsSet.delete(literal);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
94
100
|
literals.length = 0;
|
|
95
101
|
literals.push(...literalsSet);
|
|
96
102
|
}
|
package/dist/TableScanner.js
CHANGED
|
@@ -38,7 +38,7 @@ const fs = __importStar(require("fs"));
|
|
|
38
38
|
const glob_1 = require("glob");
|
|
39
39
|
class TableScanner {
|
|
40
40
|
parseTrStrFields(content) {
|
|
41
|
-
let m = content.match(/\/\/ NeedTranslateFields\: \[([a-zA-Z_,\s]*)\]$/m);
|
|
41
|
+
let m = content.match(/\/\/ NeedTranslateFields\: \[([a-zA-Z_,\s\d]*)\]$/m);
|
|
42
42
|
if (m != null) {
|
|
43
43
|
let wordsContent = m[1];
|
|
44
44
|
let words = wordsContent.split(", ");
|
|
@@ -63,7 +63,8 @@ class TableScanner {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
scanTableLiterals(csFullPath, literals, verbose) {
|
|
66
|
-
|
|
66
|
+
// csFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/GameConfigs/Main/RefinerTable-RefinerEventTable.cs";
|
|
67
|
+
let jsonFullPath = csFullPath.replace("/Main/", "/Auto/").replace(/\.cs$/, ".json");
|
|
67
68
|
if (fs.existsSync(jsonFullPath) && fs.existsSync(csFullPath)) {
|
|
68
69
|
let csContent = fs.readFileSync(csFullPath, "utf-8");
|
|
69
70
|
let trstrFields = this.parseTrStrFields(csContent);
|
package/package.json
CHANGED
package/src/LiteralCollector.ts
CHANGED
|
@@ -65,6 +65,12 @@ export class LiteralCollector {
|
|
|
65
65
|
filterLiterals(literals: string[]) {
|
|
66
66
|
let literalsSet = new Set(literals);
|
|
67
67
|
literalsSet.delete("");
|
|
68
|
+
for (let literal of literals) {
|
|
69
|
+
let match = literal.match(/^[\da-zA-Z!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+$/m);
|
|
70
|
+
if (match != null) {
|
|
71
|
+
literalsSet.delete(literal)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
68
74
|
literals.length = 0;
|
|
69
75
|
literals.push(...literalsSet);
|
|
70
76
|
}
|
package/src/TableScanner.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { glob } from "glob";
|
|
|
4
4
|
|
|
5
5
|
export class TableScanner {
|
|
6
6
|
parseTrStrFields(content: string) {
|
|
7
|
-
let m = content.match(/\/\/ NeedTranslateFields\: \[([a-zA-Z_,\s]*)\]$/m);
|
|
7
|
+
let m = content.match(/\/\/ NeedTranslateFields\: \[([a-zA-Z_,\s\d]*)\]$/m);
|
|
8
8
|
if (m != null) {
|
|
9
9
|
let wordsContent = m[1];
|
|
10
10
|
let words = wordsContent.split(", ");
|
|
@@ -27,7 +27,8 @@ export class TableScanner {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
scanTableLiterals(csFullPath: string, literals: string[], verbose: boolean) {
|
|
30
|
-
|
|
30
|
+
// csFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/GameConfigs/Main/RefinerTable-RefinerEventTable.cs";
|
|
31
|
+
let jsonFullPath = csFullPath.replace("/Main/", "/Auto/").replace(/\.cs$/, ".json");
|
|
31
32
|
if (fs.existsSync(jsonFullPath) && fs.existsSync(csFullPath)) {
|
|
32
33
|
let csContent = fs.readFileSync(csFullPath, "utf-8");
|
|
33
34
|
let trstrFields = this.parseTrStrFields(csContent);
|