git-subtree-dir: services/pascal-editor git-subtree-split: 312064e6e8122f958d2961e28ea85ad8b9db40c5
11 lines
368 B
TypeScript
11 lines
368 B
TypeScript
const configuredBasePath = process.env.NEXT_PUBLIC_PASCAL_BASE_PATH?.trim() ?? ''
|
|
|
|
export const PASCAL_BASE_PATH = configuredBasePath
|
|
? `/${configuredBasePath.replace(/^\/+|\/+$/g, '')}`
|
|
: ''
|
|
|
|
export function withPascalBasePath(pathname: string): string {
|
|
const path = pathname.startsWith('/') ? pathname : `/${pathname}`
|
|
return `${PASCAL_BASE_PATH}${path}`
|
|
}
|