mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-24 00:21:18 +00:00
refactor(util) getExtension
This commit is contained in:
parent
39d45c5894
commit
fbe1bf7f51
1 changed files with 7 additions and 6 deletions
13
lib/util.js
13
lib/util.js
|
|
@ -861,15 +861,16 @@
|
|||
* @param pFileName
|
||||
* @return Ext
|
||||
*/
|
||||
this.getExtension = function(pFileName) {
|
||||
var lRet, lDot;
|
||||
this.getExtension = function(name) {
|
||||
var ret, dot,
|
||||
isStr = Util.isString(name);
|
||||
|
||||
if ( Util.isString(pFileName) ) {
|
||||
lDot = pFileName.lastIndexOf('.');
|
||||
lRet = pFileName.substr(lDot);
|
||||
if (isStr) {
|
||||
dot = name.lastIndexOf('.');
|
||||
ret = name.substr(dot);
|
||||
}
|
||||
|
||||
return lRet;
|
||||
return ret;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue