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

critters

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

critters - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

12

dist/critters.js
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var path = _interopDefault(require('path'));
var fs = require('fs');
var prettyBytes = _interopDefault(require('pretty-bytes'));

@@ -423,3 +424,3 @@ var parse5 = _interopDefault(require('parse5'));

function hasNestedRules(rule) {
return rule.nodes && rule.nodes.length && rule.nodes.some(n => n.type === 'rule' || n.type === 'atrule') && rule.name !== 'keyframes';
return rule.nodes && rule.nodes.length && rule.nodes.some(n => n.type === 'rule' || n.type === 'atrule') && rule.name !== 'keyframes' && rule.name !== '-webkit-keyframes';
} // Like [].filter(), but applies the opposite filtering result to a second copy of the Array without a second pass.

@@ -520,2 +521,3 @@ // This is just a quicker version of generating the compliment of the set returned from a filter operation.

* - **"js-lazy":** Like `"js"`, but the stylesheet is disabled until fully loaded.
* - **false:** Disables adding preload tags.
* @typedef {(default|'body'|'media'|'swap'|'swap-high'|'js'|'js-lazy')} PreloadStrategy

@@ -617,3 +619,3 @@ * @public

readFile(filename) {
const fs = this.fs;
const fs$1 = this.fs;
return new Promise((resolve, reject) => {

@@ -624,6 +626,6 @@ const callback = (err, data) => {

if (fs && fs.readFile) {
fs.readFile(filename, callback);
if (fs$1 && fs$1.readFile) {
fs$1.readFile(filename, callback);
} else {
require('fs').readFile(filename, 'utf8', callback);
fs.readFile(filename, 'utf8', callback);
}

@@ -630,0 +632,0 @@ });

{
"name": "critters",
"version": "0.0.15",
"version": "0.0.16",
"description": "Inline critical CSS and lazy-load the rest.",

@@ -50,3 +50,3 @@ "main": "dist/critters.js",

"chalk": "^4.1.0",
"css-select": "^4.1.3",
"css-select": "^4.2.0",
"parse5": "^6.0.1",

@@ -53,0 +53,0 @@ "parse5-htmlparser2-tree-adapter": "^6.0.1",

@@ -159,2 +159,3 @@ <p align="center">

* **"js-lazy":** Like `"js"`, but the stylesheet is disabled until fully loaded.
* **false:** Disables adding preload tags.

@@ -161,0 +162,0 @@ Type: (default | `"body"` | `"media"` | `"swap"` | `"swap-high"` | `"js"` | `"js-lazy"`)

@@ -160,3 +160,4 @@ /**

rule.nodes.some((n) => n.type === 'rule' || n.type === 'atrule') &&
rule.name !== 'keyframes'
rule.name !== 'keyframes' &&
rule.name !== '-webkit-keyframes'
);

@@ -163,0 +164,0 @@ }

@@ -18,2 +18,3 @@ /**

import path from 'path';
import { readFile } from 'fs';
import prettyBytes from 'pretty-bytes';

@@ -43,2 +44,3 @@ import { createDocument, serializeDocument } from './dom';

* - **"js-lazy":** Like `"js"`, but the stylesheet is disabled until fully loaded.
* - **false:** Disables adding preload tags.
* @typedef {(default|'body'|'media'|'swap'|'swap-high'|'js'|'js-lazy')} PreloadStrategy

@@ -151,3 +153,3 @@ * @public

} else {
require('fs').readFile(filename, 'utf8', callback);
readFile(filename, 'utf8', callback);
}

@@ -154,0 +156,0 @@ });

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