(path: string)
| 28 | const FENCES: Readonly<Record<string, string>> = { py: 'python', pyi: 'python', ts: 'typescript', tsx: 'typescript', js: 'javascript', mjs: 'javascript', jsx: 'javascript', |
| 29 | go: 'go', rs: 'rust', java: 'java', c: 'c', h: 'c', cc: 'cpp', cpp: 'cpp', hpp: 'cpp', rb: 'ruby', sh: 'bash', kt: 'kotlin', cs: 'csharp', php: 'php', swift: 'swift' }; |
| 30 | const extension = (path: string) => (path.split('/').pop() ?? path).replace(/-tpl$/, '').split('.').slice(1).pop()?.toLowerCase() ?? ''; |
| 31 | const indentOf = (line: string) => line.length - line.trimStart().length; |
| 32 | const bounded = (line: string) => line.length > LINE ? `${line.slice(0, LINE - 1)}…` : line; |
| 33 | const escape = (name: string) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); |
no outgoing calls
no test coverage detected