Skip to content

Commit

Permalink
Merge pull request #816 from tsengia/support-more-file-extensions
Browse files Browse the repository at this point in the history
Support .tsx and Svelte files
  • Loading branch information
samchon authored Sep 21, 2023
2 parents 3776b11 + 223d266 commit 7dc1c84
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/programmers/TypiaProgrammer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export namespace TypiaProgrammer {
project: string;
}

const is_supported_extension = (filename: string): boolean => {
return (
filename.endsWith(".ts") ||
filename.endsWith(".tsx") ||
filename.endsWith(".svelte")
);
};

export const build = async (
props: TypiaProgrammer.IProps,
): Promise<void> => {
Expand Down Expand Up @@ -156,8 +164,7 @@ export namespace TypiaProgrammer {
if (stat.isDirectory()) {
await gather(props)(container)(next)(path.join(to, file));
continue;
} else if (file.substring(file.length - 3) === ".ts")
container.push(next);
} else if (is_supported_extension(file)) container.push(next);
}
};
}

0 comments on commit 7dc1c84

Please sign in to comment.