@neovici/cosmoz-utils 5.14.1 → 5.15.0

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.
@@ -0,0 +1,3 @@
1
+ export declare const ucfirst: (text: string) => string;
2
+ export declare const lcfirst: (text: string) => string;
3
+ export declare const capitalize: (text: string) => string;
package/dist/string.js ADDED
@@ -0,0 +1,7 @@
1
+ export const ucfirst = (text) => text.charAt(0).toUpperCase() + text.slice(1);
2
+ export const lcfirst = (text) => text.charAt(0).toLowerCase() + text.slice(1);
3
+ export const capitalize = (text) => text
4
+ ?.trim()
5
+ .split(/\s+/u)
6
+ .map((w) => ucfirst(w))
7
+ .join(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.14.1",
3
+ "version": "5.15.0",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",
@@ -60,6 +60,7 @@
60
60
  "./money": "./dist/money.js",
61
61
  "./promise": "./dist/promise.js",
62
62
  "./object": "./dist/object.js",
63
+ "./string": "./dist/string.js",
63
64
  "./tag": "./dist/tag.js",
64
65
  "./template": "./dist/template.js",
65
66
  "./reduce": "./dist/reduce/index.js",