Skip to content

Commit

Permalink
Merge pull request #20 from AndyLeezard/fix/supa-db-type-declaration
Browse files Browse the repository at this point in the history
fix: supa-db-type-declaration
  • Loading branch information
psteinroe authored Feb 8, 2024
2 parents c85493f + b5c627c commit 16e06b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/transform-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ export const transformTypes = z
const enumNames: { name: string; formattedName: string }[] = [];

sourceFile.forEachChild((n) => {
if (ts.isInterfaceDeclaration(n) && n.name.text === 'Database') {
if (
ts.isTypeAliasDeclaration(n) &&
ts.isTypeLiteralNode(n.type) &&
n.name.text === 'Database'
) {
// Database
n.forEachChild((n) => {
n.type.members.forEach((n) => {
if (ts.isPropertySignature(n)) {
// Schema
const schemaName = getNodeName(n);
Expand Down

0 comments on commit 16e06b4

Please sign in to comment.