Skip to content

Commit

Permalink
feat: support negative infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
zuixinwang committed Jun 8, 2023
1 parent 3968b6c commit c9afb16
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function destr (value: any, options: Options = {}): any {
if (_lval === "null") { return null; }
if (_lval === "nan") { return Number.NaN; }
if (_lval === "infinity") { return Number.POSITIVE_INFINITY; }
if (_lval === "-infinity") { return Number.NEGATIVE_INFINITY; }
if (_lval === "undefined") { return undefined; }

if (!JsonSigRx.test(value)) {
Expand Down

0 comments on commit c9afb16

Please sign in to comment.