@azure/data-tables
Version:
An isomorphic client library for the Azure Tables service.
27 lines • 831 B
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.base64Encode = base64Encode;
exports.base64Decode = base64Decode;
/**
* Encodes a byte array in base64 format.
* @param value - The Uint8Aray or string to encode
*/
function base64Encode(value) {
if (value instanceof Uint8Array) {
const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer);
return bufferValue.toString("base64");
}
else {
return Buffer.from(value).toString("base64");
}
}
/**
* Decodes a base64 string into a byte array.
* @param value - The base64 string to decode
*/
function base64Decode(value) {
return Buffer.from(value, "base64");
}
//# sourceMappingURL=bufferSerializer.js.map