Skip to content

Commit

Permalink
Simplify publish isAllowPublic
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Nov 24, 2023
1 parent 67d6616 commit eb3e4d2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,9 @@ function hasRecps (content) {
}

function isAllowPublic (input) {
if (typeof input !== 'object') return false
if (typeof get(input, ['content', 'type']) !== 'string') return false
if (get(input, ['options', 'allowPublic']) !== true) return false

return true
return get(input, ['options', 'allowPublic']) === true
}

function isAllowPublic2 (input) {
return input.allowPublic === true
if (input.allowPublic !== true) return false

return true
}

0 comments on commit eb3e4d2

Please sign in to comment.