(template: string)
| 1 | const RegexVarchar = /^varchar\((\d+)\)$/; |
| 2 | |
| 3 | export function parseVarchar(template: string): number { |
| 4 | const match = RegexVarchar.exec(template); |
| 5 | if (!match) throw new Error("Failed to match varchar(n)"); |
| 6 | return Number(match[1]); |
| 7 | } |
| 8 | |
| 9 | export function ident(s: string, identation = 2): string { |
| 10 | const tab = " ".repeat(identation); |
no test coverage detected