Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(util-dynamodb): perform global interface check in NativeAttributeBinary union #6261

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading