From 4e2762188442cedcc5261c38d329ff0f0ab724e7 Mon Sep 17 00:00:00 2001 From: denniswieczorek Date: Tue, 2 Apr 2024 12:11:43 -0400 Subject: [PATCH] Dataset.fromJs creates an empty Set if type is SET --- src/datatypes/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datatypes/common.ts b/src/datatypes/common.ts index adeb504d..d2cdb4b0 100644 --- a/src/datatypes/common.ts +++ b/src/datatypes/common.ts @@ -102,7 +102,7 @@ export function valueFromJS(v: any, typeOverride: string | null = null): any { if (v == null) { return null; } else if (Array.isArray(v)) { - if (v.length && typeof v[0] !== 'object') { + if ((v.length && typeof v[0] !== 'object') || String(typeOverride).indexOf('SET') === 0) { return Set.fromJS(v); } else { return Dataset.fromJS(v);