Skip to content

Commit 96e6d50

Browse files
committed
handle null when value should be string
1 parent e9dc0d9 commit 96e6d50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ function $asBoolean (bool) {
135135
function $asString (str) {
136136
if (str instanceof Date) {
137137
return '"' + str.toISOString() + '"'
138+
} else if (str === null) {
139+
return '""'
138140
} else if (str instanceof RegExp) {
139141
str = str.source
140142
} else if (typeof str !== 'string') {

0 commit comments

Comments
 (0)