@aws/dynamodb-data-marshaller
Advanced tools
Comparing version
export * from './InvalidSchemaError'; | ||
export * from './InvalidValueError'; | ||
export * from './isKey'; | ||
export * from './marshallItem'; | ||
export * from './marshallKey'; | ||
export * from './Schema'; | ||
export * from './SchemaType'; | ||
export * from './toSchemaName'; | ||
export * from './unmarshallItem'; |
@@ -6,6 +6,9 @@ "use strict"; | ||
tslib_1.__exportStar(require("./InvalidValueError"), exports); | ||
tslib_1.__exportStar(require("./isKey"), exports); | ||
tslib_1.__exportStar(require("./marshallItem"), exports); | ||
tslib_1.__exportStar(require("./marshallKey"), exports); | ||
tslib_1.__exportStar(require("./Schema"), exports); | ||
tslib_1.__exportStar(require("./SchemaType"), exports); | ||
tslib_1.__exportStar(require("./toSchemaName"), exports); | ||
tslib_1.__exportStar(require("./unmarshallItem"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { SchemaType } from "./SchemaType"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Schema } from "./Schema"; |
@@ -7,2 +7,3 @@ "use strict"; | ||
var dynamodb_auto_marshaller_1 = require("@aws/dynamodb-auto-marshaller"); | ||
var bytes = require('utf8-bytes'); | ||
/** | ||
@@ -61,3 +62,3 @@ * Converts a JavaScript object into a DynamoDB Item. | ||
if (schemaType.type === 'Binary') { | ||
if (input.byteLength === 0) { | ||
if (!input || input.length === 0 || input.byteLength === 0) { | ||
return { NULL: true }; | ||
@@ -193,3 +194,8 @@ } | ||
} | ||
return marshallSet(input, marshallBinary, function (bin) { return bin.byteLength === 0; }, 'BS'); | ||
return marshallSet(input, marshallBinary, function (bin) { | ||
if (typeof bin === 'string') { | ||
return bin.length === 0; | ||
} | ||
return bin.byteLength === 0; | ||
}, 'BS'); | ||
} | ||
@@ -249,3 +255,3 @@ if (schemaType.memberType === 'Number') { | ||
} | ||
throw new InvalidValueError_1.InvalidValueError(input, 'Unable to serialize provided value as binary'); | ||
return Uint8Array.from(bytes(input)); | ||
} | ||
@@ -252,0 +258,0 @@ function marshallNumber(input) { |
@@ -0,0 +0,0 @@ import { SchemaType } from "./SchemaType"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { AttributeValue } from 'aws-sdk/clients/dynamodb'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Schema } from "./Schema"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@aws/dynamodb-data-marshaller", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "A schema-based data marshaller for Amazon DynamoDB", | ||
@@ -27,5 +27,6 @@ "main": "./build/index.js", | ||
"dependencies": { | ||
"@aws/dynamodb-auto-marshaller": "^0.2.1", | ||
"@aws/dynamodb-expressions": "^0.2.1", | ||
"tslib": "^1.8" | ||
"@aws/dynamodb-auto-marshaller": "^0.3.0", | ||
"@aws/dynamodb-expressions": "^0.3.0", | ||
"tslib": "^1.8.1", | ||
"utf8-bytes": "^0.0.1" | ||
}, | ||
@@ -32,0 +33,0 @@ "peerDependencies": { |
@@ -0,0 +0,0 @@ # Amazon DynamoDB Data Marshaller |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84638
11.16%34
21.43%1136
10.61%5
25%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
Updated