From d14603c7786d155ccd0b4d8842ebb71a2c4f5e2c Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 11 Dec 2015 10:09:52 -0500 Subject: [PATCH] Use `some` instead. --- src/git-repository-async.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index a87c93973..2b006a509 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -365,9 +365,8 @@ export default class GitRepositoryAsync { // Returns a {Promise} which resolves to a {Boolean} that's true if the `path` // is modified. isPathModified (_path) { - return this._filterStatusesByPath(_path).then(statuses => { - return statuses.filter(status => status.isModified()).length > 0 - }) + return this._filterStatusesByPath(_path) + .then(statuses => statuses.some(status => status.isModified())) } // Public: Resolves true if the given path is new. @@ -377,9 +376,8 @@ export default class GitRepositoryAsync { // Returns a {Promise} which resolves to a {Boolean} that's true if the `path` // is new. isPathNew (_path) { - return this._filterStatusesByPath(_path).then(statuses => { - return statuses.filter(status => status.isNew()).length > 0 - }) + return this._filterStatusesByPath(_path) + .then(statuses => statuses.some(status => status.isNew())) } // Public: Is the given path ignored?