fix path generation
This commit is contained in:
parent
2081ab1326
commit
89f19e25f8
2 changed files with 8 additions and 1 deletions
6
src/utils/path.ts
Normal file
6
src/utils/path.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export default function path(...components: Array<string>){
|
||||
return '/' + components
|
||||
.map(component => component.trim().replace(/(^[\/]*|[\/]*$)/g, ''))
|
||||
.filter(component => component.length > 0)
|
||||
.join("/")
|
||||
}
|
||||
Loading…
Reference in a new issue