From 46da38a1ab7c80ba66d7f25119309220ecf8cbfa Mon Sep 17 00:00:00 2001 From: dhmw <50012533+dhmw@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:06:49 +0100 Subject: [PATCH] remove strict null checking bypassing attribute and prop transforms --- src/mapper/mapper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapper/mapper.ts b/src/mapper/mapper.ts index 3c6e4017a..4ba156d09 100644 --- a/src/mapper/mapper.ts +++ b/src/mapper/mapper.ts @@ -63,7 +63,7 @@ export function toDb(item: T, modelConstructor?: ModelConstructor): Attrib let attributeValue: Attribute | undefined | null - if (propertyValue === undefined || propertyValue === null) { + if (propertyValue === undefined) { // noop ignore because we can't map it } else { /* @@ -274,7 +274,7 @@ export function fromDb(attributeMap: Attributes, modelConstructor?: ModelC modelValue = fromDbOne(attributeValue) } - if (modelValue !== null && modelValue !== undefined) { + if (modelValue !== undefined) { Reflect.set(model, propertyMetadata ? propertyMetadata.name : attributeName, modelValue) } })