(workspaceRoot: string)
| 20 | } |
| 21 | |
| 22 | function workspaceNameForRoot(workspaceRoot: string): string { |
| 23 | const rawName = basename(workspaceRoot) || 'workspace'; |
| 24 | const slug = rawName |
| 25 | .replace(/[^A-Za-z0-9._-]+/g, '-') |
| 26 | .replace(/^[.-]+|[.-]+$/g, '') |
| 27 | .slice(0, 64); |
| 28 | return slug || 'workspace'; |
| 29 | } |
| 30 | |
| 31 | export function shortWorkspaceHash(input: string): string { |
| 32 | return createHash('sha256').update(input).digest('hex').slice(0, 12); |
no outgoing calls
no test coverage detected