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

dynamodb-recs

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamodb-recs - npm Package Compare versions

Comparing version 1.0.37 to 1.0.38

2

models/Recs.js

@@ -138,3 +138,3 @@ const _ = require('lodash');

rxop.mergeMap(response => {
if (_.size(response)) {
if (cache && _.size(response)) {
return this.cache.insertOrReplace({

@@ -141,0 +141,0 @@ ...cacheKeys,

@@ -203,2 +203,3 @@ const _ = require('lodash');

beforeEach(() => {
sinon.spy(app.models.recs.cache, 'insertOrReplace');
sinon.spy(app.models.recs.graph, 'traverse');

@@ -208,2 +209,3 @@ });

afterEach(() => {
app.models.recs.cache.insertOrReplace.restore();
app.models.recs.graph.traverse.restore();

@@ -245,2 +247,8 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledOnceWithExactly({
id: sinon.match.string,
namespace,
value: sinon.match.array,
ttl: sinon.match.number
});
}, null, done);

@@ -266,2 +274,8 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledOnceWithExactly({
id: sinon.match.string,
namespace,
value: sinon.match.array,
ttl: sinon.match.number
});
}, null, done);

@@ -285,2 +299,10 @@ });

]);
expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledOnceWithExactly({
id: sinon.match.string,
namespace,
value: sinon.match.array,
ttl: sinon.match.number
});
}, null, done);

@@ -304,2 +326,3 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -328,2 +351,8 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledOnceWithExactly({
id: sinon.match.string,
namespace,
value: sinon.match.array,
ttl: sinon.match.number
});
}, null, done);

@@ -349,2 +378,3 @@ });

expect(app.models.recs.graph.traverse).to.not.have.been.called;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -371,2 +401,3 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledOnce;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -402,2 +433,3 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledTwice;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -427,2 +459,9 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledTwice;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledTwice;
expect(app.models.recs.cache.insertOrReplace).to.have.been.calledWithExactly({
id: sinon.match.string,
namespace,
value: sinon.match.array,
ttl: sinon.match.number
});
}, null, done);

@@ -451,2 +490,3 @@ });

expect(app.models.recs.graph.traverse).to.not.have.been.called;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -477,2 +517,3 @@ });

expect(app.models.recs.graph.traverse).to.have.been.calledTwice;
expect(app.models.recs.cache.insertOrReplace).to.not.have.been.called;
}, null, done);

@@ -479,0 +520,0 @@ });

{
"name": "dynamodb-recs",
"version": "1.0.37",
"version": "1.0.38",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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