MCPcopy
hub / github.com/creationix/js-git / decodePerson

Function decodePerson

lib/object-codec.js:214–225  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

212}
213
214function decodePerson(string) {
215 var match = string.match(/^([^<]*) <([^>]*)> ([^ ]*) (.*)$/);
216 if (!match) throw new Error("Improperly formatted person string");
217 return {
218 name: match[1],
219 email: match[2],
220 date: {
221 seconds: parseInt(match[3], 10),
222 offset: parseInt(match[4], 10) / 100 * -60
223 }
224 };
225}
226
227function deframe(buffer, decode) {
228 var space = indexOf(buffer, 0x20);

Callers 2

decodeCommitFunction · 0.85
decodeTagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected