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

lessless

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lessless - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

test/roadmap.sublime-project

2

lib/lessless.js

@@ -49,3 +49,3 @@ var less = require('less'), fs = require('fs'), diveSync = require("diveSync");

function stripLessJS(contents) {
return contents.replace(/<script.*?less\.js.*?<\/script>/g, "");
return contents.replace(/<script.*?\bless\b[^"']*?\.js.*?<\/script>/g, "");
}

@@ -52,0 +52,0 @@

@@ -10,3 +10,3 @@ {

],
"version": "0.2.1",
"version": "0.2.2",
"repository": {

@@ -13,0 +13,0 @@ "type": "git",

@@ -68,3 +68,19 @@ var buster = require('buster')

});
it('should remove versioned and compressed "less" script tags', function() {
var html = "<script src='js/lib/less-1.2.1.min.js'></script>";
expect(html).toMatch(/js\/lib\/less-1\.2\.1\.min.js/);
//shouldn't strip it out
var newHTML = lessless.stripLessJS(html);
expect(newHTML).not().toMatch(/js\/lib\/less-1\.2\.1\.min.js/);
expect(newHTML).not().toMatch(/script/);
});
it('should not match scripts where "less" is not a standalone word', function() {
var html = "<script src='js/lib/boundless.js'></script>";
expect(html).toMatch(/js\/lib\/boundless.js/);
//shouldn't strip it out
var newHTML = lessless.stripLessJS(html);
expect(newHTML).toMatch(/js\/lib\/boundless.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