Skip to content

Commit 6d6aa5b

Browse files
Validate user directories when generating player.d.ts (#232)
* Validate user directories when generating `player.d.ts` * Actually call `isDirectory` Co-authored-by: Samual Norman <me@samual.uk> --------- Co-authored-by: Samual Norman <me@samual.uk>
1 parent ea9322a commit 6d6aa5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generateTypeDeclaration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function generateTypeDeclaration(sourceDirectory: string, hackmudPa
1717
const allScripts: Record<string, string[]> = {}
1818
const allAnyScripts: Record<string, string[]> = {}
1919

20-
await Promise.all((await readDirectoryWithStats(sourceDirectory)).map(async ({ stats, name }) => {
20+
await Promise.all((await readDirectoryWithStats(sourceDirectory)).filter(({stats, name}) => !stats.isDirectory() || /^[a-z_][a-z\d_]{0,24}$/.test(name)).map(async ({ stats, name }) => {
2121
if (stats.isFile()) {
2222
if (name.endsWith(`.ts`)) {
2323
if (!name.endsWith(`.d.ts`))

0 commit comments

Comments
 (0)