Skip to content

Commit

Permalink
Removed Bluebird Promise.reduce from checker.js (#483)
Browse files Browse the repository at this point in the history
refs TryGhost/Ghost#14882

Co-authored-by: Princi Vershwal <[email protected]>
  • Loading branch information
vershwal and Princi Vershwal authored Aug 31, 2023
1 parent c63252a commit 6886c5f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/checker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const Promise = require('bluebird');
const _ = require('lodash');
const requireDir = require('require-dir');
const debug = require('@tryghost/debug')('checker');
Expand Down Expand Up @@ -50,12 +49,12 @@ const check = function checkAll(themePath, options = {}) {
// set the major version to check
theme.checkedVersion = versions[version].major;

return Promise.reduce(_.values(checks), async function (themeToCheck, checkFunction) {
return Promise.all(_.values(checks).map(async (checkFunction) => {
const now = Date.now();
const result = await checkFunction(themeToCheck, options, themePath);
const result = await checkFunction(theme, options, themePath);
debug(checkFunction.name, 'took', Date.now() - now, 'ms');
return result;
}, theme);
})).then(() => theme);
})
.catch((error) => {
throw new errors.ValidationError({
Expand Down

0 comments on commit 6886c5f

Please sign in to comment.