@aws-sdk/util-dynamodb 3.427.0 → 3.428.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/dist-cjs/marshall.js +1 -1
- package/dist-cjs/unmarshall.js +6 -1
- package/dist-es/marshall.js +1 -1
- package/dist-es/unmarshall.js +6 -1
- package/dist-types/convertToAttr.d.ts +3 -3
- package/dist-types/convertToNative.d.ts +2 -2
- package/dist-types/marshall.d.ts +10 -2
- package/dist-types/ts3.4/marshall.d.ts +1 -0
- package/dist-types/ts3.4/unmarshall.d.ts +2 -1
- package/dist-types/unmarshall.d.ts +10 -3
- package/package.json +2 -2
package/dist-cjs/marshall.js
CHANGED
package/dist-cjs/unmarshall.js
CHANGED
|
@@ -2,5 +2,10 @@
|
|
|
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) =>
|
|
5
|
+
const unmarshall = (data, options) => {
|
|
6
|
+
if (options === null || options === void 0 ? void 0 : options.convertWithoutMapWrapper) {
|
|
7
|
+
return (0, convertToNative_1.convertToNative)(data, options);
|
|
8
|
+
}
|
|
9
|
+
return (0, convertToNative_1.convertToNative)({ M: data }, options);
|
|
10
|
+
};
|
|
6
11
|
exports.unmarshall = unmarshall;
|
package/dist-es/marshall.js
CHANGED
package/dist-es/unmarshall.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { convertToNative } from "./convertToNative";
|
|
2
|
-
export const unmarshall = (data, options) =>
|
|
2
|
+
export const unmarshall = (data, options) => {
|
|
3
|
+
if (options?.convertWithoutMapWrapper) {
|
|
4
|
+
return convertToNative(data, options);
|
|
5
|
+
}
|
|
6
|
+
return convertToNative({ M: data }, options);
|
|
7
|
+
};
|
|
@@ -2,9 +2,9 @@ import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
|
2
2
|
import { marshallOptions } from "./marshall";
|
|
3
3
|
import { NativeAttributeValue } from "./models";
|
|
4
4
|
/**
|
|
5
|
-
* Convert a JavaScript value to its equivalent DynamoDB AttributeValue type
|
|
5
|
+
* Convert a JavaScript value to its equivalent DynamoDB AttributeValue type.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param data - The data to convert to a DynamoDB AttributeValue.
|
|
8
|
+
* @param options - An optional configuration object for `convertToAttr`.
|
|
9
9
|
*/
|
|
10
10
|
export declare const convertToAttr: (data: NativeAttributeValue, options?: marshallOptions) => AttributeValue;
|
|
@@ -4,7 +4,7 @@ import { unmarshallOptions } from "./unmarshall";
|
|
|
4
4
|
/**
|
|
5
5
|
* Convert a DynamoDB AttributeValue object to its equivalent JavaScript type.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param data - The DynamoDB record to convert to JavaScript type.
|
|
8
|
+
* @param options - An optional configuration object for `convertToNative`.
|
|
9
9
|
*/
|
|
10
10
|
export declare const convertToNative: (data: AttributeValue, options?: unmarshallOptions) => NativeAttributeValue;
|
package/dist-types/marshall.d.ts
CHANGED
|
@@ -16,12 +16,20 @@ export interface marshallOptions {
|
|
|
16
16
|
* Whether to convert typeof object to map attribute.
|
|
17
17
|
*/
|
|
18
18
|
convertClassInstanceToMap?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to convert the top level container
|
|
21
|
+
* if it is a map or list.
|
|
22
|
+
*
|
|
23
|
+
* Default is true when using the DynamoDBDocumentClient,
|
|
24
|
+
* but false if directly using the marshall function (backwards compatibility).
|
|
25
|
+
*/
|
|
26
|
+
convertTopLevelContainer?: boolean;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Convert a JavaScript object into a DynamoDB record.
|
|
22
30
|
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
31
|
+
* @param data - The data to convert to a DynamoDB record
|
|
32
|
+
* @param options - An optional configuration object for `marshall`
|
|
25
33
|
*
|
|
26
34
|
*/
|
|
27
35
|
export declare function marshall(data: Set<string>, options?: marshallOptions): AttributeValue.SSMember;
|
|
@@ -2,8 +2,9 @@ import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
|
2
2
|
import { NativeAttributeValue } from "./models";
|
|
3
3
|
export interface unmarshallOptions {
|
|
4
4
|
wrapNumbers?: boolean;
|
|
5
|
+
convertWithoutMapWrapper?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const unmarshall: (
|
|
7
|
-
data: Record<string, AttributeValue
|
|
8
|
+
data: Record<string, AttributeValue> | AttributeValue,
|
|
8
9
|
options?: unmarshallOptions
|
|
9
10
|
) => Record<string, NativeAttributeValue>;
|
|
@@ -9,11 +9,18 @@ export interface unmarshallOptions {
|
|
|
9
9
|
* This allows for the safe round-trip transport of numbers of arbitrary size.
|
|
10
10
|
*/
|
|
11
11
|
wrapNumbers?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* When true, skip wrapping the data in `{ M: data }` before converting.
|
|
14
|
+
*
|
|
15
|
+
* Default is true when using the DynamoDBDocumentClient,
|
|
16
|
+
* but false if directly using the unmarshall function (backwards compatibility).
|
|
17
|
+
*/
|
|
18
|
+
convertWithoutMapWrapper?: boolean;
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* Convert a DynamoDB record into a JavaScript object.
|
|
15
22
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
23
|
+
* @param data - The DynamoDB record
|
|
24
|
+
* @param options - An optional configuration object for `unmarshall`
|
|
18
25
|
*/
|
|
19
|
-
export declare const unmarshall: (data: Record<string, AttributeValue
|
|
26
|
+
export declare const unmarshall: (data: Record<string, AttributeValue> | AttributeValue, options?: unmarshallOptions) => Record<string, NativeAttributeValue>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-dynamodb",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.428.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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"tslib": "^2.5.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
27
|
+
"@aws-sdk/client-dynamodb": "3.428.0",
|
|
28
28
|
"@tsconfig/recommended": "1.0.1",
|
|
29
29
|
"concurrently": "7.0.0",
|
|
30
30
|
"downlevel-dts": "0.10.1",
|