easyappointments/assets/js/utils/string.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-01-11 12:51:10 +03:00
/* ----------------------------------------------------------------------------
2022-01-18 15:05:42 +03:00
* Easy!Appointments - Online Appointment Scheduler
2022-01-11 12:51:10 +03:00
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) Alex Tselegidis
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
* @link https://easyappointments.org
* @since v1.5.0
* ---------------------------------------------------------------------------- */
/**
* Strings utility.
*
* This module implements the functionality of strings.
*/
2022-01-11 12:51:10 +03:00
window.App.Utils.String = (function () {
/**
* Upper case the first letter of the provided string.
*
* Old Name: GeneralFunctions.upperCaseFirstLetter
*
* @param {String} value
*
* @returns {string}
*/
2022-01-11 12:51:10 +03:00
function upperCaseFirstLetter(value) {
return value.charAt(0).toUpperCase() + value.slice(1);
}
/**
* Escape HTML content with the use of jQuery.
*
* Old Name: GeneralFunctions.escapeHtml
*
* @param {String} content
*
* @return {String}
*/
function escapeHtml(content) {
return $('<div/>').text(content).html();
}
2022-01-11 12:51:10 +03:00
return {
upperCaseFirstLetter,
escapeHtml,
2022-01-11 12:51:10 +03:00
};
})();