16 lines · 407 B · TypeScript
RawDownload
const RegexVarchar = /^varchar\((\d+)\)$/; export function parseVarchar(template: string): number {  const match = RegexVarchar.exec(template);  if (!match) throw new Error("Failed to match varchar(n)");  return Number(match[1]);} export function ident(s: string, identation = 2): string {  const tab = " ".repeat(identation);   return s    .split("\n")    .map((v) => tab + v)    .join("\n");}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t