mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Clean code.
This commit is contained in:
parent
c20da80bda
commit
8d9a2f505f
1 changed files with 8 additions and 7 deletions
|
@ -27,16 +27,17 @@ modulejs.define('core/types', ['config', '_'], function (config, _) {
|
|||
|
||||
var slashidx = sequence.lastIndexOf('/');
|
||||
var name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence;
|
||||
var result;
|
||||
|
||||
_.each(regexps, function (regexp, type) {
|
||||
|
||||
for (var type in regexps) {
|
||||
if (regexps.hasOwnProperty(type)) {
|
||||
if (regexps[type].test(name)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
result = type;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return 'file';
|
||||
return result ? result : 'file';
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue