From 548bb8d7f1da50543d553172cb6e2ed78a2a105e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 29 Oct 2014 05:23:29 -0400 Subject: [PATCH] feature(util) mv getStrBigFirst to CloudFunc --- lib/client.js | 4 ++-- lib/cloudfunc.js | 10 ++++++++++ lib/util.js | 10 ---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/client.js b/lib/client.js index e656dc42..2e21c1cc 100644 --- a/lib/client.js +++ b/lib/client.js @@ -83,7 +83,7 @@ var Util, DOM, CloudFunc, join; doBefore = params.dobefore; if (path && !name) { - name = Util.getStrBigFirst(path); + name = CloudFunc.getStrBigFirst(path); name = Util.rmStr(name, '.js'); slash = name.indexOf('/'); @@ -166,7 +166,7 @@ var Util, DOM, CloudFunc, join; if (path) { module = query[0]; module = Util.slice(module, 1).join(''); - module = Util.getStrBigFirst(module); + module = CloudFunc.getStrBigFirst(module); file = query[1]; current = DOM.getCurrentByName(file); diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index c2a3509c..7d04cb98 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -57,6 +57,16 @@ var Util; return str; }; + this.getStrBigFirst = function(str) { + var isStr = Util.type.string(str), + ret = str; + + if (isStr && str.length) + ret = str[0].toUpperCase() + str.substring(1); + + return ret; + }; + this.formatMsg = function(msg, name, status) { if (!status) status = 'ok'; diff --git a/lib/util.js b/lib/util.js index e599d123..713d7a19 100644 --- a/lib/util.js +++ b/lib/util.js @@ -225,16 +225,6 @@ }; - this.getStrBigFirst = function(str) { - var isStr = Util.type.string(str), - ret = str; - - if (isStr && str.length) - ret = str[0].toUpperCase() + str.substring(1); - - return ret; - }; - /** * function log pArg if it's not empty * @param pArg