(segment: string)
| 14 | } |
| 15 | |
| 16 | function sanitizeProjectSegment(segment: string): string { |
| 17 | const sanitized = segment |
| 18 | .trim() |
| 19 | .replace(/[^A-Za-z0-9._-]+/g, "-") |
| 20 | .replace(/-+/g, "-") |
| 21 | .replace(/^-|-$/g, ""); |
| 22 | return sanitized.length > 0 ? sanitized : "project"; |
| 23 | } |
| 24 | |
| 25 | function hashText(input: string): string { |
| 26 | return crypto.createHash("sha256").update(input).digest("hex").slice(0, 12); |
no outgoing calls
no test coverage detected