MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / sanitizeSnapshotName

Function sanitizeSnapshotName

packages/bumpy/src/core/snapshot.ts:38–48  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

36 * name like `feature/Foo_Bar` becomes `feature-foo-bar`.
37 */
38export function sanitizeSnapshotName(name: string): string {
39 const cleaned = name
40 .trim()
41 .toLowerCase()
42 .replace(/[^a-z0-9]+/g, '-')
43 .replace(/^-+|-+$/g, '');
44 if (!cleaned) {
45 throw new Error(`Invalid snapshot name "${name}" — must contain at least one alphanumeric character.`);
46 }
47 return cleaned;
48}
49
50/** Short (7-char) HEAD sha, or null outside a git repo */
51function shortHeadSha(rootDir: string): string | null {

Callers 2

snapshot.test.tsFile · 0.90
resolveSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…