fix realtype not returning undefined for empty string

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2019-12-06 16:25:11 +01:00
parent dbe53cb3f9
commit fc6fcd4569
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -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
}