We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 448a77d commit 5be5732Copy full SHA for 5be5732
src/index.ts
@@ -44,6 +44,9 @@ export default function destr<T = unknown>(
44
if (_lval === "false") {
45
return false as T;
46
}
47
+ if (_lval === "undefined") {
48
+ return undefined as T;
49
+ }
50
if (_lval === "null") {
51
// eslint-disable-next-line unicorn/no-null
52
return null as T;
@@ -57,9 +60,6 @@ export default function destr<T = unknown>(
57
60
if (_lval === "-infinity") {
58
61
return Number.NEGATIVE_INFINITY as T;
59
62
- if (_lval === "undefined") {
- return undefined as T;
- }
63
64
if (!JsonSigRx.test(value)) {
65
if (options.strict) {
0 commit comments