dphelper 0.2.27 → 0.2.28

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/init.js CHANGED
@@ -98,6 +98,7 @@
98
98
  require('./scripts/scrollCustom.js');
99
99
 
100
100
  // OTHER
101
+ require('./scripts/camelCase.js');
101
102
  require('./scripts/fontFit.js');
102
103
  require('./scripts/uuid.js');
103
104
  require('./scripts/noCache.js');
package/package.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "version": "0.2.27",
4
- "description": "Many utils for your projects",
3
+ "version": "0.2.28",
4
+ "description": "Manager | Dev Tools",
5
+
5
6
  "main": "index.js",
6
- "publishConfig": {},
7
- "scripts": {
8
- "test1": "echo \"Error: no test specified\" && exit 1",
9
- "test": "jest --silent --detectOpenHandles",
10
- "test-coverage": "jest --coverage --silent"
11
- },
7
+ "publishConfig": {},
8
+
12
9
  "targets": {
13
10
  "main": {
14
11
  "includeNodeModules": {
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ *
4
+ * camelCase / PascalCase
5
+ *
6
+ * Copyright (c) 2021, Dario Passariello.
7
+ * Licensed under the Apache-2.0 License.
8
+ */
9
+
10
+ /***********************************************************************/
11
+
12
+ window.dphelper.camelCase = {
13
+
14
+ // toSpace
15
+ toSpace: ( string ) => {
16
+ string
17
+ .replace(/([A-Z])/g, ' $1')
18
+ .replace(/^./, function(str){ return str.toUpperCase(); })
19
+ },
20
+
21
+ // toUnderscore
22
+ toUnderscore: ( string ) => {
23
+ string
24
+ .replace(/\.?([A-Z])/g, function (x,y){ return "_" + y.toLowerCase()})
25
+ .replace(/^_/, "");
26
+ },
27
+
28
+ };
29
+