From 9253922e375ad79c74c0a937086535ab59b715f7 Mon Sep 17 00:00:00 2001 From: Mickael Jeanroy Date: Sat, 9 Mar 2024 18:30:13 +0100 Subject: [PATCH] refactor: remove usage of _.isNil --- src/license-plugin.js | 2 +- src/schema-validator.js | 2 +- src/schema-validators.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/license-plugin.js b/src/license-plugin.js index f3ccd30e..684c94ed 100644 --- a/src/license-plugin.js +++ b/src/license-plugin.js @@ -372,7 +372,7 @@ class LicensePlugin { * @private */ _readBanner(banner) { - if (_.isNil(banner)) { + if (banner == null) { return null; } diff --git a/src/schema-validator.js b/src/schema-validator.js index 44bb1762..3981bd50 100644 --- a/src/schema-validator.js +++ b/src/schema-validator.js @@ -69,7 +69,7 @@ function validateObject(obj, schema, current) { const errors = []; _.forEach(obj, (value, k) => { - if (_.isNil(value)) { + if (value == null) { return; } diff --git a/src/schema-validators.js b/src/schema-validators.js index 63991fa9..346ed57e 100644 --- a/src/schema-validators.js +++ b/src/schema-validators.js @@ -71,7 +71,7 @@ function isNumber(value) { * @return {boolean} `true` if `value` is `null` or `undefined`, `false` otherwise. */ function isNil(value) { - return _.isNil(value); + return value == null; } /**