MCPcopy Create free account
hub / github.com/cloudflare/computer / parseAuthorString

Function parseAuthorString

packages/computer/src/git/cli.ts:725–732  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

723}
724
725function parseAuthorString(s: string): { name: string; email: string } | undefined {
726 // `Name <email@host>` — the same shape `git -c user.email=...`
727 // and `--author` accept. Anything else is rejected; the CLI
728 // shouldn't silently drop the email half.
729 const m = /^(.+?)\s*<([^<>]+)>\s*$/.exec(s);
730 if (!m) return undefined;
731 return { name: m[1].trim(), email: m[2].trim() };
732}
733
734function firstLine(s: string): string {
735 const i = s.indexOf("\n");

Callers 1

runCommitFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected