Be more lax on the detection of field name.
This commit is contained in:
@ -80,11 +80,12 @@ export function readFieldNameUsage(params: {
|
|||||||
for (const filePath of filePaths) {
|
for (const filePath of filePaths) {
|
||||||
const rawSourceFile = fs.readFileSync(filePath).toString("utf8");
|
const rawSourceFile = fs.readFileSync(filePath).toString("utf8");
|
||||||
|
|
||||||
|
if (!rawSourceFile.includes("messagesPerField")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fieldNames.push(
|
fieldNames.push(
|
||||||
...Array.from(
|
...Array.from(rawSourceFile.matchAll(/(?:(?:printIfExists)|(?:existsError)|(?:get)|(?:exists))\(["']([^"']+)["']/g), m => m[1])
|
||||||
rawSourceFile.matchAll(/messagesPerField\.(?:(?:printIfExists)|(?:existsError)|(?:get)|(?:exists))\(["']([^"']+)["']/g),
|
|
||||||
m => m[1]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user