mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(files) read
This commit is contained in:
parent
aea9ad99e3
commit
df634234e0
1 changed files with 6 additions and 5 deletions
|
|
@ -6,10 +6,11 @@
|
|||
Util = require('../util');
|
||||
|
||||
object.read = function(files, options, callback) {
|
||||
var done = [],
|
||||
errors,
|
||||
readFiles = {},
|
||||
doneFunc = function (name, error, data) {
|
||||
var errors,
|
||||
done = [],
|
||||
noOptions = Util.isFunction(options),
|
||||
readFiles = {},
|
||||
doneFunc = function (name, error, data) {
|
||||
done.pop();
|
||||
|
||||
if (!error)
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
Util.exec(callback, errors, readFiles);
|
||||
};
|
||||
|
||||
if (Util.isFunction(options)) {
|
||||
if (noOptions) {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue