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

nodesi

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodesi - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

13

lib/esi.js

@@ -12,2 +12,3 @@ /* jshint node:true */

function ESI(config) {
var self = this;
config = config || {};

@@ -21,2 +22,12 @@

this.logger = new Logger(config);
if(typeof this.cache.on === 'function') {
this.cache.on('error', function(err) {
self.logger.write('ESI: custom cache emitted an error:');
self.logger.write('ESI: ' + err);
self.logger.write('ESI: falling back to default cache');
self.cache = new Cache(config);
});
}
}

@@ -96,3 +107,3 @@

if(nextTagFullClose > -1 &&
(Math.max(0, nextTagFullClose - fullClose.length) < Math.max(0, nextTagSelfClose - selfClose.length)) ||
(Math.max(0, nextTagFullClose - fullClose.length) < Math.max(0, nextTagSelfClose - selfClose.length)) ||
nextTagSelfClose === -1) {

@@ -99,0 +110,0 @@ tags.push(reducedHtml.substr(0, nextTagFullClose + fullClose.length));

2

package.json
{
"name": "nodesi",
"version": "1.0.9",
"version": "1.0.10",
"description": "ESI: the good parts in node.js",

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

@@ -9,2 +9,3 @@ /* jshint node:true */

fs = require('fs'),
events = require('events'),
Promise = require('bluebird'),

@@ -493,2 +494,27 @@

it('should gracefully fall to default cache upon custom cache error', function() {
// given
var CustomCache = function() {
events.EventEmitter.call(this);
};
CustomCache.prototype = Object.create(events.EventEmitter.prototype, {
constructor: {
value: CustomCache
}
});
var customCache = new CustomCache();
// when
var esi = new ESI({
cache: customCache
});
customCache.emit('error', new Error('Connection error'));
// then
assert.ok(esi.cache instanceof Cache);
assert.ok(!(esi.cache instanceof CustomCache));
});
it('should fetch components recursively', function (done) {

@@ -495,0 +521,0 @@ // given

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