2017-02-10 01:24:28 +00:00
|
|
|
/* global _ */
|
|
|
|
/* eslint-disable no-unused-vars */
|
2016-08-30 02:19:47 +00:00
|
|
|
|
2017-02-09 01:52:37 +00:00
|
|
|
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) }), '/')
|
|
|
|
}
|
2017-02-10 01:24:28 +00:00
|
|
|
|
|
|
|
/* eslint-enable no-unused-vars */
|