-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(packages): re-export from migrated packages (#4929)
- Loading branch information
Showing
580 changed files
with
556 additions
and
28,503 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
/** | ||
* This implementation was added as Node.js didn't support AbortController prior to 15.x | ||
* Use native implementation in browsers or Node.js \>=15.4.0. | ||
* | ||
* @deprecated Use standard implementations in [Browsers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [Node.js](https://nodejs.org/docs/latest/api/globals.html#class-abortcontroller) | ||
* @packageDocumentation | ||
*/ | ||
export * from "./AbortController"; | ||
export * from "./AbortSignal"; | ||
export * from "@smithy/abort-controller"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1 @@ | ||
import { fromBase64 } from "@aws-sdk/util-base64"; | ||
/** | ||
* @internal | ||
*/ | ||
export function blobReader( | ||
blob: Blob, | ||
onChunk: (chunk: Uint8Array) => void, | ||
chunkSize: number = 1024 * 1024 | ||
): Promise<void> { | ||
return new Promise((resolve, reject) => { | ||
const fileReader = new FileReader(); | ||
|
||
fileReader.onerror = reject; | ||
fileReader.onabort = reject; | ||
|
||
const size = blob.size; | ||
let totalBytesRead = 0; | ||
|
||
const read = () => { | ||
if (totalBytesRead >= size) { | ||
resolve(); | ||
return; | ||
} | ||
fileReader.readAsDataURL(blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize))); | ||
}; | ||
|
||
fileReader.onload = (event) => { | ||
const result = (event.target as any).result; | ||
// reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL | ||
// response from readAsDataURL is always prepended with "data:*/*;base64," | ||
const dataOffset = result.indexOf(",") + 1; | ||
const data = result.substring(dataOffset); | ||
const decoded = fromBase64(data); | ||
onChunk(decoded); | ||
totalBytesRead += decoded.byteLength; | ||
// read the next block | ||
read(); | ||
}; | ||
|
||
// kick off the read | ||
read(); | ||
}); | ||
} | ||
export * from "@smithy/chunked-blob-reader-native"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export function blobReader( | ||
blob: Blob, | ||
onChunk: (chunk: Uint8Array) => void, | ||
chunkSize: number = 1024 * 1024 | ||
): Promise<void> { | ||
return new Promise((resolve, reject) => { | ||
const fileReader = new FileReader(); | ||
|
||
fileReader.addEventListener("error", reject); | ||
fileReader.addEventListener("abort", reject); | ||
|
||
const size = blob.size; | ||
let totalBytesRead = 0; | ||
|
||
function read() { | ||
if (totalBytesRead >= size) { | ||
resolve(); | ||
return; | ||
} | ||
fileReader.readAsArrayBuffer(blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize))); | ||
} | ||
|
||
fileReader.addEventListener("load", (event) => { | ||
const result = <ArrayBuffer>(event.target as any).result; | ||
onChunk(new Uint8Array(result)); | ||
totalBytesRead += result.byteLength; | ||
// read the next block | ||
read(); | ||
}); | ||
|
||
// kick off the read | ||
read(); | ||
}); | ||
} | ||
export * from "@smithy/chunked-blob-reader"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.