"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.flattenMessageAttributes = void 0;
const flattenMessageAttributes = (record) => Object.keys(record.messageAttributes)
    .map((key) => {
    if (record.messageAttributes[key] && record.messageAttributes[key].stringValue) {
        return [key, record.messageAttributes[key].stringValue];
    }
    return [key, undefined];
})
    .reduce((acc, next) => {
    if (!next)
        return acc;
    const [key, value] = next;
    acc[key] = value;
    return acc;
}, {});
exports.flattenMessageAttributes = flattenMessageAttributes;
//# sourceMappingURL=sqs.js.map