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

express-compiless

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-compiless - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

test/root/simple.less

7

lib/compiless.js

@@ -81,3 +81,4 @@ var Path = require('path'),

if (oldETag) {
var etagFragments = [oldETag.replace(/^"|"$/g, '')];
var oldETagIsWeak = oldETag && /^W\//.test(oldETag),
etagFragments = [oldETag.replace(/^(?:W\/)?"|"$/g, '')];
if (importedFileNames.length) {

@@ -91,7 +92,7 @@ var importedFileStats = [];

}
var newETag = '"' + etagFragments.join('-') + '-compiless"';
var newETag = (oldETagIsWeak ? 'W/' : '') + '"' + etagFragments.join('-') + '-compiless"';
res.setHeader('ETag', newETag);
if (ifNoneMatch && ifNoneMatch.indexOf(newETag) !== -1) {
return res.status(304).end();
return res.status(304).send();
}

@@ -98,0 +99,0 @@ }

{
"name": "express-compiless",
"version": "1.0.0",
"version": "1.0.1",
"description": "Express middleware that compiles less files to css on the way out.",

@@ -32,3 +32,3 @@ "main": "lib/compiless.js",

"devDependencies": {
"express": "4.9.5",
"express": "4.10.7",
"mocha": "=1.8.1",

@@ -35,0 +35,0 @@ "request": "=2.11.4",

@@ -34,2 +34,17 @@ var express = require('express'),

it('should respond with an ETag header and support conditional GET', function (done) {
request(baseUrl + '/simple.less', passError(done, function (response, body) {
expect(response.statusCode, 'to equal', 200);
expect(body, 'to equal', '#foo #bar {\n color: blue;\n}\n');
expect(response.headers['content-type'], 'to equal', 'text/css; charset=utf-8');
var etag = response.headers.etag;
expect(etag, 'to match', /^W\/".*-compiless"$/);
request({url: baseUrl + '/simple.less', headers: {'If-None-Match': etag}}, passError(done, function (response, body) {
expect(response.statusCode, 'to equal', 304);
expect(response.headers.etag, 'to equal', etag);
done();
}));
}));
});
it('should compile less file with @import to css with .compilessinclude rules first', function (done) {

@@ -36,0 +51,0 @@ request(baseUrl + '/stylesheet.less', passError(done, function (response, body) {

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