Remove joinPaths function (#26833)
Extract from https://github.com/go-gitea/gitea/pull/25940. `assetUrlPrefix` is guaranteed to not contain trailing slashes, making this function unneeded.
This commit is contained in:
parent
19a1e1b20e
commit
c35b16a9a4
3 changed files with 2 additions and 53 deletions
|
@ -11,16 +11,6 @@ export function extname(path = '') {
|
|||
return ext || '';
|
||||
}
|
||||
|
||||
// join a list of path segments with slashes, ensuring no double slashes
|
||||
export function joinPaths(...parts) {
|
||||
let str = '';
|
||||
for (const part of parts) {
|
||||
if (!part) continue;
|
||||
str = !str ? part : `${str.replace(/\/$/, '')}/${part.replace(/^\//, '')}`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// test whether a variable is an object
|
||||
export function isObject(obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object Object]';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue