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

@xapp/dynamo-service

Package Overview
Dependencies
Maintainers
5
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.0.0-alpha.1 to 1.0.0-alpha.2

xapp-dynamo-service-1.0.0-alpha.2.tgz

9

dist/service/TableService/__test__/NuTableService.test.js

@@ -59,2 +59,11 @@ "use strict";

}));
it("Tests that an item is put even if it doesn't contain optional items.", () => __awaiter(this, void 0, void 0, function* () {
const schema = buildTableSchema({ optionalParam: { type: "S" } });
const service = new Service.NuTableService(tableName, dynamoService, schema);
yield service.put({ "primaryKey": "TestKey" });
expect(dynamoService.put).to.have.been.calledWithMatch(tableName, { "primaryKey": "TestKey" }, {
ConditionExpression: "attribute_not_exists(#___cond_NC0)",
ExpressionAttributeNames: { "#___cond_NC0": "primaryKey" }
});
}));
it("Tests that a schema is converted.", () => __awaiter(this, void 0, void 0, function* () {

@@ -61,0 +70,0 @@ const schema = buildTableSchema({ "stringParam": { type: "S", slugify: true } });

2

dist/service/TableService/index.d.ts

@@ -1,1 +0,1 @@

export * from "./TableService";
export * from "./NuTableService";

@@ -6,2 +6,2 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./TableService"));
__export(require("./NuTableService"));

@@ -15,2 +15,6 @@ "use strict";

});
it("Tests that undefined is ignored.", () => {
const validator = Validator.isDateObjValidator();
ValidatorTestUtils_1.expectToHaveNoErrors(validator("TestKey", undefined, undefined));
});
});

@@ -30,3 +34,7 @@ describe(Validator.isDateObjUpdateBodyValidator.name, () => {

});
it("Tests that no error is thrown if the date is being set to undefined.", () => {
const validator = Validator.isDateObjUpdateBodyValidator();
ValidatorTestUtils_1.expectToHaveNoErrors(validator("TestKey", undefined, { set: { "TestKey": undefined } }));
});
});
});

@@ -5,3 +5,3 @@ "use strict";

return (key, schema, obj) => {
if (isNotDate(obj)) {
if (obj != null && isNotDate(obj)) {
return `Key "${key}" is not a valid date.`;

@@ -8,0 +8,0 @@ }

@@ -22,2 +22,9 @@ "use strict";

});
it("Tests that no error is thrown if the object is undefined.", () => {
const schema = {
type: "S"
};
const validator = Validator.isCorrectValueTypeValidator("string");
ValidatorTestUtils_1.expectToHaveNoErrors(validator("TestKey", schema, undefined));
});
});

@@ -24,0 +31,0 @@ describe(Validator.isCorrectValueTypeUpdateBodyValidator.name, () => {

@@ -82,2 +82,10 @@ "use strict";

else {
it("Tests that an error is thrown if the user is attempting to set the wrong type.", () => {
const testValue = (valueType === "number") ? "testString" : 4;
checkForErrors(() => schema.validateObjectAgainstSchema({ "Test": testValue }), [`Key "Test" is expected to be of type ${valueType} but got ${typeof testValue}.`]);
});
it("Tests that an error is not thrown if the user is attempting to set the object and undefined.", () => {
const testValue = undefined;
checkForErrors(() => schema.validateObjectAgainstSchema({ "Test": testValue }), []);
});
it("Tests that an error is thrown if the user is attempting to change the type.", () => {

@@ -87,2 +95,6 @@ const testValue = (valueType === "number") ? "testString" : 4;

});
it("Tests that no error is thrown if the object is undefined.", () => {
const testValue = undefined;
checkForErrors(() => schema.validateUpdateObjectAgainstSchema({ set: { "Test": testValue } }), []);
});
}

@@ -89,0 +101,0 @@ }

@@ -5,3 +5,3 @@ "use strict";

return (key, schema, obj) => {
if (typeof obj !== expectedType) {
if (obj != null && typeof obj !== expectedType) {
return `Key "${key}" is expected to be of type ${expectedType} but got ${typeof obj}.`;

@@ -15,3 +15,3 @@ }

const { set } = obj;
if (set && set[key] && typeof set[key] !== expectedType) {
if (set && set[key] != null && typeof set[key] !== expectedType) {
return `Key "${key}" is expected to be of type ${expectedType} but got ${typeof set[key]}.`;

@@ -18,0 +18,0 @@ }

{
"name": "@xapp/dynamo-service",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "A dynamo help class which will help maintain data integrity.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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