Comparing version 1.0.0 to 1.0.1
@@ -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 @@ |
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(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
123804
2268
0
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedaws-sdk@2.1692.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@4.9.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedevents@1.1.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedieee754@1.1.13(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjmespath@0.16.0(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedpunycode@1.3.2(transitive)
+ Addedquerystring@0.2.0(transitive)
+ Addedsax@1.2.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedurl@0.10.3(transitive)
+ Addedutil@0.12.5(transitive)
+ Addeduuid@8.0.0(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedxml2js@0.6.2(transitive)
+ Addedxmlbuilder@11.0.1(transitive)
Updatedaws-sdk@^2.2.18