Skip to content

Commit

Permalink
[Refactor] avoid an expensive check, for primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 2, 2024
1 parent dc7e142 commit 59f1a42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (hasSymbols) {
if (typeof value === 'symbol') {
return true;
}
if ($toString(value) !== '[object Symbol]') {
if (!value || typeof value !== 'object' || $toString(value) !== '[object Symbol]') {
return false;
}
try {
Expand Down

0 comments on commit 59f1a42

Please sign in to comment.