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.7 to 1.0.8

2

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

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

@@ -45,3 +45,3 @@ # vsm-dictionary-cacher

Install like:
Install like (after also installing a `vsm-dictionary-...` of choice) :
```

@@ -62,6 +62,6 @@ npm install vsm-dictionary-cacher --save-prod

// This will query the Dictionary as normal, bypassing the cache.
dict.getMatchesForString('abc', {filter: {dictID: 'Foo'}}, (err, res) => {
dict.getMatchesForString('abc', {filter: {dictID: ['Foo']}}, (err, res) => {
// This will get the result from the cache (instead of re-running the query).
dict.getMatchesForString('abc', {filter: {dictID: 'Foo'}}, (err, res) => {
dict.getMatchesForString('abc', {filter: {dictID: ['Foo']}}, (err, res) => {

@@ -71,4 +71,4 @@ });

// These will *not* get their result from the cache.
dict.getMatchesForString('abc', {filter: {dictID: 'BAR'}}, (err, res) => {});
dict.getMatchesForString('QQQ', {filter: {dictID: 'Foo'}}, (err, res) => {});
dict.getMatchesForString('abc', {filter: {dictID: ['BAR']}}, (err, res) => {});
dict.getMatchesForString('QQQ', {filter: {dictID: ['Foo']}}, (err, res) => {});

@@ -104,5 +104,15 @@ });

Default is `true`.
- For that collection of strings, `maxItems` and `maxAge` do not apply.
- Note: For that collection of strings, `maxItems` and `maxAge` do not apply.
But the collection gets cleared whenever the main cache gets cleared (so
also after a long time of no access (see below under 'Memory management')).
- Note: a query for matching refTerms (to `getRefTerms()`)
will still be made,
because e.g. after a call for "i" would give no results (and "i" ends up
in cacheEmpties), a subsequent call for the refTerm "it" should still
return it as a result.
(Note that a refTerm is only returned as an exact string match).
- Note: a call to `getMatchesForString()` is also still made,
because e.g. after a call for "1e" gave no results,
a subsequent call for the valid number-string "1e5"
should still return it as a result.

@@ -109,0 +119,0 @@ Specify options like:

@@ -0,0 +0,0 @@ const cacher = require('./VsmDictionaryCacher');

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