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.

13 lines
333 B

  1. /* global _ */
  2. /* eslint-disable no-unused-vars */
  3. function makeSafePath (rawPath) {
  4. let rawParts = _.split(_.trim(rawPath), '/')
  5. rawParts = _.map(rawParts, (r) => {
  6. return _.kebabCase(_.deburr(_.trim(r)))
  7. })
  8. return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r) }), '/')
  9. }
  10. /* eslint-enable no-unused-vars */