diff --git a/lib/build.js b/lib/build.js index ac590436..04d65509 100644 --- a/lib/build.js +++ b/lib/build.js @@ -20,14 +20,12 @@ function haveBabelrc(functionsDir) { return ( fs.existsSync(path.join(cwd, ".babelrc")) || - functionsDir.split("/").reduce((foundBabelrc, dir) => { - if (foundBabelrc) return foundBabelrc; - + functionsDir.split("/").some(dir => { const indexOf = functionsDir.indexOf(dir); const dirToSearch = functionsDir.substr(0, indexOf); return fs.existsSync(path.join(cwd, dirToSearch, ".babelrc")); - }, false) + }) ); }