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

juice

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juice - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

# 7.0.0 / 2019-11-27
* Breaking: requires node 10+
* Please see changes in web-resource-inliner@6 for other details
# 6.0.0 / 2019-11-27
* Drop support for Node.js 4
# 5.2.0 / 2019-03-18

@@ -2,0 +11,0 @@

2

index.js

@@ -62,3 +62,3 @@ 'use strict';

function inlineExternal(html, inlineOptions, callback) {
var options = utils.extend({fileContent: html}, inlineOptions);
var options = Object.assign({fileContent: html}, inlineOptions);
inline.html(options, callback);

@@ -65,0 +65,0 @@ }

@@ -63,5 +63,4 @@ // Type definitions for Juice 3.0.0

rebaseRelativeTo?: string;
cssmin?: boolean;
strict?: boolean;
}
}

@@ -10,5 +10,5 @@ 'use strict';

var cheerioLoad = function(html, options, encodeEntities) {
options = utils.extend({decodeEntities: false}, options || {});
options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options);
html = encodeEntities(html);
return cheerio.load(html,options);
return cheerio.load(html, options);
};

@@ -15,0 +15,0 @@

@@ -112,12 +112,2 @@ 'use strict';

def: 'see docs for web-resource-inliner rebaseRelativeTo' },
'web-resources-cssmin': {
pMap: 'webResourcesCssmin',
map: 'cssmin',
def: 'see docs for web-resource-inliner cssmin',
coercion: JSON.parse },
'web-resources-uglify': {
pMap: 'webResourcesUglify',
map: 'uglify',
def: 'see docs for web-resource-inliner uglify',
coercion: JSON.parse },
'web-resources-strict': {

@@ -124,0 +114,0 @@ pMap: 'webResourcesStrict',

@@ -82,2 +82,7 @@ 'use strict';

var parsedSelector = selector.parsed();
if (!parsedSelector) {
return;
}
var pseudoElementType = getPseudoElementType(parsedSelector);

@@ -343,4 +348,10 @@

styleElement = this;
styleDataList = styleElement.childNodes;
// the API for Cheerio using parse5 (default) and htmlparser2 are slightly different
// detect this by checking if .childNodes exist (as opposed to .children)
var usingParse5 = !!styleElement.childNodes;
styleDataList = usingParse5 ? styleElement.childNodes : styleElement.children;
if (styleDataList.length !== 1) {
if (options.removeStyleTags) {
$(styleElement).remove();
}
return;

@@ -353,3 +364,4 @@ }

if (options.removeStyleTags && $(styleElement).attr('data-embed') === undefined) {
var preservedText = utils.getPreservedText(styleElement.childNodes[0].nodeValue, {
var text = usingParse5 ? styleElement.childNodes[0].nodeValue : styleElement.children[0].data;
var preservedText = utils.getPreservedText(text, {
mediaQueries: options.preserveMediaQueries,

@@ -361,3 +373,7 @@ fontFaces: options.preserveFontFaces,

if (preservedText) {
styleElement.childNodes[0].nodeValue = preservedText;
if (usingParse5) {
styleElement.childNodes[0].nodeValue = preservedText;
} else {
styleElement.children[0].data = preservedText;
}
} else {

@@ -364,0 +380,0 @@ $(styleElement).remove();

@@ -8,3 +8,2 @@ 'use strict';

var mensch = require('mensch');
var own = {}.hasOwnProperty;
var Selector = require('./selector');

@@ -150,13 +149,4 @@ var Property = require('./property');

exports.extend = function(obj, src) {
for (var key in src) {
if (own.call(src, key)) {
obj[key] = src[key];
}
}
return obj;
};
exports.getDefaultOptions = function(options) {
var result = exports.extend({
var result = Object.assign({
extraCss: '',

@@ -163,0 +153,0 @@ insertPreservedExtraCss: true,

{
"name": "juice",
"version": "6.0.0",
"version": "7.0.0",
"description": "Inlines css into html source",

@@ -8,2 +8,10 @@ "bin": "bin/juice",

"browser": "client.js",
"types": "juice.d.ts",
"files": [
"bin",
"lib",
"client.js",
"index.js",
"juice.d.ts"
],
"scripts": {

@@ -28,13 +36,10 @@ "test": "mocha --reporter spec && npm run test-typescript",

"engines": {
"node": ">=6.17.1"
"node": ">=10.0.0"
},
"types": "juice.d.ts",
"dependencies": {
"cheerio": "^0.22.0",
"commander": "^2.15.1",
"cross-spawn": "^6.0.5",
"deep-extend": "^0.6.0",
"cheerio": "^1.0.0-rc.3",
"commander": "^5.1.0",
"mensch": "^0.3.4",
"slick": "^1.12.2",
"web-resource-inliner": "^4.3.3"
"web-resource-inliner": "^5.0.0"
},

@@ -44,5 +49,6 @@ "devDependencies": {

"browserify": "^16.2.3",
"cross-spawn": "^6.0.5",
"mocha": "^5.2.0",
"should": "^11.1.1",
"typescript": "^2.9.1"
"typescript": "^3.9.6"
},

@@ -49,0 +55,0 @@ "repository": {

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