Skip to content

Commit f69f80f

Browse files
Update index.js
Added option to set convertEmptyValues from configuration
1 parent 3aece40 commit f69f80f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class ServerlessDynamodbLocal {
6969
seed: {
7070
shortcut: "s",
7171
usage: "After starting and migrating dynamodb local, injects seed data into your tables. The --seed option determines which data categories to onload.",
72+
},
73+
convertEmptyValues: {
74+
shortcut: "e",
75+
usage: "Set to true if you would like the document client to convert empty values (0-length strings, binary buffers, and sets) to be converted to NULL types when persisting to DynamoDB.",
7276
}
7377
}
7478
},
@@ -129,13 +133,15 @@ class ServerlessDynamodbLocal {
129133
}
130134
dynamoOptions = {
131135
region: options.region,
136+
convertEmptyValues: options && options.convertEmptyValues ? options.convertEmptyValues : false,
132137
};
133138
} else {
134139
dynamoOptions = {
135140
endpoint: `http://${this.host}:${this.port}`,
136141
region: "localhost",
137142
accessKeyId: "MOCK_ACCESS_KEY_ID",
138-
secretAccessKey: "MOCK_SECRET_ACCESS_KEY"
143+
secretAccessKey: "MOCK_SECRET_ACCESS_KEY",
144+
convertEmptyValues: options && options.convertEmptyValues ? options.convertEmptyValues : false,
139145
};
140146
}
141147

0 commit comments

Comments
 (0)