@cpmech/basic
Advanced tools
Comparing version 4.25.0 to 4.26.0
@@ -51,2 +51,5 @@ 'use strict'; | ||
/** camelize will return the camelized word BUT it needs a separator! | ||
* @remarks already camelized words will be destroyed: e.g. logoInc => logoinc | ||
*/ | ||
const camelize = (name, firstUpper = false, separator = '_') => { | ||
@@ -56,3 +59,3 @@ if (firstUpper) { | ||
.split(separator) | ||
.map(w => w.toLowerCase().replace(/./, m => m.toUpperCase())) | ||
.map((w) => w.toLowerCase().replace(/./, (m) => m.toUpperCase())) | ||
.join(''); | ||
@@ -64,3 +67,3 @@ } | ||
if (i > 0) { | ||
return w.toLowerCase().replace(/./, m => m.toUpperCase()); | ||
return w.toLowerCase().replace(/./, (m) => m.toUpperCase()); | ||
} | ||
@@ -67,0 +70,0 @@ return w.toLowerCase(); |
@@ -0,1 +1,4 @@ | ||
/** camelize will return the camelized word BUT it needs a separator! | ||
* @remarks already camelized words will be destroyed: e.g. logoInc => logoinc | ||
*/ | ||
export declare const camelize: (name: string, firstUpper?: boolean, separator?: string) => string; |
@@ -47,2 +47,5 @@ const filled = (entry) => { | ||
/** camelize will return the camelized word BUT it needs a separator! | ||
* @remarks already camelized words will be destroyed: e.g. logoInc => logoinc | ||
*/ | ||
const camelize = (name, firstUpper = false, separator = '_') => { | ||
@@ -52,3 +55,3 @@ if (firstUpper) { | ||
.split(separator) | ||
.map(w => w.toLowerCase().replace(/./, m => m.toUpperCase())) | ||
.map((w) => w.toLowerCase().replace(/./, (m) => m.toUpperCase())) | ||
.join(''); | ||
@@ -60,3 +63,3 @@ } | ||
if (i > 0) { | ||
return w.toLowerCase().replace(/./, m => m.toUpperCase()); | ||
return w.toLowerCase().replace(/./, (m) => m.toUpperCase()); | ||
} | ||
@@ -63,0 +66,0 @@ return w.toLowerCase(); |
{ | ||
"name": "@cpmech/basic", | ||
"version": "4.25.0", | ||
"version": "4.26.0", | ||
"license": "MIT", | ||
@@ -30,7 +30,7 @@ "author": { | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.28", | ||
"@types/node": "^14.14.31", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.2.1", | ||
"rollup": "^2.39.0", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"ts-jest": "^26.5.1", | ||
@@ -42,3 +42,3 @@ "ts-node": "^9.1.1", | ||
}, | ||
"gitHead": "70bd7e2ef350e18646480293f189f1a385205bee" | ||
"gitHead": "b7a907018cd8f17c833e1f01ccb96b83484083a8" | ||
} |
36049
896