mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-22 10:52:16 +00:00
fix realtype not returning undefined for empty string
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
dbe53cb3f9
commit
fc6fcd4569
@ -57,7 +57,7 @@ export function strToNum(str: string): number | string {
|
||||
|
||||
export function realType(el: any): string|number|boolean|undefined {
|
||||
// If el is `null` or `undefined`
|
||||
if ((typeof el === "object" && el === null) || typeof el === "undefined") return undefined
|
||||
if ((typeof el === "object" && el === null) || el === "" || typeof el === "undefined") return undefined
|
||||
if (typeof el === "object" && el.hasOwnProperty("id")) {
|
||||
el = el.id
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user