Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dyno

Package Overview
Dependencies
Maintainers
30
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dyno - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## v1.0.1
- fixes a bug in converting JavaScript arrays to DynamoDB Sets if the first item in the array is falsy (e.g `0`)
## v1.0.0

@@ -2,0 +6,0 @@

2

index.js
var AWS = require('aws-sdk');
var DynamoDBSet = require('aws-sdk/lib/dynamodb/set');
var _ = require('underscore');

@@ -346,3 +347,2 @@

Dyno.createSet = function(list) {
var DynamoDBSet = require('aws-sdk/lib/dynamodb/set');
return new DynamoDBSet(list);

@@ -349,0 +349,0 @@ };

@@ -51,5 +51,6 @@ var _ = require('underscore');

return Object.keys(obj).reduce(function(item, key) {
item[key] = converter.output(obj[key]);
var value = converter.output(obj[key]);
item[key] = value;
return item;
}, {});
};
{
"name": "dyno",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simple DynamoDB client",

@@ -18,3 +18,3 @@ "main": "index.js",

"dependencies": {
"aws-sdk": "https://github.com/aws/aws-sdk-js/tarball/master",
"aws-sdk": "^2.2.18",
"big.js": "^3.1.3",

@@ -21,0 +21,0 @@ "event-stream": "^3.3.2",

@@ -110,2 +110,15 @@ var test = require('tape');

test('[index] Dyno.createSet always yields a typed set', function(assert) {
var convert = require('aws-sdk/lib/dynamodb/converter').input;
assert.equal(Dyno.createSet(['a', 'b']).type, 'String', 'sets string type');
assert.equal(Dyno.createSet([1, 2]).type, 'Number', 'sets number type');
assert.equal(Dyno.createSet([new Buffer('hello')]).type, 'Binary', 'sets buffer type');
assert.equal(Dyno.createSet(['']).type, 'String', 'sets string type on falsy value');
assert.equal(Dyno.createSet([0]).type, 'Number', 'sets number type on falsy value');
assert.deepEqual(convert(Dyno.createSet([0])), { NS: [ '0' ] }, 'set with falsy number value converts to appropriate wire-formatted object');
assert.deepEqual(convert(Dyno.createSet([''])), { SS: [ '' ] }, 'set with falsy string value converts to appropriate wire-formatted object');
assert.end();
});
test('[index] configuration', function(assert) {

@@ -112,0 +125,0 @@ var config = {

@@ -160,1 +160,13 @@ var Dyno = require('..');

});
test('[serialization] deserialize string containing falsy set', function(assert) {
var str = JSON.stringify({ set: { NS: [0] } });
var obj = Dyno.deserialize(str);
assert.deepEqual(obj, {
set: {
type: 'Number',
values: [0]
}
}, 'success');
assert.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc