MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / parseShortStat

Function parseShortStat

desktop/project-git/commit-context.ts:20–28  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

18const shortStatDeletionsPattern = /(\d+)\s+deletions?\(-\)/
19
20function parseShortStat(output: string) {
21 const insertionsMatch = output.match(shortStatInsertionsPattern)
22 const deletionsMatch = output.match(shortStatDeletionsPattern)
23
24 return {
25 insertions: insertionsMatch ? Number.parseInt(insertionsMatch[1] ?? '0', 10) : 0,
26 deletions: deletionsMatch ? Number.parseInt(deletionsMatch[1] ?? '0', 10) : 0,
27 }
28}
29
30function countNonEmptyLines(output: string) {
31 return output

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected