File size: 399 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
  }
}