12 lines
214 B
TypeScript
12 lines
214 B
TypeScript
import { getPathname } from "./getPathname"
|
|
|
|
export async function appendSlugToPathname(slug?: string) {
|
|
const pathname = await getPathname()
|
|
|
|
if (!slug) {
|
|
return null
|
|
}
|
|
|
|
return `${pathname}/${slug}`
|
|
}
|