MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / parseAuthor

Function parseAuthor

src/utils/parseAuthor.js:1–11  ·  view source on GitHub ↗
(author)

Source from the content-addressed store, hash-verified

1export function parseAuthor(author) {
2 const [, name, email, timestamp, offset] = author.match(
3 /^(.*) <(.*)> (.*) (.*)$/
4 )
5 return {
6 name,
7 email,
8 timestamp: Number(timestamp),
9 timezoneOffset: parseTimezoneOffset(offset),
10 }
11}
12
13// The amount of effort that went into crafting these cases to handle
14// -0 (just so we don't lose that information when parsing and reconstructing)

Callers 2

headersMethod · 0.90
parseHeadersMethod · 0.90

Calls 1

parseTimezoneOffsetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…