Skip to content

Commit 4f89d5f

Browse files
authored
Handle null and undefined values
1 parent 40fb023 commit 4f89d5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const boolRe = /^true|false$/i;
1212
export const transformRawValue = (input) => {
1313
const value = input.trim();
1414

15+
if (value === 'null') return null
16+
if (value === 'undefined') return undefined
17+
1518
const numberMatch = value.match(numberOrLengthRe);
1619
if (numberMatch !== null) return Number(numberMatch[1]);
1720

0 commit comments

Comments
 (0)