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

hmpo-cached-model

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmpo-cached-model - npm Package Compare versions

Comparing version 3.0.3 to 4.0.0

2

lib/index.js

@@ -48,2 +48,3 @@ 'use strict';

this.lastModified = Date.now();
this.reset();
this.set(data);

@@ -83,2 +84,3 @@

this.lastModified = Date.now();
this.reset();
this.set(data);

@@ -85,0 +87,0 @@ cb();

12

package.json
{
"name": "hmpo-cached-model",
"version": "3.0.3",
"version": "4.0.0",
"description": "Cached polling model",

@@ -19,3 +19,3 @@ "main": "lib/index.js",

"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -29,11 +29,11 @@ "bugs": {

"debug": "^4.3.1",
"hmpo-model": "^3.2.2"
"hmpo-model": "^4.0.0"
},
"devDependencies": {
"chai": "^4.3.4",
"eslint": "^7.26.0",
"eslint": "^8.3.0",
"hmpo-logger": "^4.1.3",
"mocha": "^8.4.0",
"mocha": "^9.1.3",
"nyc": "^15.1.0",
"sinon": "^10.0.0",
"sinon": "^12.0.1",
"sinon-chai": "^3.6.0"

@@ -40,0 +40,0 @@ },

@@ -46,1 +46,7 @@ # hmpo-cached-model

## Upgrading
The deprecated `request` library has been replaced with `got` in `hmpo-model`.
The new `got` library doesn't automativally use the proxy environment variables so you would need to use something like `global-agent` in your
app if you need to specify proxies by environment arguments.

@@ -12,2 +12,5 @@ 'use strict';

const hmpoLogger = require('hmpo-logger');
hmpoLogger.config({ app: false, error: false, console: false });
describe('HmpoCachedModel', () => {

@@ -19,2 +22,3 @@ let clock, instance, storeFactory, storeStub, options, cb;

sinon.stub(HmpoModel.prototype, 'fetch').yields(null, { a: 1, b: 2 });
sinon.stub(HmpoModel.prototype, 'reset');
sinon.stub(HmpoModel.prototype, 'set');

@@ -46,2 +50,3 @@ sinon.stub(HmpoModel.prototype, 'get');

HmpoModel.prototype.fetch.restore();
HmpoModel.prototype.reset.restore();
HmpoModel.prototype.set.restore();

@@ -161,2 +166,3 @@ HmpoModel.prototype.get.restore();

instance.getStoreData(cb);
HmpoModel.prototype.reset.should.have.been.calledWithExactly();
HmpoModel.prototype.set.should.have.been.calledWithExactly({

@@ -250,2 +256,3 @@ a: 1, b: 2

instance.getDataFromAPI(cb);
HmpoModel.prototype.reset.should.have.been.calledWithExactly();
HmpoModel.prototype.set.should.have.been.calledWithExactly({

@@ -459,4 +466,4 @@ a: 1, b: 2

it('should clear the two interval timers', () => {
instance.storeTimer = 123;
instance.apiTimer = 456;
instance.storeTimer = setInterval(()=>{}, 10000);
instance.apiTimer = setInterval(()=>{}, 10000);
instance.stop();

@@ -463,0 +470,0 @@ expect(instance.storeTimer).to.not.be.ok;

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