UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

18 lines (15 loc) 538 B
import { Buffer } from 'buffer'; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 /** * Client-side `toBase64` implementation for React Native: uses the `buffer` * polyfill. */ const toBase64 = input => { if (typeof input === 'string') { return Buffer.from(input, 'utf-8').toString('base64'); } return Buffer.from(input.buffer, input.byteOffset, input.byteLength).toString('base64'); }; export { toBase64 }; //# sourceMappingURL=toBase64.native.mjs.map