mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
Check null for props serialization (#3657)
* Check null for props serialization * Add changeset
This commit is contained in:
parent
e67171252c
commit
7d4699b8f9
2 changed files with 6 additions and 1 deletions
5
.changeset/honest-schools-worry.md
Normal file
5
.changeset/honest-schools-worry.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Check null for props serialization
|
|
@ -48,7 +48,7 @@ function convertToSerializedForm(value: any): [ValueOf<typeof PROP_TYPE>, any] {
|
||||||
return [PROP_TYPE.JSON, JSON.stringify(serializeArray(value))];
|
return [PROP_TYPE.JSON, JSON.stringify(serializeArray(value))];
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (typeof value === 'object') {
|
if (value !== null && typeof value === 'object') {
|
||||||
return [PROP_TYPE.Value, serializeObject(value)];
|
return [PROP_TYPE.Value, serializeObject(value)];
|
||||||
} else {
|
} else {
|
||||||
return [PROP_TYPE.Value, value];
|
return [PROP_TYPE.Value, value];
|
||||||
|
|
Loading…
Add table
Reference in a new issue