From 462abb4fb917eb01240485f51dd1050042be09be Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sat, 26 Jan 2019 16:41:23 +0100 Subject: [PATCH] refactor: use .isEmpty to express the intent in a clearer way Co-Authored-By: honzajavorek --- lib/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse.js b/lib/parse.js index d9573ee..475f0de 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -39,7 +39,7 @@ Falling back to API Blueprint by default. } else if (err) { // Turning Fury error object into standard JavaScript error nativeError = new Error(err.message); - } else if (apiElements && apiElements.errors.length) { + } else if (apiElements && !apiElements.errors.isEmpty) { nativeError = new Error('Parser finished with errors'); }