Files
site-profile/src/support/paths.ts
Alex Lebens b6dfc738f1
All checks were successful
renovate / renovate (push) Successful in 1m3s
test-build / build (push) Successful in 1m47s
feat: add weather widget
2026-02-10 21:42:04 -06:00

22 lines
539 B
TypeScript

import { join } from 'node:path';
function resolveFilePath(path: string) {
if (path.startsWith('/')) {
return resolveFilePathPublic(path);
}
return resolveFilePathInternal(path);
}
function resolveFilePathPublic(path: string) {
return join(process.cwd(), path);
}
function resolveFilePathInternal(path: string) {
const normalizePath = path.startsWith('@') ? path.replace('@', '') : path;
return join(process.cwd(), 'src/', normalizePath);
}
export { resolveFilePath, resolveFilePathPublic, resolveFilePathInternal };