Skip to content

Commit

Permalink
Fix plugin config checks letting arrays through
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 28, 2024
1 parent 2351cfc commit 77b7943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/plugins/plugin-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 77b7943

Please sign in to comment.