(routePath: string, baseDir: string, ext = '')
| 109 | * @returns |
| 110 | */ |
| 111 | export function getFilepath(routePath: string, baseDir: string, ext = '') { |
| 112 | if (routePath.startsWith('/')) { |
| 113 | routePath = routePath.substring(1); |
| 114 | } |
| 115 | const filename = routePath.replaceAll('/:', '@').split('/').join('-'); |
| 116 | if (!baseDir.endsWith('/')) { |
| 117 | baseDir = `${baseDir}/`; |
| 118 | } |
| 119 | return `${baseDir}${filename}${ext}`; |
| 120 | } |
| 121 | |
| 122 | export function getPrivilegeCode(appName: string, routePath: string) { |
| 123 | return `${appName}@${routePath.replaceAll('/', '%')}`; |
no outgoing calls
no test coverage detected