UNPKG

394 BJavaScriptView Raw
1/**
2 * Convert string into path case.
3 * Join punctuation with slash.
4 * @memberof module:stringcase/lib
5 * @function pathcase
6 * @param {string} str - String to convert.
7 * @returns {string} Path cased string.
8 */
9
10'use strict'
11
12const snakecase = require('./snakecase')
13
14/** @lends pathcase */
15function pathcase (str) {
16 return snakecase(str).replace(/_/g, '/')
17}
18
19module.exports = pathcase;