datasquirel/dist/package-shared/utils/db/schema/grab-target-table-schema-index.js
2025-07-05 16:14:11 +01:00

15 lines
561 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = grabTargetTableSchemaIndex;
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;
}