Transform JSON into AWS SNS message attributes format. See 1, 2
$ yarn add @shelf/aws-sns-message-attributes
const {transformMessageAttributes} = require('@shelf/aws-sns-message-attributes');
transformMessageAttributes({
string: 'hello',
array: ['hello', 'world'],
number: 1,
bool: true,
});
/*
{
string: {DataType: 'String', StringValue: 'hello'},
array: {DataType: 'String.Array', StringValue: '["hello","world"]'},
number: {DataType: 'Number', StringValue: 1},
bool: {DataType: 'String', StringValue: 'true'},
}
*/
Note: This library does not support binary values
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
MIT © Shelf