Skip to content

Commit 6e3fd13

Browse files
committed
fix: scan .ts/.tsx in scanDynamic in example copy
1 parent d9286f4 commit 6e3fd13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/examples/claude-code-hooks/pre-commit-checks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ try {
127127
function scanDynamic(dir) {
128128
for (const ent of fs.readdirSync(dir, { withFileTypes: true })) {
129129
if (ent.isDirectory()) { scanDynamic(path.join(dir, ent.name)); continue; }
130-
if (!ent.name.endsWith('.js')) continue;
130+
if (!/\.(js|ts|tsx)$/.test(ent.name)) continue;
131131
try {
132132
const src = fs.readFileSync(path.join(dir, ent.name), 'utf8');
133133
for (const m of src.matchAll(/const\s*\{([^}]+)\}\s*=\s*(?:await\s+)?import\s*\(['"]/gs)) {

0 commit comments

Comments
 (0)