Skip to content

Commit

Permalink
fix: simplify type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Mar 18, 2024
1 parent 23a2993 commit 79e4545
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/expander.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ export function createContext(options) {
}

switch (typeof object) {
case "undefined":
case "boolean":
case "number":
case "bigint":
case "function":
return object;
}

if (
object === true ||
object === false ||
object === undefined ||
object === null ||
object instanceof Number ||
object instanceof Date
Expand Down

0 comments on commit 79e4545

Please sign in to comment.