datasquirel/dist/package-shared/utils/db/schema/grab-target-table-schema-index.js
Benjamin Toby 7e8bb37c09 Updates
2025-07-05 14:59:30 +01:00

12 lines
453 B
JavaScript

export default function grabTargetTableSchemaIndex({ tables, tableName, tableSchema, childTableSchema, }) {
if (!tables)
return undefined;
const targetTableIndex = tables.findIndex((tbl) => (tableName && tableName == tbl.tableName) ||
(tableSchema &&
tableSchema.tableName &&
tableSchema.tableName == tbl.tableName));
if (targetTableIndex < 0)
return undefined;
return targetTableIndex;
}