{"size": 1742, "ext": "js", "max_stars_repo_path": "coderill.library-v1.0.0.js", "max_stars_repo_name": "bjayanta/JS-Library", "max_stars_repo_stars_event_min_datetime": "2017-02-28T11:13:59.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-24T09:45:03.000Z", "max_issues_repo_path": "coderill.library-v1.0.0.js", "max_issues_repo_name": "bjayanta/JS-Library", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "coderill.library-v1.0.0.js", "max_forks_repo_name": "bjayanta/JS-Library", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.595959596, "max_line_length": 109, "alphanum_fraction": 0.6446613088}
/** 
 * Coderill Javascript Library v1.0.0
 * 
 * Author: Coderill
 * URI: http://coderill.com
 * Created at: 2017, February 28
 * Updated at: 2017, February 28
 * Version: 1.0.0
 * License: MIT
 * 
 * Description: This is a open source software. Released under the MIT license. Copyright 2015-2016 Coderill.
 */




/**
 * usages: ucwords(string)
 * Returns a string with the first character of each word
 * It takes 1 parameter of string
 * 
 */
function ucwords(str) {
    txt = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
        return letter.toUpperCase();
    });

    return txt;
}







/**
 * usages: ucfirst(string)
 * Returns a string with the first character of given string
 * It takes 1 parameter of string
 * 
 */
function ucfirst(str) {
    var f = str.charAt(0).toUpperCase();
    return f + str.substr(1);
}







/**
 * usages: ucSentence(string)
 * Returns a string with the first character of each sentence of given string
 * It takes 1 parameter of string
 * 
 */
function ucSentence(str) {
    return str.replace(/.+?[\.\?\!](\s|$)/g, function (txt) {
        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
}








/**
 * usages: strTrim(string)
 * Strip whitespace from the beginning and end of a string
 * It takes 1 parameter of string
 * 
 * NB: if browser not support tream() method
 */
function strTrim(str) {
    return str.replace(/^\s+|\s+$/gm, '');
}







/**
 * usages: strReplace(search, replace, string)
 * Replace all occurrences of the search string with the replacement string
 * It takes 3 parameteres of string
 * 
 */
function strReplace(search, replace, str) {
    var txt = str.replace(/^\s+|\s+$/gm, '');
    return txt.split(search).join(replace);
}