@aws-sdk/util-dynamodb 3.54.0 → 3.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.56.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.55.0...v3.56.0) (2022-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
@@ -52,7 +52,7 @@ exports.convertToAttr = convertToAttr;
|
|
|
52
52
|
const convertToListAttr = (data, options) => ({
|
|
53
53
|
L: data
|
|
54
54
|
.filter((item) => !(options === null || options === void 0 ? void 0 : options.removeUndefinedValues) || ((options === null || options === void 0 ? void 0 : options.removeUndefinedValues) && item !== undefined))
|
|
55
|
-
.map((item) => exports.convertToAttr(item, options)),
|
|
55
|
+
.map((item) => (0, exports.convertToAttr)(item, options)),
|
|
56
56
|
});
|
|
57
57
|
const convertToSetAttr = (set, options) => {
|
|
58
58
|
const setToOperate = (options === null || options === void 0 ? void 0 : options.removeUndefinedValues) ? new Set([...set].filter((value) => value !== undefined)) : set;
|
|
@@ -103,7 +103,7 @@ const convertToMapAttrFromIterable = (data, options) => ({
|
|
|
103
103
|
const map = {};
|
|
104
104
|
for (const [key, value] of data) {
|
|
105
105
|
if (typeof value !== "function" && (value !== undefined || !(options === null || options === void 0 ? void 0 : options.removeUndefinedValues))) {
|
|
106
|
-
map[key] = exports.convertToAttr(value, options);
|
|
106
|
+
map[key] = (0, exports.convertToAttr)(value, options);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
return map;
|
|
@@ -115,7 +115,7 @@ const convertToMapAttrFromEnumerableProps = (data, options) => ({
|
|
|
115
115
|
for (const key in data) {
|
|
116
116
|
const value = data[key];
|
|
117
117
|
if (typeof value !== "function" && (value !== undefined || !(options === null || options === void 0 ? void 0 : options.removeUndefinedValues))) {
|
|
118
|
-
map[key] = exports.convertToAttr(value, options);
|
|
118
|
+
map[key] = (0, exports.convertToAttr)(value, options);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
return map;
|
|
@@ -56,8 +56,8 @@ const convertNumber = (numString, options) => {
|
|
|
56
56
|
};
|
|
57
57
|
const convertString = (stringValue) => stringValue;
|
|
58
58
|
const convertBinary = (binaryValue) => binaryValue;
|
|
59
|
-
const convertList = (list, options) => list.map((item) => exports.convertToNative(item, options));
|
|
59
|
+
const convertList = (list, options) => list.map((item) => (0, exports.convertToNative)(item, options));
|
|
60
60
|
const convertMap = (map, options) => Object.entries(map).reduce((acc, [key, value]) => ({
|
|
61
61
|
...acc,
|
|
62
|
-
[key]: exports.convertToNative(value, options),
|
|
62
|
+
[key]: (0, exports.convertToNative)(value, options),
|
|
63
63
|
}), {});
|
package/dist-cjs/marshall.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.marshall = void 0;
|
|
4
4
|
const convertToAttr_1 = require("./convertToAttr");
|
|
5
|
-
const marshall = (data, options) => convertToAttr_1.convertToAttr(data, options).M;
|
|
5
|
+
const marshall = (data, options) => (0, convertToAttr_1.convertToAttr)(data, options).M;
|
|
6
6
|
exports.marshall = marshall;
|
package/dist-cjs/unmarshall.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.unmarshall = void 0;
|
|
4
4
|
const convertToNative_1 = require("./convertToNative");
|
|
5
|
-
const unmarshall = (data, options) => convertToNative_1.convertToNative({ M: data }, options);
|
|
5
|
+
const unmarshall = (data, options) => (0, convertToNative_1.convertToNative)({ M: data }, options);
|
|
6
6
|
exports.unmarshall = unmarshall;
|
package/dist-es/convertToAttr.js
CHANGED
|
@@ -44,7 +44,7 @@ export var convertToAttr = function (data, options) {
|
|
|
44
44
|
else if ((options === null || options === void 0 ? void 0 : options.convertClassInstanceToMap) && typeof data === "object") {
|
|
45
45
|
return convertToMapAttrFromEnumerableProps(data, options);
|
|
46
46
|
}
|
|
47
|
-
throw new Error("Unsupported type passed: "
|
|
47
|
+
throw new Error("Unsupported type passed: ".concat(data, ". Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute."));
|
|
48
48
|
};
|
|
49
49
|
var convertToListAttr = function (data, options) { return ({
|
|
50
50
|
L: data
|
|
@@ -52,7 +52,7 @@ var convertToListAttr = function (data, options) { return ({
|
|
|
52
52
|
.map(function (item) { return convertToAttr(item, options); }),
|
|
53
53
|
}); };
|
|
54
54
|
var convertToSetAttr = function (set, options) {
|
|
55
|
-
var setToOperate = (options === null || options === void 0 ? void 0 : options.removeUndefinedValues) ? new Set(__spreadArray([], __read(set)).filter(function (value) { return value !== undefined; })) : set;
|
|
55
|
+
var setToOperate = (options === null || options === void 0 ? void 0 : options.removeUndefinedValues) ? new Set(__spreadArray([], __read(set), false).filter(function (value) { return value !== undefined; })) : set;
|
|
56
56
|
if (!(options === null || options === void 0 ? void 0 : options.removeUndefinedValues) && setToOperate.has(undefined)) {
|
|
57
57
|
throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");
|
|
58
58
|
}
|
|
@@ -134,19 +134,19 @@ var convertToBinaryAttr = function (data) { return ({ B: data }); };
|
|
|
134
134
|
var convertToStringAttr = function (data) { return ({ S: data.toString() }); };
|
|
135
135
|
var convertToBigIntAttr = function (data) { return ({ N: data.toString() }); };
|
|
136
136
|
var validateBigIntAndThrow = function (errorPrefix) {
|
|
137
|
-
throw new Error(errorPrefix
|
|
137
|
+
throw new Error("".concat(errorPrefix, " ").concat(typeof BigInt === "function" ? "Use BigInt." : "Pass string value instead.", " "));
|
|
138
138
|
};
|
|
139
139
|
var convertToNumberAttr = function (num) {
|
|
140
140
|
if ([Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]
|
|
141
141
|
.map(function (val) { return val.toString(); })
|
|
142
142
|
.includes(num.toString())) {
|
|
143
|
-
throw new Error("Special numeric value "
|
|
143
|
+
throw new Error("Special numeric value ".concat(num.toString(), " is not allowed"));
|
|
144
144
|
}
|
|
145
145
|
else if (num > Number.MAX_SAFE_INTEGER) {
|
|
146
|
-
validateBigIntAndThrow("Number "
|
|
146
|
+
validateBigIntAndThrow("Number ".concat(num.toString(), " is greater than Number.MAX_SAFE_INTEGER."));
|
|
147
147
|
}
|
|
148
148
|
else if (num < Number.MIN_SAFE_INTEGER) {
|
|
149
|
-
validateBigIntAndThrow("Number "
|
|
149
|
+
validateBigIntAndThrow("Number ".concat(num.toString(), " is lesser than Number.MIN_SAFE_INTEGER."));
|
|
150
150
|
}
|
|
151
151
|
return { N: num.toString() };
|
|
152
152
|
};
|
|
@@ -27,7 +27,7 @@ export var convertToNative = function (data, options) {
|
|
|
27
27
|
case "SS":
|
|
28
28
|
return new Set(value.map(convertString));
|
|
29
29
|
default:
|
|
30
|
-
throw new Error("Unsupported type passed: "
|
|
30
|
+
throw new Error("Unsupported type passed: ".concat(key));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -39,7 +39,7 @@ export var convertToNative = function (data, options) {
|
|
|
39
39
|
}
|
|
40
40
|
finally { if (e_1) throw e_1.error; }
|
|
41
41
|
}
|
|
42
|
-
throw new Error("No value defined: "
|
|
42
|
+
throw new Error("No value defined: ".concat(JSON.stringify(data)));
|
|
43
43
|
};
|
|
44
44
|
var convertNumber = function (numString, options) {
|
|
45
45
|
if (options === null || options === void 0 ? void 0 : options.wrapNumbers) {
|
|
@@ -53,11 +53,11 @@ var convertNumber = function (numString, options) {
|
|
|
53
53
|
return BigInt(numString);
|
|
54
54
|
}
|
|
55
55
|
catch (error) {
|
|
56
|
-
throw new Error(numString
|
|
56
|
+
throw new Error("".concat(numString, " can't be converted to BigInt. Set options.wrapNumbers to get string value."));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
|
-
throw new Error(numString
|
|
60
|
+
throw new Error("".concat(numString, " is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value."));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return num;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-dynamodb",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"tslib": "^2.3.
|
|
22
|
+
"tslib": "^2.3.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
25
|
+
"@aws-sdk/client-dynamodb": "3.56.0",
|
|
26
26
|
"@tsconfig/recommended": "1.0.1",
|
|
27
27
|
"concurrently": "7.0.0",
|
|
28
28
|
"downlevel-dts": "0.7.0",
|
|
29
29
|
"rimraf": "3.0.2",
|
|
30
30
|
"typedoc": "0.19.2",
|
|
31
|
-
"typescript": "~4.
|
|
31
|
+
"typescript": "~4.6.2"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">= 12.0.0"
|