UNPKG

398 BJavaScriptView Raw
1/**
2 * Convert string into path case.
3 * Join punctuation with space.
4 * @memberof module:stringcase/lib
5 * @function spacecase
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 spacecase */
15function spacecase (str) {
16 return snakecase(str).replace(/_/g, ' ')
17}
18
19module.exports = spacecase;