Page MenuHomeDevCentral

ucfirst.js
No OneTemporary

ucfirst.js

/**
* Handlebars helper to capitalize.
*
* @param {string} str - The string to capitalize the first character
* @example
* {{ucfirst foo}}
* @returns string The string capitalized
*/
module.exports = function (str) {
if (str && typeof str === "string") {
return str.charAt(0).toUpperCase() + str.slice(1);
}
console.warn("helpers: ucfirst called with a non string parameter.");
return '';
}

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 9, 01:42 (4 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3601633
Default Alt Text
ucfirst.js (423 B)

Event Timeline