Function
exportFilename
(kind: 'flow' | 'map', label: string)
Source from the content-addressed store, hash-verified
| 967 | * adds one, because the same picture goes out as both `.svg` and `.png`. |
| 968 | */ |
| 969 | export function exportFilename(kind: 'flow' | 'map', label: string): string { |
| 970 | const slug = label |
| 971 | .toLowerCase() |
| 972 | .replace(/[^a-z0-9]+/g, '-') |
| 973 | .replace(/^-+|-+$/g, '') |
| 974 | .slice(0, 60) |
| 975 | .replace(/-+$/g, ''); |
| 976 | return `codegraph-${kind}${slug ? `-${slug}` : ''}`; |
| 977 | } |
| 978 | |
| 979 | export { CARD_WIDTH }; |
Tested by
no test coverage detected