@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/string.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
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, "'");