@aws-amplify/storage
Version:
Storage category of aws-amplify
17 lines (15 loc) • 606 B
JavaScript
;
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.readFile = void 0;
/**
* Server-side `readFile` implementation using `Blob.arrayBuffer()`.
*
* `Blob` (and `File`, which extends `Blob`) expose `arrayBuffer()` in
* Node.js 18+ — this is the canonical way to read blob contents on the
* server without relying on browser-only `FileReader`.
*/
const readFile = blob => blob.arrayBuffer();
exports.readFile = readFile;
//# sourceMappingURL=readFile.js.map