@n3okill/utils
Version:
Many javascript helpers
18 lines • 797 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.titleCase = titleCase;
const detectEncoding_1 = require("./detectEncoding");
const toString_1 = require("./toString");
const titleCase_1 = require("../string/titleCase");
/**
* Converts a CamelCase name into space-separated words.
* For example, 'PostTag' will be converted to 'Post Tag'.
* @param name the Buffer to be converted
* @param ucwords whether to capitalize the first letter in each word
* @return Buffer with the resulting words
*/
function titleCase(name, ucwords = true) {
const encoding = (0, detectEncoding_1.detectEncoding)(name);
return Buffer.from((0, titleCase_1.titleCase)((0, toString_1.toString)(name, encoding), ucwords), encoding);
}
//# sourceMappingURL=titleCase.js.map
;