Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ORM.prototype.getIssues = function (options) {
options.page = options.page || DEFAULT.page;
options.limit = options.per_page || DEFAULT.limit;
var def = vow.defer();
ORM.models.issue.find().paginate(options).exec(function(err, models) {
err ? def.reject() : def.resolve(models);
});
return def.promise();
};
load: function (options) {
logger.debug('read file %s from yandex disk', options.path);
var def = vow.defer();
disk.readFile(options.path, 'utf8', function (err, content) {
if (err || !content) {
def.reject(err);
}
def.resolve(options.archive ? util.unzip(content) : content);
});
return def.promise();
},
load: function (options) {
logger.debug(util.format('load file from %s', options.path), module);
var def = vow.defer();
this.disk.readFile(options.path, 'utf8', function (err, content) {
(err || !content) ? def.reject(err) : def.resolve(content);
});
return def.promise();
},
getContent: function(options) {
var def = vow.defer(),
repository = options.repository,
git = repository.type === 'private' ? gitPrivate : gitPublic;
git.repos.getContent(repository, function(err, res) {
if (err || !res) {
def.reject({res: null, repo: repository});
}else {
def.resolve({res: res, repo: repository});
}
});
return def.promise();
}
};
run: function(modelPath) {
logger.info(MSG.INFO.START);
var def = vow.defer();
try {
def.resolve(require(modelPath).get());
logger.info(MSG.INFO.SUCCESS);
}catch(err) {
def.reject(err.message);
logger.error(MSG.ERROR);
}
return def.promise();
}
};