MCPcopy Create free account
hub / github.com/NetEase/tango / getFilepath

Function getFilepath

packages/core/src/helpers/string.ts:111–120  ·  view source on GitHub ↗
(routePath: string, baseDir: string, ext = '')

Source from the content-addressed store, hash-verified

109 * @returns
110 */
111export 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
122export function getPrivilegeCode(appName: string, routePath: string) {
123 return `${appName}@${routePath.replaceAll('/', '%')}`;

Callers 4

addViewPageMethod · 0.90
copyViewPageMethod · 0.90
removeStoreModuleMethod · 0.90
helpers.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected