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

vsm-dictionary-cacher

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vsm-dictionary-cacher - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "vsm-dictionary-cacher",
"version": "1.0.5",
"version": "1.0.6",
"description": "Wrapper around a VSM-dictionary, that manages a cache of string-match results",

@@ -5,0 +5,0 @@ "main": "src/VsmDictionaryCacher.js",

@@ -108,4 +108,4 @@ /*

if (this._getCacheMOEmptiesPrediction(str, options)) {
return this.addExtraMatchesForString(str, { items: [] }, options,
(err, res) => callAsync(cb, err, res)
return this.addExtraMatchesForString(str, [], options,
(err, arr) => callAsync(cb, err, { items: arr })
);

@@ -112,0 +112,0 @@ }

@@ -13,5 +13,6 @@ const cacher = require('./VsmDictionaryCacher');

var called; // This will be set to 1 if the stub getMatchesFor..() is called.
var calledParent; // Is 1 if stub's parent's addExtraMatchesFor..() is called.
var result; // The stub function will return this, whatever it is set to.
// (See below).
var calledParent; // Is 1 if stub's parent's addExtraMatchesFor..() is called.
var arrGivenToParent;

@@ -25,3 +26,7 @@ var clock; // See https://stackoverflow.com/questions/17446064

addExtraMatchesForString(str, arr, options, cb) {
setTimeout( () => { calledParent = 1; cb(null, arr); }, 0 );
setTimeout( () => {
calledParent = 1;
arrGivenToParent = arr;
cb(null, arr);
}, 0);
}

@@ -70,2 +75,3 @@ };

calledParent = 0;
arrGivenToParent = undefined;
result = { items: ['default'] };

@@ -394,2 +400,4 @@ });

calledParent.should.equal(1);
arrGivenToParent.should.deep.equal([]); // Parent gets OK data format.
res.should.deep.equal(_R0); // Cacher integrates empty result OK.
cb();

@@ -396,0 +404,0 @@ });

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