renovate/lib/workers/repository/result.js
Rhys Arkins ecdcd9df4f
feat: refactor dependency extraction (#1912)
Rewrite of dependency extraction, particularly for npm. Paves way for easier addition of new package managers.

Closes #1882
2018-05-09 08:03:59 +02:00

37 lines
715 B
JavaScript

module.exports = {
processResult,
};
function processResult(config, result) {
let res = result;
const disabledStatuses = [
'archived',
'blocked',
'disabled',
'forbidden',
'fork',
'no-package-files',
'not-found',
'renamed',
'uninitiated',
];
const errorStatuses = [
'config-validation',
'error',
'unknown-error',
'not-found',
];
let status;
// istanbul ignore next
if (disabledStatuses.includes(res)) {
status = 'disabled';
} else if (errorStatuses.includes(res)) {
status = 'error';
} else if (config.repoIsOnboarded) {
status = 'enabled';
} else {
status = 'onboarding';
res = 'done';
}
return { res, status };
}