Improve infer type (#7137)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

* Improve  infer type

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

* Fix

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

---------

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-11-08 21:54:28 +05:00 committed by GitHub
parent 5487e3bd7b
commit 16de0dd75b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,6 +307,12 @@ export function inferType (val: any): string {
} }
} }
if (typeof val === 'object') { if (typeof val === 'object') {
if (val == null) {
return ''
}
if (val instanceof Date) {
return '::text'
}
return '::jsonb' return '::jsonb'
} }
return '' return ''