@osimatic/helpers-js 1.1.15 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/string.js +4 -0
package/package.json
CHANGED
package/string.js
CHANGED
|
@@ -115,6 +115,10 @@ String.prototype.ucwords = String.prototype.ucwords || function() {
|
|
|
115
115
|
String.prototype.capitalize = String.prototype.capitalize || function() {
|
|
116
116
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
|
117
117
|
}
|
|
118
|
+
String.prototype.acronym = String.prototype.acronym || function() {
|
|
119
|
+
return this.split(' ').map(word => word.charAt(0)).join('');
|
|
120
|
+
//return this.match(/\b(\w)/g).join('');
|
|
121
|
+
}
|
|
118
122
|
|
|
119
123
|
String.prototype.encodeForHtmlDataAttribute = String.prototype.encodeForHtmlDataAttribute || function() {
|
|
120
124
|
return this.replace(/\"/g, "'");
|