fix: fix a bug which script not support makeTransferable json which data include null

for example: {a: null}
This commit is contained in:
moonrailgun 2024-01-03 03:34:43 +08:00
parent b0444e31e7
commit 824bd89ede

View File

@ -9,10 +9,12 @@ function isTransferable(data: any): data is ivm.Transferable {
return true;
}
if (data === null) {
return true;
}
if (
['null', 'undefined', 'string', 'number', 'boolean', 'function'].includes(
dataType
)
['undefined', 'string', 'number', 'boolean', 'function'].includes(dataType)
) {
return true;
}