summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/titleize/index.js
blob: ff0acfd3f7c79844c2d8daaf388b2acaf34b0efb (plain)
1
2
3
4
5
6
7
8
9
10
'use strict';
module.exports = function (str) {
	if (typeof str !== 'string') {
		throw new TypeError('Expected a string');
	}

	return str.toLowerCase().replace(/(?:^|\s|-)\S/g, function (m) {
		return m.toUpperCase();
	});
};