Be more lax on the detection of field name.

This commit is contained in:
garronej 2023-06-19 00:49:40 +02:00
parent 4639e7ad2e
commit b182c43965

View File

@ -80,11 +80,12 @@ export function readFieldNameUsage(params: {
for (const filePath of filePaths) {
const rawSourceFile = fs.readFileSync(filePath).toString("utf8");
if (!rawSourceFile.includes("messagesPerField")) {
continue;
}
fieldNames.push(
...Array.from(
rawSourceFile.matchAll(/messagesPerField\.(?:(?:printIfExists)|(?:existsError)|(?:get)|(?:exists))\(["']([^"']+)["']/g),
m => m[1]
)
...Array.from(rawSourceFile.matchAll(/(?:(?:printIfExists)|(?:existsError)|(?:get)|(?:exists))\(["']([^"']+)["']/g), m => m[1])
);
}
}