MCPcopy Create free account
hub / github.com/electric-sql/electric / gitDiff

Function gitDiff

scripts/check-changeset.mjs:85–93  ·  view source on GitHub ↗
(base, filter)

Source from the content-addressed store, hash-verified

83)
84
85function gitDiff(base, filter) {
86 const out = execSync(`git diff --name-only ${filter} ${base}...HEAD`, {
87 encoding: `utf8`,
88 })
89 return out
90 .split(`\n`)
91 .map((s) => s.trim())
92 .filter(Boolean)
93}
94
95function globToRegex(g) {
96 const escaped = g.replace(/[.+^${}()|[\]\\]/g, `\\$&`).replace(/\*/g, `.*`)

Callers 1

Calls 2

filterMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected