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

minimize

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimize - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

5

lib/helpers.js

@@ -19,3 +19,4 @@ 'use strict';

quotes: false, // remove(false) or retain(true) quotes if not required
loose: false // remove(false) all or retain(true) one whitespace
loose: false, // remove(false) all or retain(true) one whitespace
whitespace: false // remove(false) or retain(true) whitespace in attributes
};

@@ -153,3 +154,3 @@

//
return result + '=' + self.quote(compact(value).trim());
return result + '=' + self.quote(!self.config.whitespace ? compact(value).trim() : value);
}, '');

@@ -156,0 +157,0 @@ };

2

package.json
{
"name": "minimize",
"version": "1.4.1",
"version": "1.5.0",
"description": "Minimize HTML",

@@ -5,0 +5,0 @@ "main": "./lib/minimize",

@@ -27,2 +27,3 @@ {

"conditionalcomments": "<head><!--[if IE 6]>Special instructions for IE 6 here<![endif]--></head><h1><!-- Some comments thats either removed or kept --></h1>",
"whitespace": "<input value=\" with newlines \n and whitespace\">",
"doctype": {

@@ -29,0 +30,0 @@ "data": "!doctype html",

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

it('should be configurable to retain whitespace and newlines of attributes', function (done) {
var whitespace = new Minimize({ whitespace: true });
whitespace.parse(html.whitespace, function (error, result) {
expect(result).to.equal('<input value=\" with newlines \n and whitespace\">');
done();
});
});
it('should leave structural elements (like scripts and code) intact', function (done) {

@@ -271,2 +279,10 @@ minimize.parse(html.code, function (error, result) {

it('should keep empty attribute values with if empty and spare options are set', function (done) {
var empty = new Minimize({ empty: true, spare: true });
empty.parse('<option value="">Select something</option>', function (error, result) {
expect(result).to.equal('<option value="">Select something</option>');
done();
});
});
it('should be configurable to retain CDATA', function (done) {

@@ -273,0 +289,0 @@ var cdata = new Minimize({ cdata: true });

Sorry, the diff of this file is not supported yet

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