mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(util) getStrBigFirst: pStr -> str
This commit is contained in:
parent
6b79a5a976
commit
15614cb953
1 changed files with 5 additions and 7 deletions
12
lib/util.js
12
lib/util.js
|
|
@ -289,14 +289,12 @@
|
|||
|
||||
};
|
||||
|
||||
this.getStrBigFirst = function(pStr) {
|
||||
var ret;
|
||||
this.getStrBigFirst = function(str) {
|
||||
var isStr = Util.isString(str),
|
||||
ret = str;
|
||||
|
||||
if (Util.isString(pStr) && pStr.length > 0)
|
||||
ret = pStr[0].toUpperCase() +
|
||||
pStr.substring(1);
|
||||
else
|
||||
ret = pStr;
|
||||
if (isStr && str.length)
|
||||
ret = str[0].toUpperCase() + str.substring(1);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue