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

yog-view

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yog-view - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

36

lib/combine.js
var Transform = require('stream').Transform;
module.exports = function(layer) {
module.exports = function (layer) {
var stream = new Transform();
var bigpipe = layer.bigpipe;
var isQuickingMode = bigpipe && bigpipe.isQuickingMode();
var isQuicklingMode = bigpipe && bigpipe.isQuicklingMode();
var identify = layer.BIGPIPE_HOOK;
// chain error
stream.on('pipe', function(source) {
stream.on('pipe', function (source) {
source.on('error', this.emit.bind(this, 'error'));
});
stream._transform = function(chunk, encoding, done) {
var output = isQuickingMode ? '' : layer.filter(chunk.toString());
stream._transform = function (chunk, encoding, done) {
var output = isQuicklingMode ? '' : layer.filter(chunk.toString());
var idx = identify ? output.indexOf(identify) : -1;
var clouser = '';
// bigpipe mode
if (bigpipe && (~idx || isQuickingMode)) {
if (bigpipe && (~idx || isQuicklingMode)) {
if (~idx) {

@@ -32,15 +32,15 @@ clouser = output.substring(idx + identify.length);

// chain error.
// chain error.
.on('error', stream.emit.bind(stream, 'error'))
.on('data', function(chunk) {
stream.push(chunk);
})
.on('data', function (chunk) {
stream.push(chunk);
})
.on('end', function() {
stream.push(clouser);
done();
});
.on('end', function () {
stream.push(clouser);
done();
});
}
this.push(output);

@@ -51,2 +51,2 @@ return done();

return stream;
};
};
{
"name": "yog-view",
"version": "0.2.1",
"version": "0.3.0",
"description": "An express.js middleware for optimizing the order of js\\css output, and enabling render template in bigpipe mode.",

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

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