Skip to content

Commit

Permalink
perf: return false instead undefined
Browse files Browse the repository at this point in the history
this avoid casting undefined into a boolean
  • Loading branch information
Kikobeats committed May 7, 2024
1 parent 68a7f4d commit 04c1453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const assertMetadata = metadata => {
assert(!isPlainObject(metadata[key]), 'ERR_METADATA_INVALID', () => [key])
if (metadata[key] === undefined) delete metadata[key]
})
return Object.keys(metadata).length ? metadata : undefined
return Object.keys(metadata).length ? metadata : false
}
}

Expand Down

0 comments on commit 04c1453

Please sign in to comment.