New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

solr-client-cache

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solr-client-cache - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

8

lib/extend-client.js

@@ -10,3 +10,7 @@ 'use strict';

solrClient.search = function (query, callback) {
solrClient.search = function (query, ignoreCache, callback) {
if (arguments.length === 2 && typeof ignoreCache === 'function') {
callback = ignoreCache;
ignoreCache = undefined;
}
if (typeof this.cacheOptions !== 'object' ||

@@ -23,3 +27,3 @@ !this.cacheOptions.hasOwnProperty('ttl')) {

.then(cachedResults => {
if (cachedResults) {
if (cachedResults && !ignoreCache) {
// set debug flag

@@ -26,0 +30,0 @@ Object.defineProperty(cachedResults, '__fromCache', { value: true });

{
"name": "solr-client-cache",
"version": "1.0.1",
"version": "1.1.0",
"description": "Caching for Solr Client",

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

@@ -179,2 +179,10 @@ 'use strict';

it('should NOT cache a query when the config is overriden', (done) => {
solrClient.cache().search({}, true, (err, results) => {
should.not.exist(err);
results.should.not.have.property('__fromCache');
done();
});
});
it('should NOT save the results to cache', (done) => {

@@ -181,0 +189,0 @@ solrClient.search({}, (err, results) => {

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