Files
twenty/packages/twenty-sdk/src/cli/utilities/build/functions/function-paths.ts
T
2026-01-21 16:18:54 +01:00

15 lines
437 B
TypeScript

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