mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
245 B
11 lines
245 B
8 years ago
|
|
||
|
function makeSafePath(rawPath) {
|
||
|
|
||
|
let rawParts = _.split(_.trim(rawPath), '/');
|
||
|
rawParts = _.map(rawParts, (r) => {
|
||
|
return _.kebabCase(_.deburr(_.trim(r)));
|
||
|
});
|
||
|
|
||
|
return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r); }), '/');
|
||
|
|
||
|
}
|