Skip to content

Commit

Permalink
fix(util-dynamodb): perform global interface check in NativeAttribute…
Browse files Browse the repository at this point in the history
…Binary union (#6261)
  • Loading branch information
kuhe authored Jul 9, 2024
1 parent 630d429 commit e116b4c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/util-dynamodb/src/models.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -44,19 +42,17 @@ declare global {
interface File {}
}

type Unavailable = never;
type BlobDefined = Exact<Blob, {}> extends true ? false : true;
type BlobOptionalType = BlobDefined extends true ? Blob : Unavailable;
type IfDefined<T> = {} extends T ? never : T;

/**
* @public
*/
export type NativeAttributeBinary =
| ArrayBuffer
| BlobOptionalType
| Buffer
| IfDefined<Blob>
| IfDefined<Buffer>
| DataView
| File
| IfDefined<File>
| Int8Array
| Uint8Array
| Uint8ClampedArray
Expand Down

0 comments on commit e116b4c

Please sign in to comment.