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

critical

Package Overview
Dependencies
Maintainers
0
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

critical - npm Package Compare versions

Comparing version 7.1.2 to 7.2.0

2

index.js

@@ -19,3 +19,3 @@ import path from 'node:path';

try {
const options = getOptions(params);
const options = await getOptions(params);
const {target = {}, base = process.cwd()} = options;

@@ -22,0 +22,0 @@ const result = await create(options);

{
"name": "critical",
"version": "7.1.2",
"version": "7.2.0",
"description": "Extract & Inline Critical-path CSS from HTML",

@@ -35,11 +35,12 @@ "author": "Addy Osmani",

"dependencies": {
"@adobe/css-tools": "^4.3.3",
"@adobe/css-tools": "^4.4.0",
"async-traverse-tree": "^1.1.0",
"clean-css": "^5.3.3",
"common-tags": "^1.8.2",
"css-url-parser": "^1.1.3",
"data-uri-to-buffer": "^6.0.1",
"debug": "^4.3.4",
"css-url-parser": "^1.1.4",
"data-uri-to-buffer": "^6.0.2",
"debug": "^4.3.6",
"find-up": "^7.0.0",
"get-stdin": "^9.0.0",
"globby": "^14.0.1",
"globby": "^14.0.2",
"got": "^13.0.0",

@@ -50,3 +51,3 @@ "group-args": "^0.1.0",

"is-glob": "^4.0.3",
"joi": "^17.12.2",
"joi": "^17.13.3",
"lodash": "^4.17.21",

@@ -59,5 +60,5 @@ "lodash-es": "^4.17.21",

"penthouse": "^2.3.3",
"picocolors": "^1.0.0",
"picocolors": "^1.0.1",
"plugin-error": "^2.0.1",
"postcss": "^8.4.38",
"postcss": "^8.4.41",
"postcss-discard": "^2.0.0",

@@ -64,0 +65,0 @@ "postcss-image-inliner": "^7.0.1",

import process from 'node:process';
import Joi from 'joi';
import debugBase from 'debug';
import {traverse, STOP} from 'async-traverse-tree';
import {ConfigError} from './errors.js';

@@ -78,4 +79,19 @@

export function getOptions(options = {}) {
const {error, value} = schema.validate(options);
export async function getOptions(options = {}) {
const parsedOptions = await traverse(options, (key, value) => {
if (['css', 'html', 'src'].includes(key)) {
return STOP;
}
if (typeof value === 'string') {
try {
return JSON.parse(value);
} catch {}
}
return value;
});
const {error, value} = schema.validate(parsedOptions);
const {inline, dimensions, penthouse = {}, target, ignore} = value || {};

@@ -82,0 +98,0 @@

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