@stonyx/utils 0.2.3-beta.0 → 0.2.3-beta.1
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 +2 -2
- package/src/string.js +4 -0
package/package.json
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
"keywords": [
|
|
4
4
|
"stonyx-module"
|
|
5
5
|
],
|
|
6
|
-
"version": "0.2.3-beta.
|
|
6
|
+
"version": "0.2.3-beta.1",
|
|
7
7
|
"description": "Utils module for Stonyx Framework",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/abofs/stonyx-utils"
|
|
10
|
+
"url": "https://github.com/abofs/stonyx-utils.git"
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
package/src/string.js
CHANGED
|
@@ -23,6 +23,10 @@ export function kebabCaseToPascalCase(str) {
|
|
|
23
23
|
return kebabToCase(str, true);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export function camelCaseToKebabCase(str) {
|
|
27
|
+
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
export function generateRandomString(length=8) {
|
|
27
31
|
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
28
32
|
return Array(length).fill('').map(() => characters.charAt(Math.floor(Math.random() * characters.length))).join('');
|