next.js / packages /next /src /server /normalizers /prefixing-normalizer.ts
AbdulElahGwaith's picture
Upload folder using huggingface_hub
b91e262 verified
import path from '../../shared/lib/isomorphic/path'
import type { Normalizer } from './normalizer'
export class PrefixingNormalizer implements Normalizer {
private readonly prefix: string
constructor(...prefixes: ReadonlyArray<string>) {
this.prefix = path.posix.join(...prefixes)
}
public normalize(pathname: string): string {
return path.posix.join(this.prefix, pathname)
}
}