Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
XmiliaH committed Oct 20, 2021
2 parents d03f150 + 7505410 commit 3a21c36
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/contextify.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,15 @@ Decontextify.value = (value, traps, deepTraps, flags, mock) => {
case 'undefined':
return undefined;

default: // string, number, boolean, symbol
case 'string':
case 'number':
case 'boolean':
case 'symbol':
case 'bigint':
return value;

default: // new, unknown types can be dangerous
return null;
}
} catch (ex) {
// Never pass the handled exception through! This block can't throw an exception under normal conditions.
Expand Down Expand Up @@ -945,8 +952,15 @@ Contextify.value = (value, traps, deepTraps, flags, mock) => {
case 'undefined':
return undefined;

default: // string, number, boolean, symbol
case 'string':
case 'number':
case 'boolean':
case 'symbol':
case 'bigint':
return value;

default: // new, unknown types can be dangerous
return null;
}
} catch (ex) {
// Never pass the handled exception through! This block can't throw an exception under normal conditions.
Expand Down

0 comments on commit 3a21c36

Please # to comment.