MCPcopy Create free account
hub / github.com/adobe/react-spectrum / checkFile

Function checkFile

packages/dev/s2-docs/scripts/validateS2DocsBuild.mjs:34–46  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

32}
33
34async function checkFile(filePath) {
35 const content = await readFile(filePath, 'utf-8');
36
37 // Count occurrences of the pattern
38 const matches = content.match(new RegExp(PATTERN.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'));
39 const count = matches ? matches.length : 0;
40
41 return {
42 filePath,
43 count,
44 hasDuplicate: count > 1
45 };
46}
47
48async function main() {
49 const targetDir = process.argv[2] || join(__dirname, '..', 'dist');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected