From 77b794393a21b7616067ccb7da6646da3c70496a Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 30 Nov 2023 12:31:48 +0000 Subject: [PATCH] Fix plugin config checks letting arrays through --- lib/plugins/plugin-validator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plugins/plugin-validator.js b/lib/plugins/plugin-validator.js index 60e4758e39..2a392608d0 100644 --- a/lib/plugins/plugin-validator.js +++ b/lib/plugins/plugin-validator.js @@ -95,7 +95,7 @@ function validateMetaUrls (metaUrls) { return } - if (typeof metaUrls !== 'object') { + if (typeof metaUrls !== 'object' || Array.isArray(metaUrls)) { errors.push('The meta.urls must be an object if entered') return } @@ -124,7 +124,7 @@ function validateMetaUrls (metaUrls) { function validateMeta (meta) { const metaKeys = ['urls', 'description'] - if (typeof meta !== 'object') { + if (typeof meta !== 'object' || Array.isArray(meta)) { errors.push('The meta must be an object if entered') return } @@ -143,7 +143,7 @@ function validateMeta (meta) { } function validatePluginDependency (key, configEntry) { - if (typeof configEntry === 'string') { + if (typeof configEntry !== 'object' || Array.isArray(configEntry)) { return } // Can be a string, but if an object, the packageName must be a string