From 6d19c2c43868ae5ab9b5a40ae3a94723b292e002 Mon Sep 17 00:00:00 2001 From: Aloys Berger Date: Sun, 22 May 2022 13:29:10 +1000 Subject: [PATCH] fix(isprimitivevaluetype): cd '/Users/aloysberger/FOSS/data' node 'node_modules/.bin/jest' '/Users/aloysberger/FOSS/data/test/model/create.test.ts' -c '/Users/aloysberger/FOSS/data/test/jest.config.ts' -t 'supports nested nullable object' --runInBand re #203 --- src/utils/isModelValueType.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/isModelValueType.ts b/src/utils/isModelValueType.ts index 705ff035..1cb34f00 100644 --- a/src/utils/isModelValueType.ts +++ b/src/utils/isModelValueType.ts @@ -10,5 +10,9 @@ function isPrimitiveValueType(value: any): value is PrimitiveValueType { } export function isModelValueType(value: any): value is ModelValueType { - return isPrimitiveValueType(value) || Array.isArray(value) + return ( + isPrimitiveValueType(value) || + Array.isArray(value) || + typeof value === 'object' + ) }