From e116b4c2388d60586acf6210bc1c3a10b932d6df Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 9 Jul 2024 16:43:01 -0400 Subject: [PATCH] fix(util-dynamodb): perform global interface check in NativeAttributeBinary union (#6261) --- packages/util-dynamodb/src/models.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/util-dynamodb/src/models.ts b/packages/util-dynamodb/src/models.ts index b61953da7fc2..00e9b1caa0fb 100644 --- a/packages/util-dynamodb/src/models.ts +++ b/packages/util-dynamodb/src/models.ts @@ -1,5 +1,3 @@ -import type { Exact } from "@smithy/types"; - /** * A interface recognizable as a numeric value that stores the underlying number * as a string. @@ -44,19 +42,17 @@ declare global { interface File {} } -type Unavailable = never; -type BlobDefined = Exact extends true ? false : true; -type BlobOptionalType = BlobDefined extends true ? Blob : Unavailable; +type IfDefined = {} extends T ? never : T; /** * @public */ export type NativeAttributeBinary = | ArrayBuffer - | BlobOptionalType - | Buffer + | IfDefined + | IfDefined | DataView - | File + | IfDefined | Int8Array | Uint8Array | Uint8ClampedArray