Socket
Socket
Sign inDemoInstall

critical

Package Overview
Dependencies
332
Maintainers
3
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.2 to 5.0.3

1

cli.js

@@ -47,2 +47,3 @@ #!/usr/bin/env node

alias: 'c',
isMultiple: true,
},

@@ -49,0 +50,0 @@ width: {

18

package.json
{
"name": "critical",
"version": "5.0.2",
"version": "5.0.3",
"description": "Extract & Inline Critical-path CSS from HTML",

@@ -39,12 +39,12 @@ "author": "Addy Osmani",

"globby": "^13.1.2",
"got": "^12.4.1",
"got": "^12.5.1",
"group-args": "^0.1.0",
"indent-string": "^5.0.0",
"inline-critical": "^9.0.1",
"inline-critical": "^10.0.1",
"is-glob": "^4.0.3",
"joi": "^17.6.0",
"joi": "^17.6.2",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"make-dir": "^3.1.0",
"meow": "^10.1.3",
"meow": "^10.1.4",
"oust": "^2.0.0",

@@ -55,3 +55,3 @@ "p-all": "^4.0.0",

"plugin-error": "^2.0.0",
"postcss": "^8.4.16",
"postcss": "^8.4.17",
"postcss-discard": "^2.0.0",

@@ -61,6 +61,6 @@ "postcss-image-inliner": "^6.0.1",

"replace-ext": "^2.0.0",
"slash": "^4.0.0",
"slash": "^5.0.0",
"tempy": "^3.0.0",
"through2": "^4.0.2",
"vinyl": "^2.2.1"
"vinyl": "^3.0.0"
},

@@ -73,3 +73,3 @@ "devDependencies": {

"get-port": "^6.1.2",
"jest": "^29.0.3",
"jest": "^29.1.2",
"nock": "^13.2.9",

@@ -76,0 +76,0 @@ "normalize-newline": "^4.1.0",

@@ -15,4 +15,4 @@ import {EOL} from 'node:os';

import {PAGE_UNLOADED_DURING_EXECUTION_ERROR_MESSAGE} from 'penthouse/lib/core.js';
import inlineCritical from 'inline-critical';
import {removeDuplicateStyles} from 'inline-critical/src/css.js';
import {inline as inlineCritical} from 'inline-critical';
import {removeDuplicateStyles} from 'inline-critical/css'; // eslint-disable-line n/file-extension-in-import
import parseCssUrls from 'css-url-parser';

@@ -19,0 +19,0 @@ import {reduceAsync} from './array.js';

@@ -38,2 +38,4 @@ import path from 'node:path';

export const checkCssOption = (css) => Boolean((!Array.isArray(css) && css) || (Array.isArray(css) && css.length > 0));
export async function outputFileAsync(file, data) {

@@ -797,3 +799,3 @@ const dir = path.dirname(file);

// to prevent document relative stylesheet paths if they are not relative specified
if (!Buffer.isBuffer(originalPath) && !isVinyl(filepath) && !isRemote(filepath) && css) {
if (!Buffer.isBuffer(originalPath) && !isVinyl(filepath) && !isRemote(filepath) && checkCssOption(css)) {
filepath = path.resolve(filepath);

@@ -808,3 +810,3 @@ }

// Restore original path for local files referenced from document and not from options
if (!Buffer.isBuffer(originalPath) && !isRemote(originalPath) && !css) {
if (!Buffer.isBuffer(originalPath) && !isRemote(originalPath) && !checkCssOption(css)) {
file.path = originalPath;

@@ -874,3 +876,3 @@ }

if (css) {
if (checkCssOption(css)) {
const files = await glob(css, options);

@@ -877,0 +879,0 @@ stylesheets = await mapAsync(files, (file) => getStylesheet(document, file, options));

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc