mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
refactor(util) getExtension
This commit is contained in:
parent
a58c2931c4
commit
afc1c4ec84
1 changed files with 6 additions and 3 deletions
|
|
@ -870,12 +870,15 @@
|
|||
* @return Ext
|
||||
*/
|
||||
this.getExtension = function(name) {
|
||||
var ret, dot,
|
||||
isStr = Util.isString(name);
|
||||
var ret = '',
|
||||
dot,
|
||||
isStr = Util.isString(name);
|
||||
|
||||
if (isStr) {
|
||||
dot = name.lastIndexOf('.');
|
||||
ret = name.substr(dot);
|
||||
|
||||
if (~dot)
|
||||
ret = name.substr(dot);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue