mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-25 16:00:07 +00:00
15 lines
438 B
TypeScript
15 lines
438 B
TypeScript
export function isSqlFilePath(path: string): boolean {
|
|
return /\.sql$/i.test(path.trim());
|
|
}
|
|
|
|
export function sqlFileTitleFromPath(path: string): string {
|
|
const trimmed = path.trim();
|
|
const normalized = trimmed.replace(/\\/g, "/");
|
|
const name = normalized.split("/").filter(Boolean).pop();
|
|
return name || "script.sql";
|
|
}
|
|
|
|
export function externalSqlFilePaths(paths: string[]): string[] {
|
|
return paths.filter(isSqlFilePath);
|
|
}
|