UNPKG

@cloud-copilot/iam-lens

Version:

Visibility in IAM in and across AWS accounts

21 lines 731 B
export function convertArrayBufferToString(buffer) { const view = new Uint8Array(buffer); return new TextDecoder().decode(view); } export function convertArrayBufferToObject(buffer) { if (!buffer || buffer.byteLength === 0) { return undefined; } const jsonString = convertArrayBufferToString(buffer); return JSON.parse(jsonString); } export function convertObjectToArrayBuffer(obj) { const jsonString = JSON.stringify(obj); const encoder = new TextEncoder(); const byteArray = encoder.encode(jsonString); const buffer = new SharedArrayBuffer(byteArray.length); const view = new Uint8Array(buffer); view.set(byteArray); return buffer; } //# sourceMappingURL=buffers.js.map