cb4110e894

11 lines
322 B
TypeScript
11 lines
322 B
TypeScript
export const computeFunctionOutputPath = (handlerPath: string): string => {
|
|
const normalizedPath = handlerPath.replace(/\\/g, '/');
|
|
|
|
let relativePath = normalizedPath;
|
|
if (relativePath.startsWith('src/')) {
|
|
relativePath = relativePath.slice('src/'.length);
|
|
}
|
|
|
|
return relativePath.replace(/\.ts$/, '.js');
|
|
};
|