{"_id":"dynamodb-data-types","_rev":"57-1669c91e783cb68be6daf11238439caf","name":"dynamodb-data-types","description":"A utility to help represent Amazon DynamoDB Data Types.","dist-tags":{"latest":"4.0.1","v4beta.0":"4.0.0-beta.0","v4beta.1":"4.0.0-beta.1","v4beta.2":"4.0.0-beta.2"},"versions":{"0.1.0":{"name":"dynamodb-data-types","version":"0.1.0","description":"Wrapper utility for Amazon DynamoDb data types.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.1.0","dist":{"shasum":"acb1d3db6bee4fb4201e9e596ed04d7be21cf5fb","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.1.0.tgz","integrity":"sha512-kvopjtiTLHw52xj0C4HOrKJzUgnG9aDeFib0iQceAVpggVoU+138NLaKnmgH5OeyYwFChZpLkVamjlxGceyZpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHA3NI7sHG718wNOv1pXT7K2rnzF+rtnklpSMZEpOAAIAiBpswrlcK2LK1b1KAwUi0PGC3d6ZqBdhEplAttp1WxFeg=="}]},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.1.1":{"name":"dynamodb-data-types","version":"0.1.1","description":"Wrapper utility for Amazon DynamoDb data types for use with AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.1.1","dist":{"shasum":"5044dc29a60b1a2307f872f838f402b8537b31a6","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.1.1.tgz","integrity":"sha512-Ch+2TwCNY/xwmMftTHIfM/lWD/AiCPh5UcWUVply/dPxQq3FpyroFFnUe1GWdRV5e1HlBGXDvrvDCL7hlIC1ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIxZ/G1OBN1aqSnDVhb4UF9YkdR2agRYV5PPeSEChlkAiBXzsyrJN0mBHW0n2ZUx/4bLQdY5iGgo/LBEwBUo6DkAQ=="}]},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.1.2":{"name":"dynamodb-data-types","version":"0.1.2","description":"Wrapper utility for Amazon DynamoDb data types for use with AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.1.2","dist":{"shasum":"052ed92e6f0128a25799129f4bcde0db7e02d7de","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.1.2.tgz","integrity":"sha512-E1SNRo0PamZrTQpZ8gXUsVWbQJQFmU7x033OUW6PcoAtB23Sme25w4YRdZU1qo7NT2ZMDrC3+sKSVk7vqSCUsg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHUMK/5+AJa+MnExOVRMMF9UeL4gteYORkliU1IP+mDwIhAMHsaJ1dCef1XBFIeHHVAtnfJ4dHpEi4TDrHdU72n7Jn"}]},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.0":{"name":"dynamodb-data-types","version":"0.2.0","description":"Wrapper utility for Amazon DynamoDb data types for use with AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.0","dist":{"shasum":"098f61aa78ac7d9dcfb2059615270a276d552056","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.0.tgz","integrity":"sha512-ws48twwST43Tqnp0ie1rusQDzir1BLzmngazDEOVDs6GW9LoQJf/H0tDdfoG4S/S6jggW8M1SKchWNnoPcxOIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5CAbrHbcxUmlt9xAjwcRsrqWZA/zGi9T3Slk4f/9slAiEA/XStW/455Lv/VlcmWNCnDtl2BQPG9G3lf5yEthK0vsM="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.1":{"name":"dynamodb-data-types","version":"0.2.1","description":"Wrapper utility for Amazon DynamoDb data types for use with AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.1","dist":{"shasum":"1f326fb2ae7decfaef521ce38abcf75d5808315d","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.1.tgz","integrity":"sha512-/+gjWAUB23Zr+ZSIZyLUOSUvNLIL/NUWykpDDT9rbskueZYrC0pmATdJ/pAV0gssKk4BeoiAIdZ+OEtm/7tLHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCk70IAkGnDMY26g1Gko3QuAeB7um2Qrp7ozXXe903EtwIhAK3g+fiiKcsBDIYjx4hifjMozZ7HdwsiVxMbEtmKl2+c"}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.2":{"name":"dynamodb-data-types","version":"0.2.2","description":"Wrapper utility for Amazon DynamoDb data types for use with AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.2","dist":{"shasum":"9b78d6a2e34ab9178a93ead6b4500c58d829d4f5","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.2.tgz","integrity":"sha512-iVEcVG3IrbIUGaPn9+OZd8oWda84cCTqO7t1rqbdfVdlso6FGtzqCZKPrwXpCzBg/UFIfrkRYZl7lhOtrwtGKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOf7b9y36MrTu0pIR8rTZ1CjZDcVrw00SHlGO6qJiDGAiAXOGSRhBLU2prKQL1tWepU1FAmb6+M4xz7Mc78JLeVKw=="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.4":{"name":"dynamodb-data-types","version":"0.2.4","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.4","dist":{"shasum":"7aa59aff18b7badc1af7f34e1d8ed0aff22535a8","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.4.tgz","integrity":"sha512-7lR5AvNiRf/EcVcUtP/LopGuIjMcHTuJRp/FD4spLie73v4UX+MfPwqdK/Cazpq414EtkinlDreVJyMR+7fpYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3pEKEvsDU7W/L9S5OzIj2ys9PWmXzBSTFiVL4sYZaTgIgdUFEt8aOQWGyjEISTbm9zQq5taNLeslxLCu5Hjx+PDI="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.5":{"name":"dynamodb-data-types","version":"0.2.5","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.5","dist":{"shasum":"74875835f344b2fdf7fe1dc678fa9807897b8c4d","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.5.tgz","integrity":"sha512-+OFTWaP5zEm8D4cboSooB0YcaU9npN4xu7RCqGwmz3u9IDl6Jtr6kWAm6wv5poXlnL1GSuIvN7YUrqEKcECOrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnXR0M20T+oAPwv4zayrXL7IxdKQWDmJEPC/4zee2hOAiEA0LbYtMyp6azHWztXISUTX8HyktSlCdS4+g198xkBSsU="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.6":{"name":"dynamodb-data-types","version":"0.2.6","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.6","dist":{"shasum":"28e16a27ad4427da326b5799f38b4573a26b13d2","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.6.tgz","integrity":"sha512-dkyfr1aw0VlgVpNN/rIMK3Ed+YNh7gKtSVgZRprq1w+cqFh+40oSykOYlghrn0KLQfF9rjP98wxe5VBsHyognA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMS9mZeqKmVfxYeSUeq47tK/kmZlH26knuq9seee1bVAiAm1SWzAPOJkq9MEFCxcwox9MdYe1VQbCvK3W/sGWZ3cg=="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"0.2.7":{"name":"dynamodb-data-types","version":"0.2.7","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"_id":"dynamodb-data-types@0.2.7","dist":{"shasum":"e96cc3bba64b11a30d2ea45022a7b32b6895de6b","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-0.2.7.tgz","integrity":"sha512-URkIwCiF2F9xjuGVGZuYrcLbEt6IJhAKRMlbESfz7f+3YIEI4wJxv6E8jQ6RIKOlq1aAClFtL1JhWthXYVq9tQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGg90Rh2/pMHpPSWTHOzbsQ1OHggTkdOj5b32Q9Mjd2wAiEAq1P0OkYol56FEBKt80y6lRKpKRx6u8R34cwaNDH29Ck="}]},"_from":"./","_npmVersion":"1.3.8","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"1.0.0":{"name":"dynamodb-data-types","version":"1.0.0","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"aws-sdk":"1.6.0","async":"0.2.9","lodash":"2.2.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"36b9b5c11d4aa21e343ee1f13f7066d906f7008d","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types","_id":"dynamodb-data-types@1.0.0","scripts":{},"_shasum":"6966a7442afdee940557270bbf0bc380717b1c9c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"dist":{"shasum":"6966a7442afdee940557270bbf0bc380717b1c9c","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-1.0.0.tgz","integrity":"sha512-DjYJADhfVGFrnxHl1N2sRA2nNnDWjqMmCCSAk6aC1JrNtOHfbkdrKSm31UrWL2oGV68Rn1Pd+3LjCl6lkUpGSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaMPpJWoOO/ltZOtL6tAHTntNTVg3uLqZmIgjmtVUFGQIhAJMZXc5xZTxoETAoYIZHAEOkaSWNX4v/dDaiN5hBTXXO"}]},"directories":{}},"2.0.0":{"name":"dynamodb-data-types","version":"2.0.0","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","lodash":"2.2.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"0671fa2791a92b3e5af6c307f1685926424ff367","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types","_id":"dynamodb-data-types@2.0.0","scripts":{},"_shasum":"f96d9fa84615758c9059c8385a7b822d7bce1a70","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"dist":{"shasum":"f96d9fa84615758c9059c8385a7b822d7bce1a70","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.0.0.tgz","integrity":"sha512-Xemks9Kz8Hhs/Zls/xx/u6pEqaoknRkMvLPdaZfIUl5EMqcmmEsURgVduP875VV2Y/2OyXSPfB6zwWZggKNNZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXxvIEQ+yNsbB4ONhKLqHOgJQXnxMcg/qGbs3JipDthwIhANWV65ZltunjawOywIUM/FF1g6xwEOUe26OWFT3PD1TC"}]},"directories":{}},"2.0.1":{"name":"dynamodb-data-types","version":"2.0.1","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","lodash":"2.2.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"e592eb8d9d319e010682e4fc121550921dc8bab1","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types","_id":"dynamodb-data-types@2.0.1","scripts":{},"_shasum":"0a3ab561026e66faeeae819469af7731e00edd27","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"dist":{"shasum":"0a3ab561026e66faeeae819469af7731e00edd27","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.0.1.tgz","integrity":"sha512-AuGxBieYTdromG0Pj6MUvAbeOaspDW2fpK2OBVWo1F1kBj16jVOcCF2Bp7PluVrwJsDTYdHwbnxKFdHlcpSpFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDTAe68XZ8v2kafWAK3IuyslfSFiPoqn2hQnGfab35CQIgabTB3jbw8HN6plHYBU5Q/dgCOcHVZ/tdIBtkjx/qPdo="}]},"directories":{}},"2.1.0":{"name":"dynamodb-data-types","version":"2.1.0","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","lodash":"2.2.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"641eb1234a28865d9702202be6249f103a98611d","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types","_id":"dynamodb-data-types@2.1.0","scripts":{},"_shasum":"2c7da1bab3834f3de29f86e7b2e1e11634eea016","_from":"dynamodb-data-types","_npmVersion":"1.4.14","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"dist":{"shasum":"2c7da1bab3834f3de29f86e7b2e1e11634eea016","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.0.tgz","integrity":"sha512-yPNBQGxcpO8IRG5wZqn0n6pqJmye4UOm0DUEkeCyoDKFr8yV1+uAcOCZpzlR2jrWlr7b0zBxlZ8n77AWbUHkIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmXo4202ZzJPTqsjNNhg6zFl1jsc9xJnXb15/Z8DzFdAiAH7MR67jNz+1IVxFw6ScfqBazySD6exv7iMfIaSkugeQ=="}]},"directories":{}},"2.1.1":{"name":"dynamodb-data-types","version":"2.1.1","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","lodash":"2.2.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"c28984b5c578aa28e233a76d732521afc724b0e0","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.1","scripts":{},"_shasum":"5e9895ff182890370d1e99a6d5691d835e585915","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"5e9895ff182890370d1e99a6d5691d835e585915","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.1.tgz","integrity":"sha512-nuWc5t5pAG5r3iKu80AvEdctk2nVhMtKFTXy4Yws/eZo4ty9qvG+eVtOW3L190ec4AolMiRtkBHs+VsBQ6oFiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwTalLtGSDbmpCThGHLHNodVVeD0EqL3bzvs3MUuLPkAiEA8q+uxU5fiqgPq7uIdKm2CvPdeH2RE+NOzl5RDDnjkIM="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"2.1.2":{"name":"dynamodb-data-types","version":"2.1.2","description":"A utility for Amazon DynamoDb Data Types for AWS SDK for Node.js.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.1","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"2.2.1","phantomjs":"^1.9.19","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build-browser":"browserify browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js"},"keywords":["amazon","api","aws","dynamodb"],"license":"MIT","gitHead":"cfbe723d29e67befc46bea98d6379bb9f4f70bc5","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.2","_shasum":"78959a051e4f224193377ac4b47c3c50a729087d","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"78959a051e4f224193377ac4b47c3c50a729087d","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.2.tgz","integrity":"sha512-B2BrCHP79Fq0Jh8/NDAYzDZnHpu1OWAEZFSU+IMphoOke2M7nwnKgFDJMRNiaLsCw1PBvAz9G6okidCAmyr0+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqDwLjUXbT9c6GCGt/rYmmEhe/0pXFLIOWjooSS/5xAQIhANjriQIm+0KPNkdUvzK1M922xmOQboKedBMex82Ovi7h"}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"2.1.3":{"name":"dynamodb-data-types","version":"2.1.3","description":"A convenience utility for Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.1","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"2.2.1","phantomjs":"^1.9.19","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build-browser":"browserify browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js"},"keywords":["dynamodb","dynamodb mapper","dynamodb marshaller","dynamodb json format","dynamodb format attributes","marshall dynamodb","amazon","aws"],"license":"MIT","gitHead":"988441bce4e7a192c30ce25db0ed9981bda52b79","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.3","_shasum":"0ce0c404b6d97b6829f8ad2f5cd9652f93144f30","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"0ce0c404b6d97b6829f8ad2f5cd9652f93144f30","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.3.tgz","integrity":"sha512-hMVyA6n/HsoWVhUEdXnumnQWDPk7iSW7hgNPuX2NAQbWD8CVIE7FLcM3Thif84OycBenaTcVSvmKQP+pyi5EKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACfrNG3K9dh8UpkZgxs/Ci1xr8gwYLCkvKfTLxUguOnAiEAhdIaMsxFhxZIRtRgKfcyVJrE8DBKGmisg/OaaAnTmtk="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"2.1.4":{"name":"dynamodb-data-types","version":"2.1.4","description":"A convenience utility for Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.1","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"4.0.0","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build-browser":"browserify browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js"},"keywords":["dynamodb mapper","dynamodb marshaller","dynamodb json format","dynamodb format attributes","marshall dynamodb","amazon","aws"],"license":"MIT","gitHead":"7afe507ace67277d27b5da4ddc566f05a5951736","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.4","_shasum":"ef16bf4b9a2ef63617a8b0c787b1cecf47d3e8c4","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"ef16bf4b9a2ef63617a8b0c787b1cecf47d3e8c4","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.4.tgz","integrity":"sha512-06p0eYnijhmO/K+12SP5rrSms+AdThYM68ipHocuwve1C2Ib6INptsfczUURQO3NKB4ka9nbaCmNmzAFVXd6YQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHQmRwfzla2xbpZrCLpOGkdwC+Enj5+n1o/V4+8LlPRwIhAKrfv7Y42dR5JPLFNGj5yhvLFm69HoCDWtI08Ot+ElOD"}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"2.1.5":{"name":"dynamodb-data-types","version":"2.1.5","description":"A convenience utility for Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.1","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"4.0.0","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build-browser":"browserify browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js"},"keywords":["dynamodb mapper","dynamodb marshaller","dynamodb json format","dynamodb format attributes","marshall dynamodb","amazon","aws"],"license":"MIT","gitHead":"553b624c3cfa85835932433bcdce78b7928a52aa","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.5","_shasum":"096ecec51a093c4c6d7dc9ee860d5c3d469b9e81","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"096ecec51a093c4c6d7dc9ee860d5c3d469b9e81","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.5.tgz","integrity":"sha512-pbxzYAR30iOFB2A/2clyAkN8UsRrz3KLZqkAtPGZamHhZr4AM7J2EvKgpm+hHXcQPkc5ovkGIWMBQV5DY8VRsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmauGwjaUtenRtwzu45iV7NTG24sdcCWmIrTQZasqsDgIgK6o4qNrzK6Kgp/ouj+yQJBaAIRTs1ilr291ykefNcpw="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"2.1.6":{"name":"dynamodb-data-types","version":"2.1.6","description":"A convenience utility for Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.1","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"4.0.0","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build-browser":"browserify browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js"},"keywords":["dynamodb mapper","dynamodb marshaller","dynamodb json format","dynamodb format attributes","marshall dynamodb","amazon","aws"],"license":"MIT","gitHead":"e8a80ebc4fd031b91aaaf6be6e04f8ba804489b1","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@2.1.6","_shasum":"6b9cb9f6f2c3422bb711b99e9761ca45b885a593","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"6b9cb9f6f2c3422bb711b99e9761ca45b885a593","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-2.1.6.tgz","integrity":"sha512-XGNciFxcXp2HMAp8WvE/vcg7LCS3JNW6lAWJhGqDwRtz3/qWBVEO7TeZ+Efm+t7b8bcl6Q0HDDaN9P4tuHEoGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzmLI7+EOiRtn6WaU+BE4QAYr2/m7KVXO3ktXGIIheKAiEA7yAt4aXXefeZ5bcOgJuyjl2Fz6adUycQbL497S7shfA="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{}},"3.0.0":{"name":"dynamodb-data-types","version":"3.0.0","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.2","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"4.0.0","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays","test_":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js"},"keywords":["dynamodb data types","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","gitHead":"5bb4c7a54e409f3e4d0c9062084616c3ed4832c5","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@3.0.0","_shasum":"2dda3ff2a88462e05d2738be58902e231d936103","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"2dda3ff2a88462e05d2738be58902e231d936103","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-3.0.0.tgz","integrity":"sha512-Et+PelKOoeoH7qjPrerZ1G9b865xPwuBYCSAvG4Q55zd10AtcgnuhCowxG6/RR0ymx64IOwbNpVLpPQEdP71iw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmQ9SZsIXXJjw/SEq+jXZ1rZx9MNEiKAYaz7XpeoTchAiEA1CkQYO58vacXIwugV+2DLPt6y9K2rn4VqH2QaHfiH/0="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/dynamodb-data-types-3.0.0.tgz_1468156412951_0.33177192974835634"},"directories":{}},"3.0.1":{"name":"dynamodb-data-types","version":"3.0.1","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"devDependencies":{"async":"0.2.9","aws-sdk":"^2.1.10","browserify":"^12.0.2","coveralls":"^2.11.6","istanbul":"^0.4.1","jasmine-node":"^1.14.5","lodash":"4.0.0","uglify-js":"^2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays","test_":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","gitHead":"7e4afb360e8aa61a0812709a8d5e64cbb400f192","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@3.0.1","_shasum":"5568531574ce2e190bc27cc3a5895fbf37aefca5","_from":"dynamodb-data-types","_resolved":"file:dynamodb-data-types","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"dist":{"shasum":"5568531574ce2e190bc27cc3a5895fbf37aefca5","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-3.0.1.tgz","fileCount":40,"unpackedSize":255004,"integrity":"sha512-IgZOdfSPoPb83+Sutyu5eCLWsVSVfnewYNs00Fmos3c9/LqY7X83DFyEBZXMzx5ql7bIrBMAlHkxMGKb0sY3SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIUUkwEONhedJuk46JaMgIb+nTrNBwIrB7ZPOT9cqYmAiB4WhBN4WXhVOdO1LXLwEsU2o+OjQWMxJ7Ofi8+RPLJ/Q=="}]},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_3.0.1_1519913858741_0.7895510743983101"},"_hasShrinkwrap":false},"3.0.2":{"name":"dynamodb-data-types","version":"3.0.2","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","coveralls":"2.11.6","istanbul":"0.4.1","jasmine-node":"1.14.5","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays","test_":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","gitHead":"6d9b589441443a9679d840b826ccf30e3a99efa0","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@3.0.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-obdVK4fSGmw39nx2lToFGS2kYCe3jF2YMSo5i8/djivs13KSjNhu4HKyT6EalPV2EwdBqR07d3npOiC+o3mkqg==","shasum":"1d31908b327d4d4a387470577361e2a70ff44d84","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-3.0.2.tgz","fileCount":39,"unpackedSize":255268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtc1xCRA9TVsSAnZWagAAkYQP/R58s44Z4MM4rK5SSBUs\nnD8tJ/jP4Jabg6AxblZ6ey5r6GXPcF+fa75AqY2h+zjkUQ9jAdVNoTQJufv6\ntaqeIyo0/74fobFU95daAc0+NZyr11inXSVvFf7EVdol0wqz7xYHeDqLCjAY\nYP2SPuovV/clAxJ7IuwoaDHbBvnui88mxrZRyp979SvvHfxk2k4QIYJy6Laf\n/nXhFxhUG5VowEjTIWhcGBu84wMjmwr8T+pihFBJL2qGLWReVSlRDjl8ZpMU\nJc2cBOWzFkQFedvWFhnxvCP1DUkvw78ESg2+S0K3XugIGIQcuUkCsNLMRFbl\ntD5RQRqvk7FgqMTthYUl8gX9xBPI/P8ceYIzSCIhyUGCIejalOy2yQAUhdUx\nOYitRDiVutKP54pH6R6q+AUOPj8BFQezBnoDjzA+fwwXjCzaI5YJ1ZMfrMKf\nwPHI0qi3Mn2YgqPTCI7Ly1KMnR9ixs+zkPzJ+/Ku757fhlNZo8x82pSTEp20\n6QoXtfxbwwdA2yeytdLCq8/YQsCThkPN8hlJ3+/L8tR9OMPbqoGulBEjgH/7\nWkGQZivUh1kwXAHLEDoE55W0BDxgNaSiJkk4fAhqCdQCGyZb1WjTft8wzJlO\n8N87CGfHavAJyzvOp541ASq7B9J7XKkkp+X+MymXBcbXw5sQ1J3Fbx64l+Fh\nKJkP\r\n=PM9x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/3scEOD6k7SD8SvEEQWJ/ozvj3KTZ9BV78Qmj528TKAiEA2w64xOIfZN9QuhTm3krJlWnVFmsvwrYu+PKqjaBGVss="}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_3.0.2_1639304561506_0.41226071286127564"},"_hasShrinkwrap":false},"3.0.3":{"name":"dynamodb-data-types","version":"3.0.3","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","coveralls":"2.11.6","istanbul":"0.4.1","jasmine-node":"1.14.5","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays","test_":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","coveralls":"istanbul report && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","gitHead":"c991499925818674e5f13d6a381837ed6691aab9","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@3.0.3","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-q1HvDmBnOAOp76qSaYczL1IXtO/p80wXKDJLVxiUkWeFs7V/R4DQhKQsjARBSKBBr9lbIdpNZOW1jg8OPWtr3w==","shasum":"2955bddf922609695ac076d0881f5a8e1f31dda6","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-3.0.3.tgz","fileCount":67,"unpackedSize":494141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuLsgCRA9TVsSAnZWagAA8OkP/jePftvZ3b5vT6jrf+Wn\n5jWS8UZmhSqMXAfaLNodBF8G4E+7n3xKMVFUjXGL/N7oSjXqT8NEwQpQ0Z9T\nRhbhCYuZF4OMT2RLDO/kCrBNWHHx/2ltsdjsuzouKN3xYbQCao+3B5xNJIyJ\nKop4JSRmibiZbok4SjK71a0rT9IzqxTdtNqQFmXPP9p5tl9iFX7tTph4/qGp\nedtmHhN4z5yt5wXk+PTj45MhCQYdK/ePtZvtIUa3ccdVscq8HjA9ArdO2UVW\nufQkJ8LAHijG3/vnuEiYI9w0Kb0CuwAOv7eR7L191DvOwQLVMwEjpzc9NccL\nMXcJHRZlIq2CsjuglpmPdgbI3IqAYV9S0SGDZPamoDegqG1iE76MmAeZE8GW\nxkg0JE1nHZiFOFtj8+JsYkNqmj+cSGpAf4hDob6haWotA+GYk40BLHPhcQrV\n4bLily7ROvpx0kEDv2Ri2UY+HAL/UjiPRda9PpkwmwKWh40pPS7wDRgY7UIm\n4o6hM5CHx00gkuv2sw3FX2pKYuCV7wP4EUB6SP+60aCEqPvm1thFjmYdt3mS\nVIo+pGkahfkiTYiuZ4EU93dwgazxoO+4kMiBRRmbx7w7hcZwqJztoAi+CNK6\n3Ugngesybal1A+KHkcp/M8bmt6tfg+Rvb/YsTXwV9uMtAMpuyWK7tE/9V6xD\ntbm5\r\n=j/pZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFa18cIxF0chjfJUa7hWFQUQAzeCjm4njfP2mh10PnIQIhANFr1n7220iO8M6qFTTZ6byn4cL3EPhNyrAgIiz4z479"}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_3.0.3_1639496480291_0.9290239335253521"},"_hasShrinkwrap":false},"4.0.0-beta.0":{"name":"dynamodb-data-types","version":"4.0.0-beta.0","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.44.0","async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","istanbul":"0.4.1","jasmine-node":"1.14.5","jest":"^27.2.4","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays","test_":"istanbul cover --include-all-sources --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --include-all-sources --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","readmeFilename":"README.md","readme":"# DynamoDb-Data-Types\n\n[![Build Status](https://travis-ci.org/kayomarz/dynamodb-data-types.svg)](https://travis-ci.org/kayomarz/dynamodb-data-types)\n[![Coverage Status](https://coveralls.io/repos/kayomarz/dynamodb-data-types/badge.svg?branch=master&service=github)](https://coveralls.io/github/kayomarz/dynamodb-data-types?branch=master)\n\nThis utility helps represent AWS DynamoDB data types. It converts\nJavaScript objects into objects as required by DynamoDB.\n\nStarting with version 4.0.0 (currently in beta), this library helps generate\nUpdate Expressions for use with DynamoDB's `UpdateItem` operation.\n\nFor example, following is some JavaScript data:\n\n```js\nconst data = {\n  fruit: 'Apple',\n  count: 12\n}\n```\n\nThe DynamoDB SDK requires it to be represented as:\n\n```json\n {\n    \"fruit\": {\n      \"S\": \"Apple\"\n    },\n    \"count\": {\n      \"N\": \"12\"\n    }\n  }\n```\n\nUse `wrap` and `unwrap` to convert objects form one form into the other.\n\n## Quick Example\n\n```js\nconst attr = require('dynamodb-data-types').AttributeValue;\n\nconst data = {\n  id: 10,\n  food: ['Rice', 'Noodles'],\n  age: 1,\n  isThatYou: true,\n  stuff: ['Tomato', 33],\n  day: 'Tuesday'\n};\n\n// wrap: marshall data into the format required by DynamoDB.\nconst dynamodbData = attr.wrap(data);\n// {\n//   \"id\": {\"N\": \"10\"},\n//   \"food\": {\"SS\": [\"Rice\", \"Noodles\"] },\n//   \"age\": {\"N\": \"1\"},\n//   \"isThatYou\": {\"BOOL\": true},\n//   \"stuff\": {\"L\": [{\"S\": \"Tomato\"}, {\"N\": \"33\"}]},\n//   \"day\": {\"S\": \"Tuesday\"}\n// }\n\n// unwrap: unmarshall data back to the orignal.\nconst unwrapped = attr.unwrap(dynamodbData);\n// {\n//   \"id\": 10,\n//   \"food\": [\"Rice\", \"Noodles\"],\n//   \"age\": 1,\n//   \"isThatYou\": true,\n//   \"stuff\": [\"Tomato\", 33],\n//   \"day\": \"Tuesday\"\n// }\n\n// Helper for working with DynamoDB update ('updateItem'):\nconst attrUpdate = require('dynamodb-data-types').AttributeValueUpdate;\nconst dataUpdates = attrUpdate\n      .put({game: \"Football\"})\n      .add({age: 1})\n      .delete(\"day\");\n// {\n//   \"game\": {\n//     \"Action\": \"PUT\",\n//     \"Value\": {\"S\": \"Football\"}\n//   },\n//   \"age\": {\n//     \"Action\": \"ADD\",\n//     \"Value\": {\"N\": \"1\"}\n//   },\n//   \"day\": {\n//     \"Action\": \"DELETE\"\n//   }\n// }\n```\n\nThe above example does not commnicate with a DynamoDB instance. It only\ndemonstrates how to wrap / unwrap data.  There are more examples below.\n\nIncase you need to wrap/unwrap individual values, use `wrap1` and `unwrap1`:\n\n```js\nconsole.log(attr.wrap1(50));\n//{ N: '50' }\n\nconsole.log(attr.unwrap1({\"N\":\"50\"}));\n//50\n```\n\n### Use with Node.js\n\nUse with [AWS SDK for Node.js](https://aws.amazon.com/sdk-for-node-js/)\n\n    npm install dynamodb-data-types\n\n\n### Use in cli\n\nUse with the cli for quick utility\n\n    npm install -g dynamodb-data-types\n    dynamo-dt-attr-wrap '{\"hello\":\"world\"}'\n    dynamo-dt-attr-unwrap '{\"hello\": {\"S\": \"world\"}}'\n\n\n### Use in the browser\n\nUse with [AWS SDK for JS in the Browser](https://aws.amazon.com/sdk-for-browser/)\n\nDownload the browser version from [dist](dist).\n\nSee [examples/browser](examples/browser) and [this note](#browserNotes)\n\n\n<a name=\"browserNotes\"></a>\n\n## Notes for use in the browser\n\nThe browser version of this library (created using\n[browserify](http://browserify.org/)) has not been tested. Pull\nrequests to add tests for the browser are welcome (maybe using phantom.js?).\n\nThe browser version is available from version `2.1.2` onwards.\n\n\n### File size of the browser version\n\nThe browser version of this library is generated using\n[Browserify](http://browserify.org/).\n\nFor versions `3.0.0` onwards of this library, `browserify` is made to exclude\n`Buffer` related code. It is less likely for a browser side application to make\nuse of `Buffer` as a binary type.\n\nIf you don't need detailed info about this, skip the next paragraph.\n\nThis library uses node's [Buffer](https://nodejs.org/api/buffer.html) for\nrecognizing binary types. By default, browserify, includes external `Buffer`\nrelated code, causing the filesize of the browser dist to become 5.4\ntimes larger (6x if you compare `min.js` files). Version `3.0.0` onwards,\nbrowserify is made to exclude `Buffer` related code because it seems less\nlikely for browser side code to detect `Buffer` as a binary type. Incase your\nbrowser application does require `Buffer` you might try using\n[dist-with-buffer](dist-with-buffer)\n\n\n## Examples\n\n + [examples/01-put-update.js](examples/01-put-update.js)\n + [examples/02-binary-image.js](examples/02-binary-image.js)\n + [examples/03-explicit-data-type.js](examples/03-explicit-data-type.js)\n + [examples/04-explicit-preserve-arrays.js](examples/04-explicit-preserve-arrays.js)\n + [examples/browser/dynamodb-data-types.html](examples/browser/dynamodb-data-types.html) \n\n## Features\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html)\n\nDynamoDb-Data-Types supports:\n\n * AttributeValue\n * AttributeValueUpdate\n\n\n## Supported AttributeValue types\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html)\n\nDynamoDb-Data-Types supports:\n\n + B\n + BOOL\n + BS\n + L\n + M\n + N\n + NS\n + NULL\n + S\n + SS\n\n## preserveArrays\n\n(New in version 2.1.0)\n\nConsider the following:\n\n```javascript\n\nconst data = {\n  alphabets: ['c', 'a', 'b', 'c']\n};\n\n```\n\n`wrap(data)` detects `alphabets` as `SS`. Being a set `SS` has two properties unlike those of arrays :\n\n + The order of elements is not preserved.\n + Duplicate elements are not allowed.\n\nStarting with version **2.1.0**, you can do:\n\n + `wrap(data, {types: {alphabets: 'L'} }` to explicitly tell wrap to treat it `L` instead of the auto-detected `SS`. Similarly for `put()` and `add()`\n + Alternatively, call `preserveArrays()` to consider all arrays as type `L`. This has a global effect.\n\nRead the documentation and examples for more.\n\n\n## Support for `BOOL`, `NULL`, `M`, `L`\n\n(new in version 2.0.0)\n\nDynamoDb-Data-Types version 2.0.0 introduces support for **AttributeValue**\ntypes `BOOL`, `NULL`, `M`, `L`.\n\n\n### Use of `M` for nested data\n\nDynamoDb-Data-Types uses `M` to nest objects. Consider the following data:\n\n```js\nconst data = {\n  polygon: {\n    quadrilateral: {\n        sides: 4\n    }\n  }\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  \"polygon\": {\n    \"M\": {\n      \"quadrilateral\": {\n        \"M\": {\n          \"sides\": {\n            \"N\": \"4\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### Use of `L` for arrays\n\nDynamoDb-Data-Types uses `L` to represent mixed arrays. Consider the following data:\n\n```js\n{\n  strs: ['abc', 'def'],\n  nums: [123, 456],\n  mix: [1, 'abc', true, false, null, [1,2,3]]\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  strs: { \n    SS: [\"abc\",\"def\"] \n  },\n  nums: { \n    NS: [\"123\",\"456\"] \n  },\n  mix: {\n    \"L\": [\n      { N: \"1\" },\n      { S: \"abc\" },\n      { BOOL: true },\n      { BOOL: false },\n      { NULL: true },\n      { NS: [\"1\",\"2\",\"3\"] }\n    ]\n  }\n}\n```\n\n## Detecting data types\n\nIt is straightforward to detect types `N`, `NS`, `S`, `SS`, `NULL` and `BOOL`.\nTo detect other types - `M`, `L`, `B`, `BS` - simple rules are applied as\nexplained below.\n\nFor any a given value `val`, `wrap()` detects the AWS Data types as follows:\n\n### BOOL, NULL, N, S\n\nHow `wrap()` detects them (psuedo-code):\n\n    IF val is typeof boolean\n        THEN detect as type BOOL\n    ELSE IF val is null\n        THEN detect as type NULL\n    ELSE IF val is typeof number or if val instanceof Number\n        THEN detect as type N\n    ELSE IF val is typeof string or if val is instanceof String\n        THEN detect as type S\n\n### B\n\nHow `wrap()` detects type `B` (psuedo-code):\n\n    IF val is instanceof Buffer\n        THEN detect as type B\n\nThere maybe other types which should get detected as `B`. Please let me know if\nyou have suggestions.\n\n### M\n\nHow `wrap()` detects type `M` (psuedo-code):\n\n    IF (val is none of: BOOL, NULL, N, S, B)\n        AND (typeof val === 'object')\n            THEN detect as type M\n    ELSE\n        wrap() ignores val\n\n### NS, SS, BS, L\n\nWhen `wrap()` sees an Array, here's what it does (psuedo-code):\n\n    IF val is an Array\n        IF (every element in Array is type N)\n            THEN detect as type NS\n        ELSE IF (every element in Array is type S)\n            THEN detect as type SS\n        ELSE IF (every element in Array is type B)\n            THEN detect as type BS\n        ELSE \n            detect as type L\n\n\n## API - Reference documentation\n\n### Global settings\n\n#### preserveArrays()\n\nIf `preserveArrays()` is called, all arrays found in the object being wrapped\nare given type `L`. In other words, arrays will no longer get detected as `NS`,\n`SS` or `BS` but specified as `L`.\n\nThis is useful to preserve duplicates and the order of elements in arrays.\n\n    const ddt = require('dynamodb-data-types');\n    ddt.preserveArrays();\n\nThis function is designed to be called once - It has a global effect.\n\nIf this is not needed on a global level, a similar effect can be achieved using\n`options` parameter passed to `wrap()`, `wrap1()` and `put()` and `add()`.\n\nSimilarly, the global behaviour of `preserveArrays()` may be overridden using\nthe `options` object passed to  `wrap()`, `wrap1()` and `put()` and `add()`.\n\n\n### AttributeValue\n[AWS API Reference -\nAttributeValue](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html) \n\n* [wrap](#wrap)\n* [unwrap](#unwrap)\n* [wrap1](#wrap1)\n* [unwrap1](#unwrap1)\n\n### AttributeValueUpdate\n[AWS API Reference -\nAttributeValueUpdate](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValueUpdate.html) \n\n* [put](#put)\n* [add](#add)\n* [delete](#delete)\n\n## AttributeValue\n\n<a name=\"wrap\"></a>\n\n### wrap(item[, options])\n\nWrap (marshall) JavaScript data into DynamoDB's AttributeValue data type.\n\n#### Arguments\n\n * @param {Object} item The object to wrap.\n * @param {Object} options\n * @return {Object} A DynamoDB AttributeValue.\n\n##### Options\n\n* `types`: An object containing attribute names and explicit type for that\nattribute. Currently explicit type can only be specified if the detected type is\nan array. Possible values are `'NS'`, `'SS'`, `'BS'`, `'L'`\n\nExample of an options object:\n\n```javascript\n// Any property named 'randomList' found in the object (at any depth) is\n// specified as 'NS'. This explicit type can be assigned only if `randomList` is\n// detected as an array.\n\n// Similarly if 'orderedList' is an array, it gets specified as type 'L'\n\n{\n  types: {\n     randomList: 'NS', \n     orderedList: 'L'\n  }\n}\n```\n\n\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap({name: \"Foo\", age: 50});\n// {\"name\":{\"S\":\"Foo\"},\"age\":{\"N\":\"50\"}}\n\nattr.wrap({alphabets: [\"a\", \"b\", \"c\"]});\n// {\"alphabets\":{\"SS\": [\"a\",\"b\",\"c\"]}}\n\nattr.wrap({alphabets: [\"a\", \"b\", \"c\"]}, {types: {alphabets:\"L\"}});\n// {\"alphabets\":{\"L\": [{\"S\":\"a\"},{\"S\":\"b\"},{\"S\": \"c\"}]}}\n```\n\n<a name=\"unwrap\"></a>\n\n### unwrap(attributeValue)\n\nUnwrap (unmarshall) DynamoDB AttributeValue to appropriate\nJavaScript types.\n\n#### Arguments\n\n * @param {Object} attributeValue The DynamoDB AttributeValue to unwrap.\n * @return {Object} Unwrapped object with properties.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap({\"name\":{\"S\":\"Foo\"},\"age\":{\"N\":\"50\"}});\n// {name: \"Foo\", age: 50}\n```\n\n<a name=\"wrap1\"></a>\n\n### wrap1(value [, options])\n\nWrap a single value into DynamoDB's AttributeValue.\n\n#### Arguments\n\n * @param {String|Number|Array} \n * @param {Object} options Same as options for wrap().\n * @return {Object} DynamoDB AttributeValue.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap1(50);    // {\"N\":\"50\"}\nattr.wrap1(\"50\");  // {\"S\":\"50\"}\n```\n\n<a name=\"unwrap1\"/></a>\n\n### unwrap1(attributeValue)\n\nUnwrap a single DynamoDB's AttributeValue to a value of the appropriate\nJavaScript type. \n\n#### Arguments\n\n@param {Object} attributeValue The DynamoDB AttributeValue.\n@return {String|Number|Array}  The JavaScript value.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap1({\"N\":\"50\"});  // 50\nattr.unwrap1({\"S\":\"50\"});  // \"50\"\n\n```\n\n## AttributeValueUpdate\n\n<a name=\"add\"></a>\n\n### add(attrs [, options])\n\nAppend attributes to be updated with action \"ADD\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object} attrs Object with attributes to be updated.\n * @param {Object} options Same as options for wrap().\n * @return {Updates} Object with all update attributes in the chain.\n\n<a href=\"#example_put_add_delete\">Example - put, add, delete.</a>\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"put\"></a>\n\n### put(attrs [, options])\n\nAppend attributes to be updated with action \"PUT\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object} attrs Object with attributes to be updated.\n * @param {Object} options Same as options for wrap().\n * @return {Updates} Object with all update attributes in the chain.\n\n<a href=\"#example_put_add_delete\">Example - put, add, delete.</a>\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"delete\"></a>\n\n### delete(attrs)\n\nAppend attributes to be updated with action \"DELETE\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object|String|Array} attrs If this argument is an an Object,the\n   Object's property values must be an array, containing elements to be removed,\n   as required by DynamoDB SDK.  If this argument is a String, it should contain\n   comma seperated names of properties to be deleted.  If its an Array, each\n   array element should be a property  name to be deleted.\n\n * @return {Updates} Object with all update attributes in the chain.\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"example_put_add_delete\"></a>\n### Example: `put`, `add`, `delete`\n\n```js\nconst attrUpdate = require('dynamodb-data-types').AttributeValueUpdate;\n\nconst dataUpdate = attrUpdate\n    .put({name: \"foo\"})\n    .add({age: 1})\n    .delete(\"height, nickname\")\n    .add({favColors: [\"red\"]})\n    .delete({favNumbers: [3]});\n\nconsole.log(JSON.stringify(dataUpdate));\n// {\n//   \"name\": { \"Action\": \"PUT\", \"Value\": { \"S\": \"foo\" } },\n//   \"age\": { \"Action\": \"ADD\", \"Value\": { \"N\": \"1\" } },\n//   \"height\": { \"Action\": \"DELETE\" },\n//   \"nickname\": { \"Action\": \"DELETE\" },\n//   \"favColors\": { \"Action\": \"ADD\", \"Value\": { \"SS\": [\"red\" ] } },\n//   \"favNumbers\": { \"Action\": \"DELETE\", \"Value\": { \"NS\": [\"3\"] } }\n// }\n```\n\n<a name=\"duplicate_attr_name\"></a>\n### Note: Duplicate attribute names in `AttributeValueUpdate`\n\nEach attribute name can appear only once in the `AttributeUpdates` object of the\n`itemUpdate` call. This is a feature of the AWS API.  However its easy to\noverlook this when chaining `add`, `put` and `delete` updates.\n\nFor example, following is an attribute `colors` of type `SS` (String set)\n\n```js\nconst item = {\n    id: ...,\n    colors: [\"red\", \"blue\"]\n}\n```\n\nSuppose, we want to `delete` \"red\" and `add` \"orange\".\n\nTo add \"orange\", the `AttributeUpdates` object is created as:\n`attrUpdate.add({colors: [\"orange\"]})`. Similarly, to delete \"red\" the\n`AttributeUpdates` object is created as `attrUpdate.delete({colors: [\"red\"]})`\n\nHowever, both actions cannot be represented in the same `AttributeUpdates`\nobject.\n\n```js\n// Will not work as expected\nattrUpdate.add({colors: [\"orange\"]}).delete({colors: [\"red\"]});\n```\n\nThe action to `delete` \"red\" overwrites the action to `add` \"orange\". This is\nsimply because `colors` is a property of the `AttrubuteUpdates` object.\n\nThe following code demonstrates the above note:\n\n```js\nJSON.stringify(attrUpdate.add({colors: [\"orange\"]}));\n//{\"colors\":{\"Action\":\"ADD\",\"Value\":{\"SS\":[\"orange\"]}}}\n\nJSON.stringify(attrUpdate.delete({colors: [\"red\"]}));\n//{\"colors\":{\"Action\":\"DELETE\",\"Value\":{\"SS\":[\"red\"]}}}\n\n// The below does not work as expected\nJSON.stringify(attrUpdate.add({colors: [\"orange\"]}).delete({colors: [\"red\"]}));\n//{\"colors\":{\"Action\":\"DELETE\",\"Value\":{\"SS\":[\"red\"]}}}\n\n```\n\n## Older versions of DynamoDb-Data-Types\n\nRead this only if you need DynamoDb-Data-Types version **1.0.0** or below.\n\nIf you are already using version **1.0.0** or **0.2.7** you may continue to do\nso.\n\nIf you are using DynamoDb-Data-Types version **1.0.0** or **0.2.7**, wrapping / unwrapping `B` and `BS` will not work when used with **AWS SDK 1.x.x**\nbut should automagically work with **AWS SDK 2.x.x.** although it has not been\ntested. This is related to automatic conversion of base64 done by AWS SDK\nversion 2.x. See\n[AWS Upgrading Notes (1.x to 2.0)](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/upgrading.html). \n\n\n# Change log\n\n## Version 3.0.3\n\n+ Update code examples and docs\n\nFunctionally, this version is identical to the previous 3.0.2\n\n## Version 3.0.2\n\n+ Update the `lodash` version (used for tests).\n\nFunctionally, this version is identical to the previous 3.0.1\n\n## Version 3.0.1\n\n+ Expose as a CLI utility thanks to @bneigher (github.com/bneigher).\n    \nFunctionally, apart from the CLI utility, this version is identical to the\nprevious 3.0.0\n\n\n## Version 3.0.0\n\n+ For Node users, version `3.0.0` is identical to `2.1.6`\n+ For browser side version of this library\n  - In version `3.0.0` onwards `Buffer` related code has been excluded.\n  - Filesize of the `min.js` version is now `6.5KB`. Earlier it was `40KB`.\n\n## Version 2.1.2 - 2.1.6\n\n+ Added/fixed tests to imporve coverage.\n+ Reviewed docs.\n\nSource code of versions 2.1.2 to 2.1.6 are identical to 2.1.1.\n\n## Version 2.1.2\n\nThis version is identical to 2.1.1 with no changes to code.\nIt only includes a JS build for the browser plus a few more tests.\n\n + Use browserify to create a dist for use in the browser.\n + Updated tests, use travis-ci, coverage, istanbul, .jshintrc.\n\n## Version 2.1.1\n\n2015-12-18\n\n + Replace functions deprecated by Node.\n\n## Version 2.1.0\n\n2015-08-17\n\n + Call `preserveArrays()` to use type `L` for array types; this preserves order of array elements and allows duplicate array elements both of which are not possible using sets `SS`, `NS` or `BS`\n + If not required on a global scale (calling preserveArrays), explicity set array types by passing opts to `wrap()`, `add()`, `put()`\n\n## Version 2.0.1\n\n2015-02-15\n\n + Fixed README\n + Committed modified package.json (just realised it wasn't committed)\n\n## Version 2.0.0 \n\n2015-02-15\n\n + Implemnted `M`\n + Implemented `L`\n + Added example to put and get binary data (examples/02-binary-image.js)\n\n## Version 1.0.0 \n\n2015-02-11\n\n**Note:** There are no source code changes in version 1.0.0.  Functionally,\n1.0.0 is identical to 0.2.7.\n\n  + Bumped from version 0.2.7 to version 1.0.0.\n  + Update documentation especially with regard to `B` and `BS` data types.\n  + Added development deps into pacakge.json instead of tests/package.json\n    (It should have been this way to begin with)\n\n## version 0.2.7\n\n2014-01-29\n\n## version 0.2.6\n\n2013-11-15\n\n## version 0.2.5\n\n2013-11-11\n\n\nNote: Change log dates are yyyy-mm-dd.\n\n## License\n\n[License](https://github.com/kayomarz/dynamodb-data-types/blob/master/LICENSE)\n","gitHead":"f4b1fe57ab5cce983300d7823a3f085329851918","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@4.0.0-beta.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-rPuBYcD6SHj5FaekdJlI13XevFdDbBJMem9dwjo9r8w0tJtiDoYbzjY8xRnUS59MXPQsZaM7ngPGFRUvt3PELg==","shasum":"5424ed3a128a25c1543a434481060dbbc985ed1f","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-4.0.0-beta.0.tgz","fileCount":50,"unpackedSize":280525,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuVIkCRA9TVsSAnZWagAAFJ8QAJni2ShD6h0bDQiPj8eJ\nbj6JiYMOVC8Oz+IIbnDD5m9Hn5xoCDxgsz+pncy+k39NrKW+6eTQiS0tu59M\nhYBCguqOccuafv/ovu8eOV7N/XiYvAQ2jZ2eZFP+S9/QaBQs6DhOHpHnSFEl\nXPYByyd/vsGGw8SBODN4OuknaVQXoWvavQ42uZklkV4WsdIXqGGw/o5JFMEM\n+oEwaolapEM0/44l+lV8b55FaekLH0Xu0QFkAK/nsVfIG+ZArrJNJntPF8/O\nPeCIywegrlgDgu7FCDPzf0/yfVp1q9+3y/caKaEydR6x+GnoNI71a4VdNep5\nezhXfUVyXYOHSui8Eg3dUZhlRY4LH31AbxCX8qbcG7BzBvaAaLRtHrc3u70E\nuwt0RLF8mDwfNWBDl618JWDbg0KHbIdXIuO9uOdfIYy1NWfB5oBrVL5Hoajd\nxkUiKLNHs/nd7Jl9aA0MEjw/qZ0SQYuTtZIvy/vJVQ3GhBnYxjUzfCE1syFl\ntu2Md7YsmJ9LfQdMJS8H64aJlkRl26lYF9R5cApLpseaupNNlLeG8/T50v9U\nEoPaNAoR7ft/2L/2aE3WyNS+zyRIH3WK341rwQV3dMpek7XaHb5ysRPhvo4g\nzRWjW2rLwYEuzrzzb7+CXCIA+btKju5QEtSRQkIIF2fKMaDQbKO/iCAo0n9n\nEWSb\r\n=r9Ou\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBDPaOL+kIFbu6mBILTOp4Upn2XotK83OLjSO8C/M8CAiBaT6RAoFAryoQ9XdTTWP1liq4+30IC5hNkdbzjRwUj3w=="}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_4.0.0-beta.0_1639535139910_0.9021308414831593"},"_hasShrinkwrap":false},"4.0.0-beta.1":{"name":"dynamodb-data-types","version":"4.0.0-beta.1","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.44.0","async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","istanbul":"0.4.5","jasmine-node":"1.14.5","jest":"^27.2.4","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test":"npm run test_ && npm run test-preserve-arrays && jest --silent --testPathIgnorePatterns '\\.online\\.test'","test-include-online":"jest --silent","test_":"istanbul cover --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","readmeFilename":"README.md","dependencies":{"unique-sequences":"1.0.0"},"readme":"# DynamoDb-Data-Types\n\n[![Build Status](https://travis-ci.org/kayomarz/dynamodb-data-types.svg)](https://travis-ci.org/kayomarz/dynamodb-data-types)\n[![Coverage Status](https://coveralls.io/repos/kayomarz/dynamodb-data-types/badge.svg?branch=master&service=github)](https://coveralls.io/github/kayomarz/dynamodb-data-types?branch=master)\n\n`dynamodb-data-types` is a utility to help represent data types and records\nused by the **AWS SDK**.\n\nAs of Version 4.0.0 (currently in Beta), this library helps create\n`UpdateExpression` for DynamoDB `UpdateItem` operations. See\n[updateExpr()](#updateExpr) below.\n\n## Introduction\n\nGiven the below JavaScript data:\n\n```js\nconst data = {\n  fruit: 'Apple',\n  count: 12\n}\n```\n\nThis library converts it to a structure required by DynamoDB:\n\n```json\n{\n  \"fruit\": { \"S\": \"Apple\" },\n  \"count\": { \"N\": \"12\" }\n}\n```\n\n## Getting Started\n\nBelow are some quick examples which do not commnicate with a DynamoDB\ninstance. For full examples, see [examples](examples/).\n\n### `wrap`, `unwrap` - to convert (marshall) JavaScript objects.\n\n```js\nconst attr = require('dynamodb-data-types').AttributeValue;\n\nconst data = {\n  id: 10,\n  food: ['Rice', 'Noodles'],\n  age: 1,\n  isThatYou: true,\n  stuff: ['Tomato', 33],\n  day: 'Tuesday'\n};\n\nattr.wrap(data); // wrap (marshall) data to use with DynamoDB\n/* Returns:\n * {\n *   \"id\": {\"N\": \"10\"},\n *   \"food\": {\"SS\": [\"Rice\", \"Noodles\"] },\n *   \"age\": {\"N\": \"1\"},\n *   \"isThatYou\": {\"BOOL\": true},\n *   \"stuff\": {\"L\": [{\"S\": \"Tomato\"}, {\"N\": \"33\"}]},\n *   \"day\": {\"S\": \"Tuesday\"}\n * } */\n\nattr.unwrap(dynamodbData); // unwrap (unmarshall) data\n/* Returns:\n * {\n *   \"id\": 10,\n *   \"food\": [\"Rice\", \"Noodles\"],\n *   \"age\": 1,\n *   \"isThatYou\": true,\n *   \"stuff\": [\"Tomato\", 33],\n *   \"day\": \"Tuesday\"\n * } */\n```\n\nTo wrap/unwrap individual values, use `wrap1` and `unwrap1`:\n\n```js\nconsole.log(attr.wrap1(50));\n//{ N: '50' }\n\nconsole.log(attr.unwrap1({\"N\":\"50\"}));\n//50\n```\n\n**Note:** Being a utility, this library only helps build structures required by\nDynamoDB.\n\n<a name=\"updateExpr\"></a>\n\n### `updateExpr()` - for DynamoDB `UpdateExpression`\n\nTo update a record, DynamoDB `UpdateExpression` supports four clauses `SET`,\n`REMOVE`, `ADD`, `DELETE`, each of which accepts one ore more `action`. See [AWS\ndocumentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html)\nfor more.\n\n`dynamodb-data-types` *updateExpr()* generates DynamoDB `UpdateExpression`. It\navoids conflict with [keywords reserved by\nDynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html). To\ndemonstrate this, the below example uses the conflicting keyword `year`.\n\n```js\nconst { wrap } = require(\"dynamodb-data-types\").AttributeValue;\nconst { updateExpr } = require(\"dynamodb-data-types\");\nconst {\n  DynamoDBClient,\n  UpdateItemCommand,\n  PutItemCommand,\n} = require(\"@aws-sdk/client-dynamodb\");\nconst TableName = \"FooTable\";\nconst client = new DynamoDBClient({ region: \"us-east-1\" });\n\nconst updates = updateExpr()    // Note: updateExpr() should be called\n      .set({ greet: \"Hello\" })  // Chain clauses multiple times\n      .remove(\"foo\", \"city\")\n      .add({ age: 1 })\n      .set({ nick: \"bar\" })\n      .remove(\"baz\")\n      .delete({ year: [2008] })\n      .add({ amt: 1.5 });\n\n// updates.expr() gets the data structures.\nconst {\n  UpdateExpression,\n  ExpressionAttributeValues,\n  ExpressionAttributeNames,\n} = updates.expr();\n\n/* Following are some of data structures generated:\n * {\n *   UpdateExpression:\n *    'SET greet = :a, nick = :b REMOVE foo, baz ADD age :c, amt :d DELETE #A :e',\n *\n *   ExpressionAttributeValues: {\n *     ':a': { S: 'Hello' },\n *     ':b': { S: 'bar' },\n *     ':c': { N: '1' },\n *     ':d': { N: '1.5' },\n *     ':e': { NS: [Array] }\n *   },\n *\n *   ExpressionAttributeNames: { '#A': 'year' }\n * }\n */\n\nconst params = {\n  TableName,\n  Key: wrap({ id: 10 }),\n  UpdateExpression,\n  ExpressionAttributeValues,\n  ExpressionAttributeNames,\n};\n\n/* TIP: For shorter code, use ...updates.expr()\n * const params = {\n *   TableName,\n *   Key: wrap({ id: 10 }),\n *   ...updates.expr()\n * };\n */\n\nclient.send(new UpdateItemCommand(params));\n```\n\n#### `updateExpr()` avoids creating duplicate values\n\nAs demonstrated below, `updateExpr()` avoids creating duplicate\nExpressionAttributeValues if the value is the same.\n\nIt does this by doing a strict equality `===` check on the value.\n\n```js\n\n  /* Below, values are different for all actions/clauses.\n   * Hence there are three entries in ExpressionAttributeValues.\n   */\n  const expr0 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 2 })\n        .add({ y: 3 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b ADD y :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' },\n  //     ':b': { N: '2' },\n  //     ':c': { N: '3' },\n  //   }\n  // }\n\n\n  /* Below, value is the same for all actions/clauses.\n   * Hence there is one entry in ExpressionAttributeValues.\n   */\n  const expr1 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 1 })\n        .add({ y: 1 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :a ADD y :a',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' }\n  //   }\n  // }\n```\n\n#### Roadmap TODO\n\nTo avoid duplicate values in ExpressionAttributeValues, apart from doing a\nstrict equality check using '===', allow a deep equality to avoid duplicates.\n\nBelow, value is the same array for all actions/clauses.\nHence there should be 1 entry in ExpressionAttributeValues.\n\nHowever there are 3 entries.\n\nIt might be a good feature to do a deep equality and ensure 1 entry in ExpressionAttributeValues.\n\n```js\n  const expr0 = updateExpr()\n        .set({ w: [1, 2, 3] })\n        .set({ x: [1, 2, 3] })\n        .set({ y: [1, 2, 3] })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b, y = :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { NS: ['1', '2', '3'] },\n  //     ':b': { NS: ['1', '2', '3'] },\n  //     ':c': { NS: ['1', '2', '3'] },\n  //   }\n  // }\n```\n\nSee\n[examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\nfor full example of generated DynamoDB structures `UpdateExpression`,\n`ExpressionAttributeValues`, `ExpressionAttributeNames`.\n\n\n### `attrUpdate` - for DynamoDB `AttributeUpdates` (Deprecated)\n\n`dynamodb-data-types` *attrUpdate()* generates\n[AttributeUpdates](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html)\nwhich is a\n[legacy](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)\nparameter. DynamoDB `AttributeUpdates` is deprecated in favor of\n`UpdateExpression` described above.\n\n```js\nconst attrUpdate = require('dynamodb-data-types').AttributeValueUpdate;\nconst dataUpdates = attrUpdate\n      .put({game: \"Football\"})\n      .add({age: 1})\n      .delete(\"day\");\n// {\n//   \"game\": {\n//     \"Action\": \"PUT\",\n//     \"Value\": {\"S\": \"Football\"}\n//   },\n//   \"age\": {\n//     \"Action\": \"ADD\",\n//     \"Value\": {\"N\": \"1\"}\n//   },\n//   \"day\": {\n//     \"Action\": \"DELETE\"\n//   }\n// }\n```\n\n### Use with Node.js\n\nUse with [AWS SDK for Node.js](https://aws.amazon.com/sdk-for-node-js/)\n\n    npm install dynamodb-data-types\n\n\n### Use in cli\n\nUse with the cli for quick utility\n\n    npm install -g dynamodb-data-types\n    dynamo-dt-attr-wrap '{\"hello\":\"world\"}'\n    dynamo-dt-attr-unwrap '{\"hello\": {\"S\": \"world\"}}'\n\n\n### Use in the browser\n\nUse with [AWS SDK for JS in the Browser](https://aws.amazon.com/sdk-for-browser/)\n\nDownload the browser version from [dist](dist).\n\nSee [examples/browser](examples/browser) and [this note](#browserNotes)\n\n\n<a name=\"browserNotes\"></a>\n\n## Notes for use in the browser\n\nThe browser version of this library (created using\n[browserify](http://browserify.org/)) has not been tested. Pull\nrequests to add tests for the browser are welcome (maybe using phantom.js?).\n\nThe browser version is available from version `2.1.2` onwards.\n\n\n### File size of the browser version\n\nThe browser version of this library is generated using\n[Browserify](http://browserify.org/).\n\nFor versions `3.0.0` onwards of this library, `browserify` is made to exclude\n`Buffer` related code. It is less likely for a browser side application to make\nuse of `Buffer` as a binary type.\n\nIf you don't need detailed info about this, skip the next paragraph.\n\nThis library uses node's [Buffer](https://nodejs.org/api/buffer.html) for\nrecognizing binary types. By default, browserify, includes external `Buffer`\nrelated code, causing the filesize of the browser dist to become 5.4\ntimes larger (6x if you compare `min.js` files). Version `3.0.0` onwards,\nbrowserify is made to exclude `Buffer` related code because it seems less\nlikely for browser side code to detect `Buffer` as a binary type. Incase your\nbrowser application does require `Buffer` you might try using\n[dist-with-buffer](dist-with-buffer)\n\n\n## Examples\n\n + [examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\n + [examples/02-binary-image.js](examples/02-binary-image.js)\n + [examples/03-explicit-data-type.js](examples/03-explicit-data-type.js)\n + [examples/04-explicit-preserve-arrays.js](examples/04-explicit-preserve-arrays.js)\n + [examples/browser/dynamodb-data-types.html](examples/browser/dynamodb-data-types.html) \n + [examples/depricated-01-put-update.js](examples/depricated-01-put-update.js)\n\n## Features\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html)\n\nDynamoDb-Data-Types supports:\n\n * AttributeValue\n * AttributeValueUpdate\n\n\n## Supported AttributeValue types\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html)\n\nDynamoDb-Data-Types supports:\n\n + B\n + BOOL\n + BS\n + L\n + M\n + N\n + NS\n + NULL\n + S\n + SS\n\n## preserveArrays\n\n(New in version 2.1.0)\n\nConsider the following:\n\n```javascript\n\nconst data = {\n  alphabets: ['c', 'a', 'b', 'c']\n};\n\n```\n\n`wrap(data)` detects `alphabets` as `SS`. Being a set `SS` has two properties unlike those of arrays :\n\n + The order of elements is not preserved.\n + Duplicate elements are not allowed.\n\nStarting with version **2.1.0**, you can do:\n\n + `wrap(data, {types: {alphabets: 'L'} }` to explicitly tell wrap to treat it `L` instead of the auto-detected `SS`. Similarly for `put()` and `add()`\n + Alternatively, call `preserveArrays()` to consider all arrays as type `L`. This has a global effect.\n\nRead the documentation and examples for more.\n\n\n## Support for `BOOL`, `NULL`, `M`, `L`\n\n(new in version 2.0.0)\n\nDynamoDb-Data-Types version 2.0.0 introduces support for **AttributeValue**\ntypes `BOOL`, `NULL`, `M`, `L`.\n\n\n### Use of `M` for nested data\n\nDynamoDb-Data-Types uses `M` to nest objects. Consider the following data:\n\n```js\nconst data = {\n  polygon: {\n    quadrilateral: {\n        sides: 4\n    }\n  }\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  \"polygon\": {\n    \"M\": {\n      \"quadrilateral\": {\n        \"M\": {\n          \"sides\": {\n            \"N\": \"4\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### Use of `L` for arrays\n\nDynamoDb-Data-Types uses `L` to represent mixed arrays. Consider the following data:\n\n```js\n{\n  strs: ['abc', 'def'],\n  nums: [123, 456],\n  mix: [1, 'abc', true, false, null, [1,2,3]]\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  strs: { \n    SS: [\"abc\",\"def\"] \n  },\n  nums: { \n    NS: [\"123\",\"456\"] \n  },\n  mix: {\n    \"L\": [\n      { N: \"1\" },\n      { S: \"abc\" },\n      { BOOL: true },\n      { BOOL: false },\n      { NULL: true },\n      { NS: [\"1\",\"2\",\"3\"] }\n    ]\n  }\n}\n```\n\n## Detecting data types\n\nIt is straightforward to detect types `N`, `NS`, `S`, `SS`, `NULL` and `BOOL`.\nTo detect other types - `M`, `L`, `B`, `BS` - simple rules are applied as\nexplained below.\n\nFor any a given value `val`, `wrap()` detects the AWS Data types as follows:\n\n### BOOL, NULL, N, S\n\nHow `wrap()` detects them (psuedo-code):\n\n    IF val is typeof boolean\n        THEN detect as type BOOL\n    ELSE IF val is null\n        THEN detect as type NULL\n    ELSE IF val is typeof number or if val instanceof Number\n        THEN detect as type N\n    ELSE IF val is typeof string or if val is instanceof String\n        THEN detect as type S\n\n### B\n\nHow `wrap()` detects type `B` (psuedo-code):\n\n    IF val is instanceof Buffer\n        THEN detect as type B\n\nThere maybe other types which should get detected as `B`. Please let me know if\nyou have suggestions.\n\n### M\n\nHow `wrap()` detects type `M` (psuedo-code):\n\n    IF (val is none of: BOOL, NULL, N, S, B)\n        AND (typeof val === 'object')\n            THEN detect as type M\n    ELSE\n        wrap() ignores val\n\n### NS, SS, BS, L\n\nWhen `wrap()` sees an Array, here's what it does (psuedo-code):\n\n    IF val is an Array\n        IF (every element in Array is type N)\n            THEN detect as type NS\n        ELSE IF (every element in Array is type S)\n            THEN detect as type SS\n        ELSE IF (every element in Array is type B)\n            THEN detect as type BS\n        ELSE \n            detect as type L\n\n\n## API - Reference documentation\n\n### Global settings\n\n#### preserveArrays()\n\nIf `preserveArrays()` is called, all arrays found in the object being wrapped\nare given type `L`. In other words, arrays will no longer get detected as `NS`,\n`SS` or `BS` but specified as `L`.\n\nThis is useful to preserve duplicates and the order of elements in arrays.\n\n    const ddt = require('dynamodb-data-types');\n    ddt.preserveArrays();\n\nThis function is designed to be called once - It has a global effect.\n\nIf this is not needed on a global level, a similar effect can be achieved using\n`options` parameter passed to `wrap()`, `wrap1()` and `put()` and `add()`.\n\nSimilarly, the global behaviour of `preserveArrays()` may be overridden using\nthe `options` object passed to  `wrap()`, `wrap1()` and `put()` and `add()`.\n\n\n### AttributeValue\n[AWS API Reference -\nAttributeValue](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html) \n\n* [wrap](#wrap)\n* [unwrap](#unwrap)\n* [wrap1](#wrap1)\n* [unwrap1](#unwrap1)\n\n### AttributeValueUpdate\n[AWS API Reference -\nAttributeValueUpdate](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValueUpdate.html) \n\n* [put](#put)\n* [add](#add)\n* [delete](#delete)\n\n## AttributeValue\n\n<a name=\"wrap\"></a>\n\n### wrap(item[, options])\n\nWrap (marshall) JavaScript data into DynamoDB's AttributeValue data type.\n\n#### Arguments\n\n * @param {Object} item The object to wrap.\n * @param {Object} options\n * @return {Object} A DynamoDB AttributeValue.\n\n##### Options\n\n* `types`: An object containing attribute names and explicit type for that\nattribute. Currently explicit type can only be specified if the detected type is\nan array. Possible values are `'NS'`, `'SS'`, `'BS'`, `'L'`\n\nExample of an options object:\n\n```javascript\n// Any property named 'randomList' found in the object (at any depth) is\n// specified as 'NS'. This explicit type can be assigned only if `randomList` is\n// detected as an array.\n\n// Similarly if 'orderedList' is an array, it gets specified as type 'L'\n\n{\n  types: {\n     randomList: 'NS', \n     orderedList: 'L'\n  }\n}\n```\n\n\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap({name: \"Foo\", age: 50});\n// {\"name\":{\"S\":\"Foo\"},\"age\":{\"N\":\"50\"}}\n\nattr.wrap({alphabets: [\"a\", \"b\", \"c\"]});\n// {\"alphabets\":{\"SS\": [\"a\",\"b\",\"c\"]}}\n\nattr.wrap({alphabets: [\"a\", \"b\", \"c\"]}, {types: {alphabets:\"L\"}});\n// {\"alphabets\":{\"L\": [{\"S\":\"a\"},{\"S\":\"b\"},{\"S\": \"c\"}]}}\n```\n\n<a name=\"unwrap\"></a>\n\n### unwrap(attributeValue)\n\nUnwrap (unmarshall) DynamoDB AttributeValue to appropriate\nJavaScript types.\n\n#### Arguments\n\n * @param {Object} attributeValue The DynamoDB AttributeValue to unwrap.\n * @return {Object} Unwrapped object with properties.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap({\"name\":{\"S\":\"Foo\"},\"age\":{\"N\":\"50\"}});\n// {name: \"Foo\", age: 50}\n```\n\n<a name=\"wrap1\"></a>\n\n### wrap1(value [, options])\n\nWrap a single value into DynamoDB's AttributeValue.\n\n#### Arguments\n\n * @param {String|Number|Array} \n * @param {Object} options Same as options for wrap().\n * @return {Object} DynamoDB AttributeValue.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap1(50);    // {\"N\":\"50\"}\nattr.wrap1(\"50\");  // {\"S\":\"50\"}\n```\n\n<a name=\"unwrap1\"/></a>\n\n### unwrap1(attributeValue)\n\nUnwrap a single DynamoDB's AttributeValue to a value of the appropriate\nJavaScript type. \n\n#### Arguments\n\n@param {Object} attributeValue The DynamoDB AttributeValue.\n@return {String|Number|Array}  The JavaScript value.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap1({\"N\":\"50\"});  // 50\nattr.unwrap1({\"S\":\"50\"});  // \"50\"\n\n```\n\n## AttributeValueUpdate\n\n<a name=\"add\"></a>\n\n### add(attrs [, options])\n\nAppend attributes to be updated with action \"ADD\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object} attrs Object with attributes to be updated.\n * @param {Object} options Same as options for wrap().\n * @return {Updates} Object with all update attributes in the chain.\n\n<a href=\"#example_put_add_delete\">Example - put, add, delete.</a>\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"put\"></a>\n\n### put(attrs [, options])\n\nAppend attributes to be updated with action \"PUT\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object} attrs Object with attributes to be updated.\n * @param {Object} options Same as options for wrap().\n * @return {Updates} Object with all update attributes in the chain.\n\n<a href=\"#example_put_add_delete\">Example - put, add, delete.</a>\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"delete\"></a>\n\n### delete(attrs)\n\nAppend attributes to be updated with action \"DELETE\".\nThis function can be chained with further calls to `add`, `put` or `delete`.\n\n#### Arguments\n\n * @param {Object|String|Array} attrs If this argument is an an Object,the\n   Object's property values must be an array, containing elements to be removed,\n   as required by DynamoDB SDK.  If this argument is a String, it should contain\n   comma seperated names of properties to be deleted.  If its an Array, each\n   array element should be a property  name to be deleted.\n\n * @return {Updates} Object with all update attributes in the chain.\n\nSee note: <a href=\"#duplicate_attr_name\">duplicate attribute names</a>\n\n<a name=\"example_put_add_delete\"></a>\n### Example: `put`, `add`, `delete`\n\n```js\nconst attrUpdate = require('dynamodb-data-types').AttributeValueUpdate;\n\nconst dataUpdate = attrUpdate\n    .put({name: \"foo\"})\n    .add({age: 1})\n    .delete(\"height, nickname\")\n    .add({favColors: [\"red\"]})\n    .delete({favNumbers: [3]});\n\nconsole.log(JSON.stringify(dataUpdate));\n// {\n//   \"name\": { \"Action\": \"PUT\", \"Value\": { \"S\": \"foo\" } },\n//   \"age\": { \"Action\": \"ADD\", \"Value\": { \"N\": \"1\" } },\n//   \"height\": { \"Action\": \"DELETE\" },\n//   \"nickname\": { \"Action\": \"DELETE\" },\n//   \"favColors\": { \"Action\": \"ADD\", \"Value\": { \"SS\": [\"red\" ] } },\n//   \"favNumbers\": { \"Action\": \"DELETE\", \"Value\": { \"NS\": [\"3\"] } }\n// }\n```\n\n<a name=\"duplicate_attr_name\"></a>\n### Note: Duplicate attribute names in `AttributeValueUpdate`\n\nEach attribute name can appear only once in the `AttributeUpdates` object of the\n`itemUpdate` call. This is a feature of the AWS API.  However its easy to\noverlook this when chaining `add`, `put` and `delete` updates.\n\nFor example, following is an attribute `colors` of type `SS` (String set)\n\n```js\nconst item = {\n    id: ...,\n    colors: [\"red\", \"blue\"]\n}\n```\n\nSuppose, we want to `delete` \"red\" and `add` \"orange\".\n\nTo add \"orange\", the `AttributeUpdates` object is created as:\n`attrUpdate.add({colors: [\"orange\"]})`. Similarly, to delete \"red\" the\n`AttributeUpdates` object is created as `attrUpdate.delete({colors: [\"red\"]})`\n\nHowever, both actions cannot be represented in the same `AttributeUpdates`\nobject.\n\n```js\n// Will not work as expected\nattrUpdate.add({colors: [\"orange\"]}).delete({colors: [\"red\"]});\n```\n\nThe action to `delete` \"red\" overwrites the action to `add` \"orange\". This is\nsimply because `colors` is a property of the `AttrubuteUpdates` object.\n\nThe following code demonstrates the above note:\n\n```js\nJSON.stringify(attrUpdate.add({colors: [\"orange\"]}));\n//{\"colors\":{\"Action\":\"ADD\",\"Value\":{\"SS\":[\"orange\"]}}}\n\nJSON.stringify(attrUpdate.delete({colors: [\"red\"]}));\n//{\"colors\":{\"Action\":\"DELETE\",\"Value\":{\"SS\":[\"red\"]}}}\n\n// The below does not work as expected\nJSON.stringify(attrUpdate.add({colors: [\"orange\"]}).delete({colors: [\"red\"]}));\n//{\"colors\":{\"Action\":\"DELETE\",\"Value\":{\"SS\":[\"red\"]}}}\n\n```\n\n## Older versions of DynamoDb-Data-Types\n\nRead this only if you need DynamoDb-Data-Types version **1.0.0** or below.\n\nIf you are already using version **1.0.0** or **0.2.7** you may continue to do\nso.\n\nIf you are using DynamoDb-Data-Types version **1.0.0** or **0.2.7**, wrapping / unwrapping `B` and `BS` will not work when used with **AWS SDK 1.x.x**\nbut should automagically work with **AWS SDK 2.x.x.** although it has not been\ntested. This is related to automatic conversion of base64 done by AWS SDK\nversion 2.x. See\n[AWS Upgrading Notes (1.x to 2.0)](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/upgrading.html). \n\n\n# Change log\n\n## Version 4.0.0\n\n+ Introduce support for DynamoDB `UpdateExpression` which also uses\n  `ExpressionAttributeValues` and `ExpressionAttributeNames`.\n\n## Version 3.0.3\n\n+ Update code examples and docs\n\nFunctionally, this version is identical to the previous 3.0.2\n\n## Version 3.0.2\n\n+ Update the `lodash` version (used for tests).\n\nFunctionally, this version is identical to the previous 3.0.1\n\n## Version 3.0.1\n\n+ Expose as a CLI utility thanks to @bneigher (github.com/bneigher).\n    \nFunctionally, apart from the CLI utility, this version is identical to the\nprevious 3.0.0\n\n\n## Version 3.0.0\n\n+ For Node users, version `3.0.0` is identical to `2.1.6`\n+ For browser side version of this library\n  - In version `3.0.0` onwards `Buffer` related code has been excluded.\n  - Filesize of the `min.js` version is now `6.5KB`. Earlier it was `40KB`.\n\n## Version 2.1.2 - 2.1.6\n\n+ Added/fixed tests to imporve coverage.\n+ Reviewed docs.\n\nSource code of versions 2.1.2 to 2.1.6 are identical to 2.1.1.\n\n## Version 2.1.2\n\nThis version is identical to 2.1.1 with no changes to code.\nIt only includes a JS build for the browser plus a few more tests.\n\n + Use browserify to create a dist for use in the browser.\n + Updated tests, use travis-ci, coverage, istanbul, .jshintrc.\n\n## Version 2.1.1\n\n2015-12-18\n\n + Replace functions deprecated by Node.\n\n## Version 2.1.0\n\n2015-08-17\n\n + Call `preserveArrays()` to use type `L` for array types; this preserves order of array elements and allows duplicate array elements both of which are not possible using sets `SS`, `NS` or `BS`\n + If not required on a global scale (calling preserveArrays), explicity set array types by passing opts to `wrap()`, `add()`, `put()`\n\n## Version 2.0.1\n\n2015-02-15\n\n + Fixed README\n + Committed modified package.json (just realised it wasn't committed)\n\n## Version 2.0.0 \n\n2015-02-15\n\n + Implemnted `M`\n + Implemented `L`\n + Added example to put and get binary data (examples/02-binary-image.js)\n\n## Version 1.0.0 \n\n2015-02-11\n\n**Note:** There are no source code changes in version 1.0.0.  Functionally,\n1.0.0 is identical to 0.2.7.\n\n  + Bumped from version 0.2.7 to version 1.0.0.\n  + Update documentation especially with regard to `B` and `BS` data types.\n  + Added development deps into pacakge.json instead of tests/package.json\n    (It should have been this way to begin with)\n\n## version 0.2.7\n\n2014-01-29\n\n## version 0.2.6\n\n2013-11-15\n\n## version 0.2.5\n\n2013-11-11\n\n\nNote: Change log dates are yyyy-mm-dd.\n\n## License\n\n[License](https://github.com/kayomarz/dynamodb-data-types/blob/master/LICENSE)\n","gitHead":"4fcbc26c66cba9971cde9e8ca6676ded1ee56902","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@4.0.0-beta.1","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-2weFHIfc2YLxnPfUfF4QAcYhEhw9q8YQ2xIv/ortmP+tmjNEs+Bozpe+H07lFvzk7N9q2IyQrfbqykplY2rszQ==","shasum":"c9442c616935467ecb65f03f1694d75193e1ef88","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-4.0.0-beta.1.tgz","fileCount":87,"unpackedSize":744751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvPIQCRA9TVsSAnZWagAAx3EP/1l8WgGgbV8QU/VPCg2l\nfD4nQV2Q/r9sFLxI0Ni+59LBwoXnouctXYEwFQagjRy+YGw1LrkIQMCo3LCu\nwJYZ5BM0tilrPJyaD1T0hggUzugJLC+3nWn9WK6eV2tiYMevskBRn1dgLI2n\nVL9k5m8npcrETz/pu522cf+ob4DFQd6FyW6LUUukL59uE6yvCn1XDpusJBCE\nqFKKmQwVPz7G9xf5/q9Ek2XN4dsKFUpGJH/9Kuye2TBPIz/pfDhokBL4K1P6\nMx39l0iX5AmAA2iYLPmy7gl0R+ol07Z+Yq02y24mx5ArpJAek+Soy2q13Z9d\nEPNnA/8qOzk5cI0rKYT4YxaAbCvahjpgDW1KEBBo5t8boFCqWxhOHfZzPnKY\nGTr1MSDXKQ3YgGKSI9Gz2+Vw/5kas0E1c0M8KxL2Af+wwI1aTxYYFUqTaDxN\naI5zqyUr9/Xuf0mjxLt04PUqztFSite2YigDUCafRCsqkiI3Ngs3DUvYQZ0N\nuHn7hUGW53A+slT8bvNipkhHlLka6FdL+WDDiNVyfYp+PkaLmrtX/R3MAXR4\nABy5kN7KNT0ovT3z4qm1UP5ti+EeLuXMYRwwK17dWdhzfxz2qHeiEeKCOdgo\nm/kKNNhNfHwCftnCNAy/YomYgFwx1mHDwcAITxuFz1kIDrGYUdipn7QdsoiZ\nx+Mb\r\n=vXrr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIBikPVPwO5mIpU+E+bDWxb9UcrCoUbik3DaSMdpbqQpXAh8TQgtXsxknv94yF89zXfcC2sZlMBd4g9nxxSAamuoA"}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_4.0.0-beta.1_1639772688077_0.1719500611387288"},"_hasShrinkwrap":false},"4.0.0-beta.2":{"name":"dynamodb-data-types","version":"4.0.0-beta.2","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.44.0","async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","istanbul":"0.4.5","jasmine-node":"1.14.5","jest":"^27.2.4","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test-watch":"jest --watch --testPathIgnorePatterns '\\.online\\.test'","test":"npm run test_ && npm run test-preserve-arrays && jest --silent --testPathIgnorePatterns '\\.online\\.test'","test-include-online":"AWS_PROFILE=dev jest --silent","test_":"istanbul cover --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","readmeFilename":"README.md","dependencies":{"unique-sequences":"1.0.0"},"readme":"# dynamodb-data-types\n\n[![Build Status](https://travis-ci.org/kayomarz/dynamodb-data-types.svg)](https://travis-ci.org/kayomarz/dynamodb-data-types)\n[![Coverage Status](https://coveralls.io/repos/kayomarz/dynamodb-data-types/badge.svg?branch=master&service=github)](https://coveralls.io/github/kayomarz/dynamodb-data-types?branch=master)\n\nA JavaScript utility to help represent DynamoDB data types and records.\n\n**New** This library helps generate DynamoDB `UpdateExpression`. See [updateExpr()](#updateExpr).\n\n## Introduction\n\nDynamoDB represents the JavaScript number `1` as `{N:'1'}`.\n\nThis utility helps convert between such representations.\n\n```\n JavaScript             DynamoDB\n------------------------------------------------\n-1                {N: '-1'}\n'Hello'           {S: 'Hello'}\ntrue              {BOOL: true}\nNULL              {NULL: true}\n{a:1, b:''}       {M: {a: {N: '1'}, b: {S: ''}}}\n```\n\n## Getting Started\n\n### `wrap`, `unwrap` to convert (marshall) JavaScript data.\n\n```js\nconst attr = require('dynamodb-data-types').AttributeValue;\n\nconst data = {\n  id: 10,\n  food: ['Rice', 33, null],\n  obj: {a:1, b:true},\n};\n\nconst wrapped = attr.wrap(data); // wrap (marshall) data to use with DynamoDB\n/* Returns:\n * {\n *   id:{N:\"10\"},\n *   food:{L:[{S:\"Rice\"},{N:\"33\"},{NULL:true}]},\n *   obj:{M:{a:{N:\"1\"},b:{BOOL:true}}}\n * } */\n\nattr.unwrap(wrapped); // unwrap (unmarshall) data\n/* Returns:\n * {\n *   id: 10,\n *   food: ['Rice', 33, null],\n *   obj: {a:1, b:true},\n * } */\n```\n\nUse `wrap1` and `unwrap1` for single primitive values, \n\n```js\nattr.wrap1(50);         // { N: '50' }\nattr.unwrap1({N:'50'}); // 50\n```\n\n<a name=\"updateExpr\"></a>\n\n### `updateExpr()` for DynamoDB `UpdateExpression`\n\nUse `updateExpr()` to  generate DynamoDB `UpdateExpression`.\n\n```js\nconst { updateExpr } = require('dynamodb-data-types');\n\nupdateExpr()             // Call updateExpr()\n  .set({ a: 'foo' })     // chain multiple clauses\n  .add({ n: 1 })\n  .remove('rat', 'bat')\n  .set({ sky: 'blue'})\n  .delete({ day: ['Mon'] }) // 'day' is a reserved keyword\n  .remove('hi')\n  .expr(); // In the end expr() returns the UpdateExpression\n// After .expr(), we cannot chain any more clauses (set,remove,add,delete)\n\n/* Returns:\n{\n * UpdateExpression: \"SET a = :a, sky = :b REMOVE rat, bat, hi ADD n :c DELETE #A :d\",\n * ExpressionAttributeValues: {\":a\":{S:\"foo\"},\":b\":{S:\"blue\"},\":c\":{N:\"1\"},\":d\":{SS:[\"Mon\"]}},\n * ExpressionAttributeNames:{\"#A\":\"day\"}} // Because 'day' is a reserved keyword\n * } */\n```\n\n### `UpdateExpression` clauses `SET`, `REMOVE`, `ADD`, `DELETE`\n\n`updateExpr().set()`, `remove()`, `add()`, `delete()`, are the same clauses\ndefined by DynamoDB `UpdateExpression`. Each clause is said to contain one or\nmore `action`. See [AWS\ndocumentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html)\nfor more.\n\n### `updateExpr()` handles DynamoDB reserved keywords.\n\n*updateExpr()* avoids conflict with [keywords reserved by\nDynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html). To\ndemonstrate this, the below example uses the conflicting keyword `year`.\n\nA more complete example:\n\n```js\nconst { wrap } = require('dynamodb-data-types').AttributeValue;\nconst { updateExpr } = require('dynamodb-data-types');\nconst { DynamoDBClient, UpdateItemCommand, PutItemCommand } = require('@aws-sdk/client-dynamodb');\nconst TableName = 'FooTable';\nconst client = new DynamoDBClient({ region: 'us-east-1' });\n\nconst updates = updateExpr()    // Call updateExpr()\n      .set({ greet: 'Hello' })  // chain multiple clauses\n      .remove('foo', 'city')\n      .add({ age: 1 })\n      .set({ nick: 'bar' })\n      .remove('baz')\n      .delete({ year: [2008] }) // 'year' is a reserved keyword\n      .add({ amt: 1.5 });\n\n// Use expr() to get the UpdateExpression data structures\nconst { UpdateExpression,  ExpressionAttributeValues, ExpressionAttributeNames } = updates.expr();\n\n// After .expr(), we cannot chain any more clauses (set,remove,add,delete)\n\n/* Generated data structures:\n * {\n *   UpdateExpression:\n *    'SET greet = :a, nick = :b REMOVE foo, baz ADD age :c, amt :d DELETE #A :e',\n *\n *   ExpressionAttributeValues: {\n *     ':a': { S: 'Hello' },\n *     ':b': { S: 'bar' },\n *     ':c': { N: '1' },\n *     ':d': { N: '1.5' },\n *     ':e': { NS: [Array] }\n *   },\n *\n *   ExpressionAttributeNames: { '#A': 'year' } // Because year is a reserved keyword\n * }\n */\n\nconst params = {\n  TableName,\n  Key: wrap({ id: 10 }),\n  UpdateExpression,\n  ExpressionAttributeValues,\n  ExpressionAttributeNames,\n};\n\n/* TIP: For shorter code, use ...updates.expr()\n * const params = {\n *   TableName,\n *   Key: wrap({ id: 10 }),\n *   ...updates.expr()\n * };\n */\n\nclient.send(new UpdateItemCommand(params));\n```\n\n#### `updateExpr()` avoids creating duplicate values\n\nAs demonstrated below, `updateExpr()` avoids creating duplicates in\n`ExpressionAttributeValue` by using `===` internally.\n\n```js\n\n  /* Different action values across clauses.\n   * Hence ExpressionAttributeValues has three items.\n   */\n  const expr0 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 2 })\n        .add({ y: 3 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b ADD y :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' },\n  //     ':b': { N: '2' },\n  //     ':c': { N: '3' },\n  //   }\n  // }\n\n\n  /* Identical action values across clauses.\n   * Hence ExpressionAttributeValues has only one item.\n   */\n  const expr1 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 1 })\n        .add({ y: 1 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :a ADD y :a',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' }\n  //   }\n  // }\n```\n\n#### Roadmap TODO\n\nTo avoid duplicate values in ExpressionAttributeValues, apart from doing a\nstrict equality check using '===', allow a deep equality to avoid duplicates.\n\nBelow, value is the same array for all actions/clauses.\nHence there should be 1 entry in ExpressionAttributeValues.\n\nHowever there are 3 entries.\n\nIt might be a good feature to do a deep equality and ensure 1 entry in ExpressionAttributeValues.\n\n```js\n  const expr0 = updateExpr()\n        .set({ w: [1, 2, 3] })\n        .set({ x: [1, 2, 3] })\n        .set({ y: [1, 2, 3] })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b, y = :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { NS: ['1', '2', '3'] },\n  //     ':b': { NS: ['1', '2', '3'] },\n  //     ':c': { NS: ['1', '2', '3'] },\n  //   }\n  // }\n```\n\nSee\n[examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\nfor full example of generated DynamoDB structures `UpdateExpression`,\n`ExpressionAttributeValues`, `ExpressionAttributeNames`.\n\n\n\n### Use with Node.js\n\nUse with [AWS SDK for Node.js](https://aws.amazon.com/sdk-for-node-js/)\n\n    npm install dynamodb-data-types\n\n\n### Use in cli\n\nUse with the cli for quick utility\n\n    npm install -g dynamodb-data-types\n    dynamo-dt-attr-wrap '{'hello':'world'}'\n    dynamo-dt-attr-unwrap '{'hello': {'S': 'world'}}'\n\n\n### Use in the browser\n\nUse with [AWS SDK for JS in the Browser](https://aws.amazon.com/sdk-for-browser/)\n\nDownload the browser version from [dist](dist).\n\nSee [examples/browser](examples/browser) and [this note](#browserNotes)\n\n\n<a name=\"browserNotes\"></a>\n\n## Notes for use in the browser\n\nThe browser version of this library (created using\n[browserify](http://browserify.org/)) has not been tested. Pull\nrequests to add tests for the browser are welcome (maybe using phantom.js?).\n\nThe browser version is available from version `2.1.2` onwards.\n\n\n### File size of the browser version\n\nThe browser version of this library is generated using\n[Browserify](http://browserify.org/).\n\nFor versions `3.0.0` onwards of this library, `browserify` is made to exclude\n`Buffer` related code. It is less likely for a browser side application to make\nuse of `Buffer` as a binary type.\n\nIf you don't need detailed info about this, skip the next paragraph.\n\nThis library uses node's [Buffer](https://nodejs.org/api/buffer.html) for\nrecognizing binary types. By default, browserify, includes external `Buffer`\nrelated code, causing the filesize of the browser dist to become 5.4\ntimes larger (6x if you compare `min.js` files). Version `3.0.0` onwards,\nbrowserify is made to exclude `Buffer` related code because it seems less\nlikely for browser side code to detect `Buffer` as a binary type. Incase your\nbrowser application does require `Buffer` you might try using\n[dist-with-buffer](dist-with-buffer)\n\n\n## Examples\n\n + [examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\n + [examples/02-binary-image.js](examples/02-binary-image.js)\n + [examples/03-explicit-data-type.js](examples/03-explicit-data-type.js)\n + [examples/04-explicit-preserve-arrays.js](examples/04-explicit-preserve-arrays.js)\n + [examples/browser/dynamodb-data-types.html](examples/browser/dynamodb-data-types.html) \n + [examples/depricated-01-put-update.js](examples/depricated-01-put-update.js)\n\n## Features\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html)\n\nDynamoDb-Data-Types supports:\n\n * AttributeValue\n * UpdateExpression\n * ExpressionAttributeValues\n * ExpressionAttributeNames\n * AttributeValueUpdate  ([Deprecated](README-deprecated.md) in favour of UpdateExpression)\n\n## Supported AttributeValue types\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html)\n\nDynamoDb-Data-Types supports:\n\n + B\n + BOOL\n + BS\n + L\n + M\n + N\n + NS\n + NULL\n + S\n + SS\n\n## preserveArrays\n\n(New in version 2.1.0)\n\nConsider the following:\n\n```javascript\n\nconst data = {\n  alphabets: ['c', 'a', 'b', 'c']\n};\n\n```\n\n`wrap(data)` detects `alphabets` as `SS`. Being a set `SS` has two properties unlike those of arrays :\n\n + The order of elements is not preserved.\n + Duplicate elements are not allowed.\n\nStarting with version **2.1.0**, you can do:\n\n + `wrap(data, {types: {alphabets: 'L'} }` to explicitly tell wrap to treat it `L` instead of the auto-detected `SS`. Similarly for `put()` and `add()`\n + Alternatively, call `preserveArrays()` to consider all arrays as type `L`. This has a global effect.\n\nRead the documentation and examples for more.\n\n\n## Support for `BOOL`, `NULL`, `M`, `L`\n\n(new in version 2.0.0)\n\nDynamoDb-Data-Types version 2.0.0 introduces support for **AttributeValue**\ntypes `BOOL`, `NULL`, `M`, `L`.\n\n\n### Use of `M` for nested data\n\nDynamoDb-Data-Types uses `M` to nest objects. Consider the following data:\n\n```js\nconst data = {\n  polygon: {\n    quadrilateral: {\n        sides: 4\n    }\n  }\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  'polygon': {\n    'M': {\n      'quadrilateral': {\n        'M': {\n          'sides': {\n            'N': '4'\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### Use of `L` for arrays\n\nDynamoDb-Data-Types uses `L` to represent mixed arrays. Consider the following data:\n\n```js\n{\n  strs: ['abc', 'def'],\n  nums: [123, 456],\n  mix: [1, 'abc', true, false, null, [1,2,3]]\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  strs: { \n    SS: ['abc','def'] \n  },\n  nums: { \n    NS: ['123','456'] \n  },\n  mix: {\n    'L': [\n      { N: '1' },\n      { S: 'abc' },\n      { BOOL: true },\n      { BOOL: false },\n      { NULL: true },\n      { NS: ['1','2','3'] }\n    ]\n  }\n}\n```\n\n## Detecting data types\n\nIt is straightforward to detect types `N`, `NS`, `S`, `SS`, `NULL` and `BOOL`.\nTo detect other types - `M`, `L`, `B`, `BS` - simple rules are applied as\nexplained below.\n\nFor any a given value `val`, `wrap()` detects the AWS Data types as follows:\n\n### BOOL, NULL, N, S\n\nHow `wrap()` detects them (psuedo-code):\n\n    IF val is typeof boolean\n        THEN detect as type BOOL\n    ELSE IF val is null\n        THEN detect as type NULL\n    ELSE IF val is typeof number or if val instanceof Number\n        THEN detect as type N\n    ELSE IF val is typeof string or if val is instanceof String\n        THEN detect as type S\n\n### B\n\nHow `wrap()` detects type `B` (psuedo-code):\n\n    IF val is instanceof Buffer\n        THEN detect as type B\n\nThere maybe other types which should get detected as `B`. Please let me know if\nyou have suggestions.\n\n### M\n\nHow `wrap()` detects type `M` (psuedo-code):\n\n    IF (val is none of: BOOL, NULL, N, S, B)\n        AND (typeof val === 'object')\n            THEN detect as type M\n    ELSE\n        wrap() ignores val\n\n### NS, SS, BS, L\n\nWhen `wrap()` sees an Array, here's what it does (psuedo-code):\n\n    IF val is an Array\n        IF (every element in Array is type N)\n            THEN detect as type NS\n        ELSE IF (every element in Array is type S)\n            THEN detect as type SS\n        ELSE IF (every element in Array is type B)\n            THEN detect as type BS\n        ELSE \n            detect as type L\n\n\n## API - Reference documentation\n\n### Global settings\n\n#### preserveArrays()\n\nIf `preserveArrays()` is called, all arrays found in the object being wrapped\nare given type `L`. In other words, arrays will no longer get detected as `NS`,\n`SS` or `BS` but specified as `L`.\n\nThis is useful to preserve duplicates and the order of elements in arrays.\n\n    const ddt = require('dynamodb-data-types');\n    ddt.preserveArrays();\n\nThis function is designed to be called once - It has a global effect.\n\nIf this is not needed on a global level, a similar effect can be achieved using\n`options` parameter passed to `wrap()`, `wrap1()` and `put()` and `add()`.\n\nSimilarly, the global behaviour of `preserveArrays()` may be overridden using\nthe `options` object passed to  `wrap()`, `wrap1()` and `put()` and `add()`.\n\n\n### AttributeValue\n[AWS API Reference -\nAttributeValue](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html) \n\n* [wrap](#wrap)\n* [unwrap](#unwrap)\n* [wrap1](#wrap1)\n* [unwrap1](#unwrap1)\n\n### updateExpr() for DynamoDB `Update`\n\n[AWS API Reference -\nUpdate](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Update.html)\n* UpdateExpression\n* ExpressionAttributeValues\n* ExpressionAttributeNames\n\nSee [updateExpr()](#updateExpr) above for detailed usage examples.\n\n### AttributeValueUpdate (Depricated)\n\n**Deprecated!** Use [updateExpr()](#updateExpr) instead.\n\n  To use AttributeValueUpdate (Depricated) see [README-deprecated](README-deprecated.md)\n  \n## AttributeValue\n\n<a name=\"wrap\"></a>\n\n### wrap(item[, options])\n\nWrap (marshall) JavaScript data into DynamoDB's AttributeValue data type.\n\n#### Arguments\n\n * @param {Object} item The object to wrap.\n * @param {Object} options\n * @return {Object} A DynamoDB AttributeValue.\n\n##### Options\n\n* `types`: An object containing attribute names and explicit type for that\nattribute. Currently explicit type can only be specified if the detected type is\nan array. Possible values are `'NS'`, `'SS'`, `'BS'`, `'L'`\n\nExample of an options object:\n\n```javascript\n// Any property named 'randomList' found in the object (at any depth) is\n// specified as 'NS'. This explicit type can be assigned only if `randomList` is\n// detected as an array.\n\n// Similarly if 'orderedList' is an array, it gets specified as type 'L'\n\n{\n  types: {\n     randomList: 'NS', \n     orderedList: 'L'\n  }\n}\n```\n\n\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap({name: 'Foo', age: 50});\n// {'name':{'S':'Foo'},'age':{'N':'50'}}\n\nattr.wrap({alphabets: ['a', 'b', 'c']});\n// {'alphabets':{'SS': ['a','b','c']}}\n\nattr.wrap({alphabets: ['a', 'b', 'c']}, {types: {alphabets:'L'}});\n// {'alphabets':{'L': [{'S':'a'},{'S':'b'},{'S': 'c'}]}}\n```\n\n<a name=\"unwrap\"></a>\n\n### unwrap(attributeValue)\n\nUnwrap (unmarshall) DynamoDB AttributeValue to appropriate\nJavaScript types.\n\n#### Arguments\n\n * @param {Object} attributeValue The DynamoDB AttributeValue to unwrap.\n * @return {Object} Unwrapped object with properties.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap({'name':{'S':'Foo'},'age':{'N':'50'}});\n// {name: 'Foo', age: 50}\n```\n\n<a name=\"wrap1\"></a>\n\n### wrap1(value [, options])\n\nWrap a single value into DynamoDB's AttributeValue.\n\n#### Arguments\n\n * @param {String|Number|Array} \n * @param {Object} options Same as options for wrap().\n * @return {Object} DynamoDB AttributeValue.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap1(50);    // {'N':'50'}\nattr.wrap1('50');  // {'S':'50'}\n```\n\n<a name=\"unwrap1\"/></a>\n\n### unwrap1(attributeValue)\n\nUnwrap a single DynamoDB's AttributeValue to a value of the appropriate\nJavaScript type. \n\n#### Arguments\n\n@param {Object} attributeValue The DynamoDB AttributeValue.\n@return {String|Number|Array}  The JavaScript value.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap1({'N':'50'});  // 50\nattr.unwrap1({'S':'50'});  // '50'\n\n```\n## Older versions of DynamoDb-Data-Types\n\nRead this only if you need DynamoDb-Data-Types version **1.0.0** or below.\n\nIf you are already using version **1.0.0** or **0.2.7** you may continue to do\nso.\n\nIf you are using DynamoDb-Data-Types version **1.0.0** or **0.2.7**, wrapping / unwrapping `B` and `BS` will not work when used with **AWS SDK 1.x.x**\nbut should automagically work with **AWS SDK 2.x.x.** although it has not been\ntested. This is related to automatic conversion of base64 done by AWS SDK\nversion 2.x. See\n[AWS Upgrading Notes (1.x to 2.0)](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/upgrading.html). \n\n\n# Change log\n\nNote: Change log dates are yyyy-mm-dd.\n\n## Version 4.0.0\n\n+ Introduce support for DynamoDB `UpdateExpression` which uses\n  `ExpressionAttributeValues` and `ExpressionAttributeNames`.\n\n## Version 3.0.3\n\n+ Update code examples and docs\n\nFunctionally, this version is identical to the previous 3.0.2\n\n## Version 3.0.2\n\n+ Update the `lodash` version (used for tests).\n\nFunctionally, this version is identical to the previous 3.0.1\n\n## Version 3.0.1\n\n+ Expose as a CLI utility thanks to @bneigher (github.com/bneigher).\n    \nFunctionally, apart from the CLI utility, this version is identical to the\nprevious 3.0.0\n\n\n## Version 3.0.0\n\n+ For Node users, version `3.0.0` is identical to `2.1.6`\n+ For browser side version of this library\n  - In version `3.0.0` onwards `Buffer` related code has been excluded.\n  - Filesize of the `min.js` version is now `6.5KB`. Earlier it was `40KB`.\n\n## Version 2.1.2 - 2.1.6\n\n+ Added/fixed tests to imporve coverage.\n+ Reviewed docs.\n\nSource code of versions 2.1.2 to 2.1.6 are identical to 2.1.1.\n\n## Version 2.1.2\n\nThis version is identical to 2.1.1 with no changes to code.\nIt only includes a JS build for the browser plus a few more tests.\n\n + Use browserify to create a dist for use in the browser.\n + Updated tests, use travis-ci, coverage, istanbul, .jshintrc.\n\n## Version 2.1.1\n\n2015-12-18\n\n + Replace functions deprecated by Node.\n\n## Version 2.1.0\n\n2015-08-17\n\n + Call `preserveArrays()` to use type `L` for array types; this preserves order of array elements and allows duplicate array elements both of which are not possible using sets `SS`, `NS` or `BS`\n + If not required on a global scale (calling preserveArrays), explicity set array types by passing opts to `wrap()`, `add()`, `put()`\n\n## Version 2.0.1\n\n2015-02-15\n\n + Fixed README\n + Committed modified package.json (just realised it wasn't committed)\n\n## Version 2.0.0 \n\n2015-02-15\n\n + Implemnted `M`\n + Implemented `L`\n + Added example to put and get binary data (examples/02-binary-image.js)\n\n## Version 1.0.0 \n\n2015-02-11\n\n**Note:** There are no source code changes in version 1.0.0.  Functionally,\n1.0.0 is identical to 0.2.7.\n\n  + Bumped from version 0.2.7 to version 1.0.0.\n  + Update documentation especially with regard to `B` and `BS` data types.\n  + Added development deps into pacakge.json instead of tests/package.json\n    (It should have been this way to begin with)\n\n## version 0.2.7\n\n2014-01-29\n\n## version 0.2.6\n\n2013-11-15\n\n## version 0.2.5\n\n2013-11-11\n\n## License\n\n[License](https://github.com/kayomarz/dynamodb-data-types/blob/master/LICENSE)\n","gitHead":"510ea714a06e26c1dec7e343ae77387d255cffb0","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@4.0.0-beta.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-stpwvP+ALzEYMjpVgD4PsIBwP39nrgk9HoWeKa0icXzR96c2JNJH3Bd3ZjWqEaH2V6JZyUeMGdo4zBcTnUGfgw==","shasum":"ec1228caa35a814551946e7aa246b7dbb68135f5","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-4.0.0-beta.2.tgz","fileCount":50,"unpackedSize":323745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvaLyCRA9TVsSAnZWagAAiI8P/iS0Z8zO7rLWpSHiuu33\n/OBOZRoi9zgj1rnXjDzzwliJ4ifQ5ynFIhzB53ehY+mS3BwCdzibgbXOlzI1\nt1cXPPsgoIH/Kc5rLa0MJQKvTTJSxxt75sL2FSe5EfcHIKfNnFdsDHX61Brg\nBi0Su4CCGq0sP6oHzhgczwg/Z72lhxgh/PqwPz6H4/G4PROOfAciIpEazUeD\nP60PrfRIodxzBEdkTOASfXecNaB4uzyiog62Pa9nby9CA6P6uckAcRVdL3Jw\nnU5VSTdsTf7SsjHtG2XHcM716b3ZaY1H1+Baiu3eM18iB34hxpwYQFio328C\nOYjG2klsJ8NDqURWrwZTCsZFK4B36X0YH8p6qZiyLqzxNFnfu4lVcM9PlDFa\nSrQoKq5TBkRbQ3YDaRzSo2LvWAuMZB/XPPxEC7NTxi/LBHeKUy1fKCpTXkNl\nWhjaaJAyoymrTpJ1gKylq7oHIlIJnT7hJ/SgkdPNWuM0lsNxQ44PC0IIUQtZ\nlXll+4a9+ulpj7GtkeYZDQrqBVmyh0ESF6UUoXfaWdVNItxNQLYEryS/4Nmh\nSEtVYjbHv4/TY7sWelRZ2/08n3bJqM9ofbgu66lfyJ05bjxs/5DJ0yBUhW9g\nvl0bKr7/xBfPbpaMBMnSwEW1WOs8AxZKkLY2YeTGX7gA0h0mIHvvDa1SnOEI\nlfHZ\r\n=TWlW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/hHhjIVZkLG+H7Yu1ze+FsWuHf3MENfquBIePFhQliAIhAPKjK9BJPjBvyvvWGFXJeT+2MOGpAP3UgUuPKlegM5Lk"}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_4.0.0-beta.2_1639817970147_0.8548827667145884"},"_hasShrinkwrap":false},"4.0.0":{"name":"dynamodb-data-types","version":"4.0.0","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.44.0","async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","istanbul":"0.4.5","jasmine-node":"1.14.5","jest":"^27.2.4","lodash":"4.17.21","uglify-js":"2.6.1"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test-watch":"jest --watch --testPathIgnorePatterns '\\.online\\.test'","test":"npm run test_ && npm run test-preserve-arrays && jest --silent --testPathIgnorePatterns '\\.online\\.test'","test-include-online":"AWS_PROFILE=dev jest --silent","test_":"istanbul cover --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map dist/dynamodb-data-types.min.map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map dist-with-buffer/dynamodb-data-types.min.map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","dependencies":{"unique-sequence":"1.0.2"},"gitHead":"43453318e83a58e3247a557b05c795c761171e14","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@4.0.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-kbsG66vnviO4tRgfRe/sKqRKiWQwNaOwWgcRR8ql3n0EJNiGcAgE2/TAnnW1D5LKF24QFUt33VBRlxudpJH7zw==","shasum":"969a4bdf14628b97bff5d715df002bd449b2ccc6","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-4.0.0.tgz","fileCount":50,"unpackedSize":323784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvxwdCRA9TVsSAnZWagAAvNoP/2IvC2UGbYT6MwL8GpLQ\nKznYYUSSqfltJSvJhpGgwggWTXC5Q9JuW/TxBa+81PbsKxf453BtrjI+5EdD\nE3Ezg5xgOgya9TAd99yDKb0L7XVeI2fw3Tcn7XHKKi8f7ACee3b3TWKLkNJY\nE1XZwWi0pn6hVJ20uLdGiR1tP7a0h0A82MLCtnRCHwI//48ErfH7HEN4uUeX\n5b49b0Lnb2nJsQtx7KdWdLRQndWfbV5qTKtpDiZaGGnzw1poj9qQoCWWwiAk\n7dYCvt/wse/3RzZ2nJkv0TLXXih5B/6l4TekJtHNX8aM3pXYaQ23ygbtfsqe\nx0/BFhQs4cYujJFXKdrmzMen6mUI2BVZUARAUSgFCfjCbtA9e0u95FP+iifz\noWZsVhCmvfBLFmlWqsylwykoP4B6rlQ4NkB5BdXY/r7aQBlCYHEtQz2hzcxz\nLzx9Yi/R31g9m3RWiZHfpOawEZamhxa2laUBpf0a0a2anC77nd4Gv/LYSNFQ\nBpECPL67mZc4KdnM+OxCxBv9N4svWIxEIhKDnZu4buMEBv/lH3/xLTJeQzc6\nx2yIFHNgXumqRBVFsHSzKIXyyI2qXeFpKDptdx5Ml1Jzu/s72GNMQgYsL1R2\n4D9XRSglQR6t/6NCFAPEd/c2tvv3/DFUljfAJXVvbsYeA4OrhXVAGLSfHcE/\n8bqF\r\n=qK/X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGr9wwtxXoH7xxPweE9x7p/z5aB1vH+PP//rnACde14AIgTkS9MhxeF0DEOTO6DzP7SCFwwnJ8vK9kgf4Q5a6OqVk="}]},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_4.0.0_1639914525594_0.05281428172127711"},"_hasShrinkwrap":false},"4.0.1":{"name":"dynamodb-data-types","version":"4.0.1","description":"A utility to help represent Amazon DynamoDB Data Types.","main":"./lib/dynamodb-data-types.js","bin":{"dynamo-dt-attr-unwrap":"bin/unwrap.js","dynamo-dt-attr-wrap":"bin/wrap.js"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.44.0","async":"0.2.9","aws-sdk":"2.1.10","browserify":"12.0.2","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","istanbul":"0.4.5","jasmine-node":"1.14.5","jest":"^27.2.4","lodash":"4.17.21","uglify-js":"^3.17.4"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"scripts":{"test-watch":"jest --watch --testPathIgnorePatterns '\\.online\\.test'","test":"npm run test_ && npm run test-preserve-arrays && jest --silent --testPathIgnorePatterns '\\.online\\.test'","test-include-online":"AWS_PROFILE=dev jest --silent","test_":"istanbul cover --dir coverage/spec --root lib jasmine-node tests/spec","test-preserve-arrays":"istanbul cover --dir coverage/spec-preserve-arrays --root lib jasmine-node tests/spec-preserve-arrays","build":"npm run build-browser && npm run build-browser-with-buffer","build-browser":"browserify --ignore buffer browser.js > dist/dynamodb-data-types.js && uglifyjs dist/dynamodb-data-types.js --source-map -o dist/dynamodb-data-types.min.js","build-browser-with-buffer":"browserify browser.js > dist-with-buffer/dynamodb-data-types.js && uglifyjs dist-with-buffer/dynamodb-data-types.js --source-map -o dist-with-buffer/dynamodb-data-types.min.js","dynamo-dt-attr-unwrap":"./bin/unwrap.js","dynamo-dt-attr-wrap":"./bin/wrap.js"},"keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"license":"MIT","dependencies":{"unique-sequence":"1.0.2"},"gitHead":"4e7f23f9ce6b185a7488c54a951a7d91de491133","bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","_id":"dynamodb-data-types@4.0.1","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-tzGarrYuMH6PX6wAOOt2tdEb8vvea4NgEKFDcqbHeqwyQ6Pe3QR3nvPsNX4E5SElqfh0HX3dQk4VITbAjNvRIA==","shasum":"401264715f0e36b6fdfe976166cdd98da29df9fe","tarball":"https://registry.npmjs.org/dynamodb-data-types/-/dynamodb-data-types-4.0.1.tgz","fileCount":50,"unpackedSize":401366,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK5ROyccfm6lEGq+5huzpz0fPLyme1pfDSEnDL5WQGVwIhAMazuOkM/SaUhLI2Ia44qbY24uypjMdRKlQufFb7SScj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV9FXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmosbg/9H4Y77gCrMts7TXUQ/eAn1sPL1tv1JQSt49vF7gi3UalfWl7L\r\nHGWjBqsEmFKF2ifklnF8YgBEQGe15b12bRyM4tVCivamUUM9Ek+WJU05jQLm\r\nSuKGof8t3mmetaNJhkWrTvWJYpMZivGWrb8AjKG8m+vKZng2uEZawjUVfenm\r\nqDUt47xvb8VZ7NStzwypuydVYfeeeotOdEkunFNieQ7Bv60q7Yt0/2XO7EiC\r\nPAr9chXDl3fPH8Yojjg391a56PF0rOVYR4Zk7bOyXZ8abxgKdvk+0muxuoSp\r\nU8+JB3LN4JawTemsAskws0+P+asP/LdqfyT6yQqdXIOq44z+ih+gce73aeJU\r\n1zd4k9/4YolLnT2IML791lJDWWhyqB63Tn4zYvJykjq15d4rxAhoD8FcAwu1\r\nl7FOrUyR4lIujF/qEfw6UQXp7svSVuD00IsdVOwwZzd4VXv8ib6L3jt/fLCR\r\ntrYoTcXKLvwqMKtDuUxCFClEwDNemvrDenhIR5pw0njUsGtsw2mN+Zs+AHOi\r\n+oYHoYE6VPFggzO27xF6dfIgxHCu8Ia6mYbNFBr2AeFv4FGq1AXTLgA7zP2u\r\nc5FktT+KsoiQct260BWsLFI2H1yWSECKKg/BtZmQ9V6LanGSoQqqZ8FVC7j3\r\n1jN9XPITpqzsUohexWpaSfr37AvzC+LZYzs=\r\n=S2xr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kayomarz","email":"kayomarz@gmail.com"},"directories":{},"maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamodb-data-types_4.0.1_1666699607367_0.8964472782131152"},"_hasShrinkwrap":false}},"readme":"# dynamodb-data-types\n\n[![Build Status](https://travis-ci.org/kayomarz/dynamodb-data-types.svg)](https://travis-ci.org/kayomarz/dynamodb-data-types)\n[![Coverage Status](https://coveralls.io/repos/kayomarz/dynamodb-data-types/badge.svg?branch=master&service=github)](https://coveralls.io/github/kayomarz/dynamodb-data-types?branch=master)\n\nA JavaScript utility to help represent DynamoDB data types and records.\n\n**New** ver 4.0.0 of this library generates DynamoDB `UpdateExpression`. [updateExpr()](#updateExpr).\n\n## Introduction\n\nDynamoDB represents the JavaScript number `1` as `{N:'1'}`.\n\nThis utility helps convert between such representations.\n\n```\n JavaScript             DynamoDB\n------------------------------------------------\n-1                {N: '-1'}\n'Hello'           {S: 'Hello'}\ntrue              {BOOL: true}\nNULL              {NULL: true}\n{a:1, b:''}       {M: {a: {N: '1'}, b: {S: ''}}}\n```\n\n## Getting Started\n\n### `wrap`, `unwrap` to convert (marshall) JavaScript data.\n\n```js\nconst attr = require('dynamodb-data-types').AttributeValue;\n\nconst data = {\n  id: 10,\n  food: ['Rice', 33, null],\n  obj: {a:1, b:true},\n};\n\nconst wrapped = attr.wrap(data); // wrap (marshall) data to use with DynamoDB\n/* Returns:\n * {\n *   id:{N:\"10\"},\n *   food:{L:[{S:\"Rice\"},{N:\"33\"},{NULL:true}]},\n *   obj:{M:{a:{N:\"1\"},b:{BOOL:true}}}\n * } */\n\nattr.unwrap(wrapped); // unwrap (unmarshall) data\n/* Returns:\n * {\n *   id: 10,\n *   food: ['Rice', 33, null],\n *   obj: {a:1, b:true},\n * } */\n```\n\nUse `wrap1` and `unwrap1` for single primitive values, \n\n```js\nattr.wrap1(50);         // { N: '50' }\nattr.unwrap1({N:'50'}); // 50\n```\n\n<a name=\"updateExpr\" id=\"updateExpr\"></a>\n\n### `updateExpr()` for DynamoDB `UpdateExpression`\n\nLet's say you want to update `color` in a item or record. DynamoDB `UpdateItem`\nAPI requires you to provide a `UpdateExpression` as follows:\n\n```js\n{\n  UpdateExpression: \"SET color = :a\",\n  ExpressionAttributeValues: {\":a\":{\"S\":\"red\"}}}\n}\n```\n\nInstead of attribute `color`, if you want to update `year` to `2013` then you\nhave to do one more step because `year` is a reserved keyword:\n\n```js\n{\n  UpdateExpression\":\"SET #A = :a\",\n  ExpressionAttributeValues: {\":a\":{S:\"2013\"}},\n  ExpressionAttributeNames :{\"#A\":\"year\"}}\n}\n```\n\nUse this library to generate the above for you as follows:\n\n```js\nconst { updateExpr } = require('dynamodb-data-types');\nupdateExpr().set({ name: 'foo' }).expr();\n```\n\nBelow is a more comprehensive example:\n\n```js\nconst { updateExpr } = require('dynamodb-data-types');\n\nupdateExpr()             // Call updateExpr()\n  .set({ a: 'foo' })     // chain multiple clauses\n  .add({ n: 1 })\n  .remove('rat', 'bat')\n  .set({ sky: 'blue'})\n  .delete({ day: ['Mon'] }) // 'day' is a reserved keyword\n  .remove('hi')\n  .expr(); // In the end expr() returns the UpdateExpression\n// After .expr(), we cannot chain any more clauses (set,remove,add,delete)\n\n/* Returns:\n{\n * UpdateExpression: \"SET a = :a, sky = :b REMOVE rat, bat, hi ADD n :c DELETE #A :d\",\n * ExpressionAttributeValues: {\":a\":{S:\"foo\"},\":b\":{S:\"blue\"},\":c\":{N:\"1\"},\":d\":{SS:[\"Mon\"]}},\n * ExpressionAttributeNames:{\"#A\":\"day\"}} // Because 'day' is a reserved keyword\n * } */\n```\n\n### `UpdateExpression` clauses `SET`, `REMOVE`, `ADD`, `DELETE`\n\n`updateExpr().set()`, `remove()`, `add()`, `delete()`, are the same clauses\ndefined by DynamoDB `UpdateExpression`. Each clause is said to contain one or\nmore `action`. See [AWS\ndocumentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html)\nfor more.\n\n### `updateExpr()` handles DynamoDB reserved keywords.\n\n*updateExpr()* avoids conflict with [keywords reserved by\nDynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html). To\ndemonstrate this, the below example uses the conflicting keyword `year`.\n\nA more complete example:\n\n```js\nconst { wrap } = require('dynamodb-data-types').AttributeValue;\nconst { updateExpr } = require('dynamodb-data-types');\nconst { DynamoDBClient, UpdateItemCommand, PutItemCommand } = require('@aws-sdk/client-dynamodb');\nconst TableName = 'FooTable';\nconst client = new DynamoDBClient({ region: 'us-east-1' });\n\nconst updates = updateExpr()    // Call updateExpr()\n      .set({ greet: 'Hello' })  // chain multiple clauses\n      .remove('foo', 'city')\n      .add({ age: 1 })\n      .set({ nick: 'bar' })\n      .remove('baz')\n      .delete({ year: [2008] }) // 'year' is a reserved keyword\n      .add({ amt: 1.5 });\n\n// Use expr() to get the UpdateExpression data structures\nconst { UpdateExpression,  ExpressionAttributeValues, ExpressionAttributeNames } = updates.expr();\n\n// After .expr(), we cannot chain any more clauses (set,remove,add,delete)\n\n/* Generated data structures:\n * {\n *   UpdateExpression:\n *    'SET greet = :a, nick = :b REMOVE foo, baz ADD age :c, amt :d DELETE #A :e',\n *\n *   ExpressionAttributeValues: {\n *     ':a': { S: 'Hello' },\n *     ':b': { S: 'bar' },\n *     ':c': { N: '1' },\n *     ':d': { N: '1.5' },\n *     ':e': { NS: [Array] }\n *   },\n *\n *   ExpressionAttributeNames: { '#A': 'year' } // Because year is a reserved keyword\n * }\n */\n\nconst params = {\n  TableName,\n  Key: wrap({ id: 10 }),\n  UpdateExpression,\n  ExpressionAttributeValues,\n  ExpressionAttributeNames,\n};\n\n/* TIP: For shorter code, use ...updates.expr()\n * const params = {\n *   TableName,\n *   Key: wrap({ id: 10 }),\n *   ...updates.expr()\n * };\n */\n\nclient.send(new UpdateItemCommand(params));\n```\n\n#### `updateExpr()` avoids creating duplicate values\n\nAs demonstrated below, `updateExpr()` avoids creating duplicates in\n`ExpressionAttributeValue` by using `===` internally.\n\n```js\n\n  /* Different action values across clauses.\n   * Hence ExpressionAttributeValues has three items.\n   */\n  const expr0 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 2 })\n        .add({ y: 3 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b ADD y :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' },\n  //     ':b': { N: '2' },\n  //     ':c': { N: '3' },\n  //   }\n  // }\n\n\n  /* Identical action values across clauses.\n   * Hence ExpressionAttributeValues has only one item.\n   */\n  const expr1 = updateExpr()\n        .set({ w: 1 })\n        .set({ x: 1 })\n        .add({ y: 1 })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :a ADD y :a',\n  //   ExpressionAttributeValues: {\n  //     ':a': { N: '1' }\n  //   }\n  // }\n```\n\n#### Roadmap TODO\n\nTo avoid duplicate values in ExpressionAttributeValues, apart from doing a\nstrict equality check using '===', allow a deep equality to avoid duplicates.\n\nBelow, value is the same array for all actions/clauses.\nHence there should be 1 entry in ExpressionAttributeValues.\n\nHowever there are 3 entries.\n\nIt might be a good feature to do a deep equality and ensure 1 entry in ExpressionAttributeValues.\n\n```js\n  const expr0 = updateExpr()\n        .set({ w: [1, 2, 3] })\n        .set({ x: [1, 2, 3] })\n        .set({ y: [1, 2, 3] })\n        .expr();\n  // {\n  //   UpdateExpression: 'SET w = :a, x = :b, y = :c',\n  //   ExpressionAttributeValues: {\n  //     ':a': { NS: ['1', '2', '3'] },\n  //     ':b': { NS: ['1', '2', '3'] },\n  //     ':c': { NS: ['1', '2', '3'] },\n  //   }\n  // }\n```\n\nSee\n[examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\nfor full example of generated DynamoDB structures `UpdateExpression`,\n`ExpressionAttributeValues`, `ExpressionAttributeNames`.\n\n\n\n### Use with Node.js\n\nUse with [AWS SDK for Node.js](https://aws.amazon.com/sdk-for-node-js/)\n\n    npm install dynamodb-data-types\n\n\n### Use in cli\n\nUse with the cli for quick utility\n\n    npm install -g dynamodb-data-types\n    dynamo-dt-attr-wrap '{'hello':'world'}'\n    dynamo-dt-attr-unwrap '{'hello': {'S': 'world'}}'\n\n\n### Use in the browser\n\nUse with [AWS SDK for JS in the Browser](https://aws.amazon.com/sdk-for-browser/)\n\nDownload the browser version from [dist](dist).\n\nSee [examples/browser](examples/browser) and [this note](#browserNotes)\n\n\n<a name=\"browserNotes\" id=\"browserNotes\"></a>\n\n## Notes for use in the browser\n\nThe browser version of this library (created using\n[browserify](http://browserify.org/)) has not been tested. Pull\nrequests to add tests for the browser are welcome (maybe using phantom.js?).\n\nThe browser version is available from version `2.1.2` onwards.\n\n\n### File size of the browser version\n\nThe browser version of this library is generated using\n[Browserify](http://browserify.org/).\n\nFor versions `3.0.0` onwards of this library, `browserify` is made to exclude\n`Buffer` related code. It is less likely for a browser side application to make\nuse of `Buffer` as a binary type.\n\nIf you don't need detailed info about this, skip the next paragraph.\n\nThis library uses node's [Buffer](https://nodejs.org/api/buffer.html) for\nrecognizing binary types. By default, browserify, includes external `Buffer`\nrelated code, causing the filesize of the browser dist to become 5.4\ntimes larger (6x if you compare `min.js` files). Version `3.0.0` onwards,\nbrowserify is made to exclude `Buffer` related code because it seems less\nlikely for browser side code to detect `Buffer` as a binary type. Incase your\nbrowser application does require `Buffer` you might try using\n[dist-with-buffer](dist-with-buffer)\n\n\n## Examples\n\n + [examples/01-put-and-update-expression.js](examples/01-put-and-update-expression.js)\n + [examples/02-binary-image.js](examples/02-binary-image.js)\n + [examples/03-explicit-data-type.js](examples/03-explicit-data-type.js)\n + [examples/04-explicit-preserve-arrays.js](examples/04-explicit-preserve-arrays.js)\n + [examples/browser/dynamodb-data-types.html](examples/browser/dynamodb-data-types.html) \n + [examples/depricated-01-put-update.js](examples/depricated-01-put-update.js)\n\n## Features\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Types.html)\n\nDynamoDb-Data-Types supports:\n\n * AttributeValue\n * UpdateExpression\n * ExpressionAttributeValues\n * ExpressionAttributeNames\n * AttributeValueUpdate  ([Deprecated](README-deprecated.md) in favour of UpdateExpression)\n\n## Supported AttributeValue types\n\nRefer to\n[docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html)\n\nDynamoDb-Data-Types supports:\n\n + B\n + BOOL\n + BS\n + L\n + M\n + N\n + NS\n + NULL\n + S\n + SS\n\n## preserveArrays\n\n(New in version 2.1.0)\n\nConsider the following:\n\n```javascript\n\nconst data = {\n  alphabets: ['c', 'a', 'b', 'c']\n};\n\n```\n\n`wrap(data)` detects `alphabets` as `SS`. Being a set `SS` has two properties unlike those of arrays :\n\n + The order of elements is not preserved.\n + Duplicate elements are not allowed.\n\nStarting with version **2.1.0**, you can do:\n\n + `wrap(data, {types: {alphabets: 'L'} }` to explicitly tell wrap to treat it `L` instead of the auto-detected `SS`. Similarly for `put()` and `add()`\n + Alternatively, call `preserveArrays()` to consider all arrays as type `L`. This has a global effect.\n\nRead the documentation and examples for more.\n\n\n## Support for `BOOL`, `NULL`, `M`, `L`\n\n(new in version 2.0.0)\n\nDynamoDb-Data-Types version 2.0.0 introduces support for **AttributeValue**\ntypes `BOOL`, `NULL`, `M`, `L`.\n\n\n### Use of `M` for nested data\n\nDynamoDb-Data-Types uses `M` to nest objects. Consider the following data:\n\n```js\nconst data = {\n  polygon: {\n    quadrilateral: {\n        sides: 4\n    }\n  }\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  'polygon': {\n    'M': {\n      'quadrilateral': {\n        'M': {\n          'sides': {\n            'N': '4'\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### Use of `L` for arrays\n\nDynamoDb-Data-Types uses `L` to represent mixed arrays. Consider the following data:\n\n```js\n{\n  strs: ['abc', 'def'],\n  nums: [123, 456],\n  mix: [1, 'abc', true, false, null, [1,2,3]]\n}\n```\n\n`wrap()` maps the above data as:\n\n```js\n{\n  strs: { \n    SS: ['abc','def'] \n  },\n  nums: { \n    NS: ['123','456'] \n  },\n  mix: {\n    'L': [\n      { N: '1' },\n      { S: 'abc' },\n      { BOOL: true },\n      { BOOL: false },\n      { NULL: true },\n      { NS: ['1','2','3'] }\n    ]\n  }\n}\n```\n\n## Detecting data types\n\nIt is straightforward to detect types `N`, `NS`, `S`, `SS`, `NULL` and `BOOL`.\nTo detect other types - `M`, `L`, `B`, `BS` - simple rules are applied as\nexplained below.\n\nFor any a given value `val`, `wrap()` detects the AWS Data types as follows:\n\n### BOOL, NULL, N, S\n\nHow `wrap()` detects them (psuedo-code):\n\n    IF val is typeof boolean\n        THEN detect as type BOOL\n    ELSE IF val is null\n        THEN detect as type NULL\n    ELSE IF val is typeof number or if val instanceof Number\n        THEN detect as type N\n    ELSE IF val is typeof string or if val is instanceof String\n        THEN detect as type S\n\n### B\n\nHow `wrap()` detects type `B` (psuedo-code):\n\n    IF val is instanceof Buffer\n        THEN detect as type B\n\nThere maybe other types which should get detected as `B`. Please let me know if\nyou have suggestions.\n\n### M\n\nHow `wrap()` detects type `M` (psuedo-code):\n\n    IF (val is none of: BOOL, NULL, N, S, B)\n        AND (typeof val === 'object')\n            THEN detect as type M\n    ELSE\n        wrap() ignores val\n\n### NS, SS, BS, L\n\nWhen `wrap()` sees an Array, here's what it does (psuedo-code):\n\n    IF val is an Array\n        IF (every element in Array is type N)\n            THEN detect as type NS\n        ELSE IF (every element in Array is type S)\n            THEN detect as type SS\n        ELSE IF (every element in Array is type B)\n            THEN detect as type BS\n        ELSE \n            detect as type L\n\n\n## API - Reference documentation\n\n### Global settings\n\n#### preserveArrays()\n\nIf `preserveArrays()` is called, all arrays found in the object being wrapped\nare given type `L`. In other words, arrays will no longer get detected as `NS`,\n`SS` or `BS` but specified as `L`.\n\nThis is useful to preserve duplicates and the order of elements in arrays.\n\n    const ddt = require('dynamodb-data-types');\n    ddt.preserveArrays();\n\nThis function is designed to be called once - It has a global effect.\n\nIf this is not needed on a global level, a similar effect can be achieved using\n`options` parameter passed to `wrap()`, `wrap1()` and `put()` and `add()`.\n\nSimilarly, the global behaviour of `preserveArrays()` may be overridden using\nthe `options` object passed to  `wrap()`, `wrap1()` and `put()` and `add()`.\n\n\n### AttributeValue\n[AWS API Reference -\nAttributeValue](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html) \n\n* [wrap](#wrap)\n* [unwrap](#unwrap)\n* [wrap1](#wrap1)\n* [unwrap1](#unwrap1)\n\n### updateExpr() for DynamoDB `Update`\n\n[AWS API Reference -\nUpdate](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Update.html)\n* UpdateExpression\n* ExpressionAttributeValues\n* ExpressionAttributeNames\n\nSee [updateExpr()](#updateExpr) above for detailed usage examples.\n\n### AttributeValueUpdate (Depricated)\n\n**Deprecated!** Use [updateExpr()](#updateExpr) instead.\n\n  To use AttributeValueUpdate (Depricated) see [README-deprecated](README-deprecated.md)\n  \n## AttributeValue\n\n<a name=\"wrap\" id=\"wrap\"></a>\n\n### wrap(item[, options])\n\nWrap (marshall) JavaScript data into DynamoDB's AttributeValue data type.\n\n#### Arguments\n\n * @param {Object} item The object to wrap.\n * @param {Object} options\n * @return {Object} A DynamoDB AttributeValue.\n\n##### Options\n\n* `types`: An object containing attribute names and explicit type for that\nattribute. Currently explicit type can only be specified if the detected type is\nan array. Possible values are `'NS'`, `'SS'`, `'BS'`, `'L'`\n\nExample of an options object:\n\n```javascript\n// Any property named 'randomList' found in the object (at any depth) is\n// specified as 'NS'. This explicit type can be assigned only if `randomList` is\n// detected as an array.\n\n// Similarly if 'orderedList' is an array, it gets specified as type 'L'\n\n{\n  types: {\n     randomList: 'NS', \n     orderedList: 'L'\n  }\n}\n```\n\n\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap({name: 'Foo', age: 50});\n// {'name':{'S':'Foo'},'age':{'N':'50'}}\n\nattr.wrap({alphabets: ['a', 'b', 'c']});\n// {'alphabets':{'SS': ['a','b','c']}}\n\nattr.wrap({alphabets: ['a', 'b', 'c']}, {types: {alphabets:'L'}});\n// {'alphabets':{'L': [{'S':'a'},{'S':'b'},{'S': 'c'}]}}\n```\n\n<a name=\"unwrap\" id=\"unwrap\"></a>\n\n### unwrap(attributeValue)\n\nUnwrap (unmarshall) DynamoDB AttributeValue to appropriate\nJavaScript types.\n\n#### Arguments\n\n * @param {Object} attributeValue The DynamoDB AttributeValue to unwrap.\n * @return {Object} Unwrapped object with properties.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap({'name':{'S':'Foo'},'age':{'N':'50'}});\n// {name: 'Foo', age: 50}\n```\n\n<a name=\"wrap1\" id=\"wrap1\"></a>\n\n### wrap1(value [, options])\n\nWrap a single value into DynamoDB's AttributeValue.\n\n#### Arguments\n\n * @param {String|Number|Array} \n * @param {Object} options Same as options for wrap().\n * @return {Object} DynamoDB AttributeValue.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.wrap1(50);    // {'N':'50'}\nattr.wrap1('50');  // {'S':'50'}\n```\n\n<a name=\"unwrap1\" id=\"unwrap1\"/></a>\n\n### unwrap1(attributeValue)\n\nUnwrap a single DynamoDB's AttributeValue to a value of the appropriate\nJavaScript type. \n\n#### Arguments\n\n@param {Object} attributeValue The DynamoDB AttributeValue.\n@return {String|Number|Array}  The JavaScript value.\n\n__Example__\n\n```javascript\nconst attr = require('dynamodb-data-types').AttributeValue;\nattr.unwrap1({'N':'50'});  // 50\nattr.unwrap1({'S':'50'});  // '50'\n\n```\n## Older versions of DynamoDb-Data-Types\n\nRead this only if you need DynamoDb-Data-Types version **1.0.0** or below.\n\nIf you are already using version **1.0.0** or **0.2.7** you may continue to do\nso.\n\nIf you are using DynamoDb-Data-Types version **1.0.0** or **0.2.7**, wrapping / unwrapping `B` and `BS` will not work when used with **AWS SDK 1.x.x**\nbut should automagically work with **AWS SDK 2.x.x.** although it has not been\ntested. This is related to automatic conversion of base64 done by AWS SDK\nversion 2.x. See\n[AWS Upgrading Notes (1.x to 2.0)](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/upgrading.html). \n\n\n# Change log\n\nNote: Change log dates are yyyy-mm-dd.\n\n## Version 4.0.1\n\n+ fix `updateExpr().remove()` so that it handles [reserved\n  keywords](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html). This\n  fixes [issue #18\n  (github)](https://github.com/kayomarz/dynamodb-data-types/issues/18)\n\n## Version 4.0.0\n\n+ Introduce `updateExpr()` to generate DynamoDB `UpdateExpression` used to\n  update an item.\n\n2021-12-19\n\n## Version 3.0.3\n\n+ Update code examples and docs\n\nFunctionally, this version is identical to the previous 3.0.2\n\n## Version 3.0.2\n\n+ Update the `lodash` version (used for tests).\n\nFunctionally, this version is identical to the previous 3.0.1\n\n## Version 3.0.1\n\n+ Expose as a CLI utility thanks to @bneigher (github.com/bneigher).\n    \nFunctionally, apart from the CLI utility, this version is identical to the\nprevious 3.0.0\n\n\n## Version 3.0.0\n\n+ For Node users, version `3.0.0` is identical to `2.1.6`\n+ For browser side version of this library\n  - In version `3.0.0` onwards `Buffer` related code has been excluded.\n  - Filesize of the `min.js` version is now `6.5KB`. Earlier it was `40KB`.\n\n## Version 2.1.2 - 2.1.6\n\n+ Added/fixed tests to imporve coverage.\n+ Reviewed docs.\n\nSource code of versions 2.1.2 to 2.1.6 are identical to 2.1.1.\n\n## Version 2.1.2\n\nThis version is identical to 2.1.1 with no changes to code.\nIt only includes a JS build for the browser plus a few more tests.\n\n + Use browserify to create a dist for use in the browser.\n + Updated tests, use travis-ci, coverage, istanbul, .jshintrc.\n\n## Version 2.1.1\n\n2015-12-18\n\n + Replace functions deprecated by Node.\n\n## Version 2.1.0\n\n2015-08-17\n\n + Call `preserveArrays()` to use type `L` for array types; this preserves order of array elements and allows duplicate array elements both of which are not possible using sets `SS`, `NS` or `BS`\n + If not required on a global scale (calling preserveArrays), explicity set array types by passing opts to `wrap()`, `add()`, `put()`\n\n## Version 2.0.1\n\n2015-02-15\n\n + Fixed README\n + Committed modified package.json (just realised it wasn't committed)\n\n## Version 2.0.0 \n\n2015-02-15\n\n + Implemnted `M`\n + Implemented `L`\n + Added example to put and get binary data (examples/02-binary-image.js)\n\n## Version 1.0.0 \n\n2015-02-11\n\n**Note:** There are no source code changes in version 1.0.0.  Functionally,\n1.0.0 is identical to 0.2.7.\n\n  + Bumped from version 0.2.7 to version 1.0.0.\n  + Update documentation especially with regard to `B` and `BS` data types.\n  + Added development deps into pacakge.json instead of tests/package.json\n    (It should have been this way to begin with)\n\n## version 0.2.7\n\n2014-01-29\n\n## version 0.2.6\n\n2013-11-15\n\n## version 0.2.5\n\n2013-11-11\n\n## License\n\n[License](https://github.com/kayomarz/dynamodb-data-types/blob/master/LICENSE)\n","maintainers":[{"name":"kayomarz","email":"kayomarz@gmail.com"}],"time":{"modified":"2022-10-25T12:06:47.997Z","created":"2013-11-06T08:21:07.314Z","0.1.0":"2013-11-06T08:21:17.633Z","0.1.1":"2013-11-06T08:22:53.480Z","0.1.2":"2013-11-06T09:21:50.824Z","0.2.0":"2013-11-08T11:26:54.914Z","0.2.1":"2013-11-08T11:35:49.075Z","0.2.2":"2013-11-08T11:39:43.434Z","0.2.4":"2013-11-11T16:08:59.127Z","0.2.5":"2013-11-11T16:24:21.646Z","0.2.6":"2013-11-15T15:32:40.564Z","0.2.7":"2014-01-29T13:24:50.018Z","1.0.0":"2015-02-11T06:14:53.639Z","2.0.0":"2015-02-15T11:48:49.927Z","2.0.1":"2015-02-15T12:11:44.266Z","2.1.0":"2015-08-17T11:39:36.736Z","2.1.1":"2015-12-18T17:30:12.845Z","2.1.2":"2015-12-24T06:28:18.046Z","2.1.3":"2016-01-22T16:26:02.752Z","2.1.4":"2016-01-23T11:57:54.844Z","2.1.5":"2016-01-23T12:00:42.429Z","2.1.6":"2016-01-25T17:21:54.363Z","3.0.0":"2016-07-10T13:13:33.346Z","3.0.1":"2018-03-01T14:17:39.016Z","3.0.2":"2021-12-12T10:22:41.652Z","3.0.3":"2021-12-14T15:41:20.429Z","4.0.0-beta.0":"2021-12-15T02:25:40.065Z","4.0.0-beta.1":"2021-12-17T20:24:48.306Z","4.0.0-beta.2":"2021-12-18T08:59:30.332Z","4.0.0":"2021-12-19T11:48:45.807Z","4.0.1":"2022-10-25T12:06:47.921Z"},"author":{"name":"Kayomarz","email":"kayomarz@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/kayomarz/dynamodb-data-types.git"},"readmeFilename":"README.md","homepage":"https://github.com/kayomarz/dynamodb-data-types#readme","keywords":["dynamodb data types","dynamodb marshall","dynamodb format attributes","dynamodb mapper","amazon","aws"],"bugs":{"url":"https://github.com/kayomarz/dynamodb-data-types/issues"},"license":"MIT","users":{"vwal":true,"ckaatz":true,"arichiardi":true,"genovo":true,"hyperlink":true,"kang85":true,"godoshian":true,"kodekracker":true,"arijusg":true,"flybondi-nelson-ro":true,"hpieroni":true}}