@aws/dynamodb-auto-marshaller
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -0,0 +0,0 @@ import { ObjectSet } from "./ObjectSet"; |
@@ -39,6 +39,7 @@ "use strict"; | ||
BinarySet.prototype.has = function (value) { | ||
var e_1, _a; | ||
var valueView = getBinaryView(value); | ||
try { | ||
for (var _a = tslib_1.__values(this), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var item = _b.value; | ||
for (var _b = tslib_1.__values(this), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var item = _c.value; | ||
if (binaryEquals(getBinaryView(item), valueView)) { | ||
@@ -52,3 +53,3 @@ return true; | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a); | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
@@ -58,3 +59,2 @@ finally { if (e_1) throw e_1.error; } | ||
return false; | ||
var e_1, _c; | ||
}; | ||
@@ -61,0 +61,0 @@ return BinarySet; |
@@ -0,0 +0,0 @@ export * from './BinarySet'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -30,3 +30,9 @@ import { AttributeMap, AttributeValue } from "aws-sdk/clients/dynamodb"; | ||
export declare const InvalidHandlingStrategies: { | ||
/** | ||
* Remove any invalid values from the serialized output. | ||
*/ | ||
omit: string; | ||
/** | ||
* Throw an error when an unserializable value is encountered. | ||
*/ | ||
throw: string; | ||
@@ -79,3 +85,3 @@ }; | ||
private readonly unwrapNumbers; | ||
constructor({onEmpty, onInvalid, unwrapNumbers}?: MarshallingOptions); | ||
constructor({ onEmpty, onInvalid, unwrapNumbers }?: MarshallingOptions); | ||
/** | ||
@@ -105,10 +111,10 @@ * Convert a JavaScript object with string keys and arbitrary values into an | ||
unmarshallValue(item: AttributeValue): UnmarshalledAttributeValue; | ||
private marshallComplexType(value); | ||
private marshallBinaryValue(binary); | ||
private marshallList(list); | ||
private marshallMap(map); | ||
private marshallObject(object); | ||
private marshallSet(arg); | ||
private collectSet<T, R>(set, isEmpty, tag, elementType, transform?); | ||
private handleEmptyString(value); | ||
private marshallComplexType; | ||
private marshallBinaryValue; | ||
private marshallList; | ||
private marshallMap; | ||
private marshallObject; | ||
private marshallSet; | ||
private collectSet; | ||
private handleEmptyString; | ||
} |
@@ -84,2 +84,3 @@ "use strict"; | ||
var _this = this; | ||
var e_1, _a, e_2, _b; | ||
if (item.S !== undefined) { | ||
@@ -105,4 +106,4 @@ return item.S; | ||
try { | ||
for (var _a = tslib_1.__values(item.SS), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var member = _b.value; | ||
for (var _c = tslib_1.__values(item.SS), _d = _c.next(); !_d.done; _d = _c.next()) { | ||
var member = _d.value; | ||
set.add(member); | ||
@@ -114,3 +115,3 @@ } | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a); | ||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c); | ||
} | ||
@@ -125,4 +126,4 @@ finally { if (e_1) throw e_1.error; } | ||
try { | ||
for (var _d = tslib_1.__values(item.NS), _e = _d.next(); !_e.done; _e = _d.next()) { | ||
var member = _e.value; | ||
for (var _e = tslib_1.__values(item.NS), _f = _e.next(); !_f.done; _f = _e.next()) { | ||
var member = _f.value; | ||
set.add(Number(member)); | ||
@@ -134,3 +135,3 @@ } | ||
try { | ||
if (_e && !_e.done && (_f = _d.return)) _f.call(_d); | ||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e); | ||
} | ||
@@ -154,3 +155,2 @@ finally { if (e_2) throw e_2.error; } | ||
}, {}); | ||
var e_1, _c, e_2, _f; | ||
}; | ||
@@ -187,2 +187,3 @@ Marshaller.prototype.marshallComplexType = function (value) { | ||
Marshaller.prototype.marshallList = function (list) { | ||
var e_3, _a; | ||
var values = []; | ||
@@ -206,9 +207,9 @@ try { | ||
return { L: values }; | ||
var e_3, _a; | ||
}; | ||
Marshaller.prototype.marshallMap = function (map) { | ||
var e_4, _a; | ||
var members = {}; | ||
try { | ||
for (var map_1 = tslib_1.__values(map), map_1_1 = map_1.next(); !map_1_1.done; map_1_1 = map_1.next()) { | ||
var _a = tslib_1.__read(map_1_1.value, 2), key = _a[0], value = _a[1]; | ||
var _b = tslib_1.__read(map_1_1.value, 2), key = _b[0], value = _b[1]; | ||
if (typeof key !== 'string') { | ||
@@ -229,3 +230,3 @@ if (this.onInvalid === 'omit') { | ||
try { | ||
if (map_1_1 && !map_1_1.done && (_b = map_1.return)) _b.call(map_1); | ||
if (map_1_1 && !map_1_1.done && (_a = map_1.return)) _a.call(map_1); | ||
} | ||
@@ -235,3 +236,2 @@ finally { if (e_4) throw e_4.error; } | ||
return { M: members }; | ||
var e_4, _b; | ||
}; | ||
@@ -271,2 +271,3 @@ Marshaller.prototype.marshallObject = function (object) { | ||
Marshaller.prototype.collectSet = function (set, isEmpty, tag, elementType, transform) { | ||
var e_5, _a, _b; | ||
var values = []; | ||
@@ -301,3 +302,2 @@ try { | ||
} | ||
var e_5, _a, _b; | ||
}; | ||
@@ -304,0 +304,0 @@ Marshaller.prototype.handleEmptyString = function (value) { |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ObjectSet } from "./ObjectSet"; |
@@ -38,6 +38,7 @@ "use strict"; | ||
NumberValueSet.prototype.has = function (value) { | ||
var e_1, _a; | ||
var valueString = value.toString(); | ||
try { | ||
for (var _a = tslib_1.__values(this), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var item = _b.value; | ||
for (var _b = tslib_1.__values(this), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var item = _c.value; | ||
if (item.toString() === valueString) { | ||
@@ -51,3 +52,3 @@ return true; | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a); | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
@@ -57,3 +58,2 @@ finally { if (e_1) throw e_1.error; } | ||
return false; | ||
var e_1, _c; | ||
}; | ||
@@ -60,0 +60,0 @@ return NumberValueSet; |
@@ -0,0 +0,0 @@ export declare abstract class ObjectSet<T> implements Set<T> { |
@@ -11,2 +11,3 @@ "use strict"; | ||
function ObjectSet(iterable) { | ||
var e_1, _a; | ||
/** | ||
@@ -33,3 +34,2 @@ * Returns the string literal 'Set' for use by Object.prototype.toString. | ||
} | ||
var e_1, _a; | ||
} | ||
@@ -36,0 +36,0 @@ /** |
{ | ||
"name": "@aws/dynamodb-auto-marshaller", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A data marshaller that converts JavaScript types into Amazon DynamoDB AttributeValues", | ||
@@ -31,6 +31,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/jest": "^22", | ||
"@types/jest": "^23", | ||
"@types/node": "^8.0.4", | ||
"aws-sdk": "^2.7.0", | ||
"jest": "^22", | ||
"jest": "^23", | ||
"typedoc": "^0.11.0", | ||
@@ -37,0 +37,0 @@ "typescript": "^2.7" |
@@ -0,0 +0,0 @@ # Amazon DynamoDB Automarshaller |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
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
938
51405