Skip to content

Commit

Permalink
Normalize table names before exporting as types
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpf committed Feb 19, 2018
1 parent 61f2921 commit a642842
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export function generateExports (tableNameRaw: string, tableDefinition: TableDef
if (options.exposeConstraintInfo()) {
// If `--exposeConstraintInfo` flag is passed, simply rename <table>Meta to <table>
return `
export type ${tableName} = ${tableName}Meta
export type ${normalizeName(tableName, options)} = ${normalizeName(tableName, options)}Meta
`
}

// If no `--exposeConstraintInfo` flag is passed, transform the meta interfaces to simple interfaces
return `
export type ${tableName} = SimpleSchema<${tableName}Meta>
export type ${normalizeName(tableName, options)} = SimpleSchema<${normalizeName(tableName, options)}Meta>
`
}

0 comments on commit a642842

Please sign in to comment.