17 lines
385 B
TypeScript
17 lines
385 B
TypeScript
import { DSQL_TableSchemaType } from "../../../types";
|
|
|
|
type Params = {
|
|
tables: DSQL_TableSchemaType[];
|
|
tableName?: string;
|
|
};
|
|
|
|
export default function grabTargetTableSchema({
|
|
tables,
|
|
tableName,
|
|
}: Params): DSQL_TableSchemaType | undefined {
|
|
const targetTable = tables.find(
|
|
(tbl) => tableName && tableName == tbl.tableName
|
|
);
|
|
return targetTable;
|
|
}
|