Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xapp/dynamo-service

Package Overview
Dependencies
Maintainers
6
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xapp/dynamo-service - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

.vscode/templates/ts.lict

8

.vscode/settings.json

@@ -20,3 +20,9 @@ {

"dynoservice"
]
],
"license-header-manager.additionalCommentStyles": [{
"extension": ".ts",
"commentStart": "/**",
"commentMiddle": " *",
"commentEnd": " */"
}]
}

@@ -5,2 +5,11 @@ # Changelog

## [1.3.0](https://github.com/XappMedia/dynamo-service/compare/v1.2.0...v1.3.0) (2019-08-26)
### Features
* Adding ability to update nested attributes. ([adb762e](https://github.com/XappMedia/dynamo-service/commit/adb762e))
## [1.2.0](https://github.com/XappMedia/dynamo-service/compare/v1.1.0...v1.2.0) (2019-08-06)

@@ -7,0 +16,0 @@

@@ -346,3 +346,11 @@ "use strict";

};
Item = Object.assign({}, Key, { StringParam1: "One", NumberParam1: 2, ObjParam1: { Param: "Value" }, ObjParam2: { Param1: "Value1", Param2: "Value2" }, ListParam1: [1, 2, 3, 4, 5, 6] });
Item = Object.assign({}, Key, { StringParam1: "One", NumberParam1: 2, ObjParam1: { Param: "Value" }, ObjParam2: { Param1: "Value1", Param2: "Value2" }, ListParam1: [1, 2, 3, 4, 5, 6], NestedLIstParam1: {
list: [{
param1: "Value",
param2: "Value"
}, {
param3: "Value",
param4: "Value"
}]
} });
yield client.put({

@@ -421,2 +429,18 @@ TableName: testTable.TableName,

}));
it("Tests that an attribute in the nested list parameter is updated.", () => __awaiter(this, void 0, void 0, function* () {
yield service.update(testTable.TableName, Key, { set: {
"NestedLIstParam1.list[0].param3": "NewValue"
} });
const updatedObj = yield client.get({ TableName: testTable.TableName, Key }).promise();
expect(updatedObj.Item.NestedLIstParam1).to.deep.equal({
list: [{
param1: "Value",
param2: "Value",
param3: "NewValue"
}, {
param3: "Value",
param4: "Value"
}]
});
}));
it("Tests that an null object is not turned to an object.", () => __awaiter(this, void 0, void 0, function* () {

@@ -423,0 +447,0 @@ const updateObj = {

11

dist/service/DynamoService.js

@@ -275,4 +275,5 @@ "use strict";

for (const splitKey of splitKeys) {
const alias = "#__dynoservice_updateset_a" + ++index;
setAliasMap[alias] = splitKey;
const matchKey = splitKey.match(/^([^[\]]+)(\[[0-9]+\])?$/);
const alias = "#__dynoservice_updateset_a" + ++index + (matchKey[2] || "");
setAliasMap[alias] = matchKey[1];
aliases.push(alias);

@@ -320,3 +321,7 @@ }

if (Object_1.objHasAttrs(setAliasMap)) {
returnValue = Object.assign({}, returnValue, { ExpressionAttributeNames: setAliasMap });
const ExpressionAttributeNames = Object.keys(setAliasMap).reduce((last, currentKey) => {
last[currentKey.replace(/\[[0-9]+\]$/, "")] = setAliasMap[currentKey];
return last;
}, {});
returnValue = Object.assign({}, returnValue, { ExpressionAttributeNames });
}

@@ -323,0 +328,0 @@ return returnValue;

{
"name": "@xapp/dynamo-service",
"version": "1.2.0",
"author": "XAPPmedia",
"license": "Apache-2.0",
"version": "1.3.0",
"description": "A dynamo help class which will help maintain data integrity.",

@@ -24,4 +26,2 @@ "main": "dist/index.js",

],
"author": "",
"license": "ISC",
"devDependencies": {

@@ -28,0 +28,0 @@ "@types/chai": "^4.1.7",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc