main
| 1 | import { compressName } from "@medusajs/framework/utils" |
| 2 | |
| 3 | export function normalizeTableName(name: string): string { |
| 4 | return compressName(name.toLowerCase(), 58).replace(/[^a-z0-9_]/g, "_") |
| 5 | } |
| 6 | |
| 7 | export function getPivotTableName(tableName: string) { |
| 8 | const compressedName = normalizeTableName(tableName) |
| 9 | return `cat_pivot_${compressedName}` |
| 10 | } |