MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseVarchar

Function parseVarchar

packages/core/fumadb/src/utils/parse.ts:3–7  ·  view source on GitHub ↗
(template: string)

Source from the content-addressed store, hash-verified

1const RegexVarchar = /^varchar\((\d+)\)$/;
2
3export 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
9export function ident(s: string, identation = 2): string {
10 const tab = " ".repeat(identation);

Callers 3

getColumnTypeFunctionFunction · 0.90
generateTableFunction · 0.90
generateTableFunction · 0.90

Calls 1

execMethod · 0.80

Tested by

no test coverage detected