123456789101112131415161718192021 |
-
- var clean = require('to-no-case')
-
- /**
- * Export.
- */
-
- module.exports = toSpaceCase
-
- /**
- * Convert a `string` to space case.
- *
- * @param {String} string
- * @return {String}
- */
-
- function toSpaceCase(string) {
- return clean(string).replace(/[\W_]+(.|$)/g, function (matches, match) {
- return match ? ' ' + match : ''
- }).trim()
- }
|