fetch-css 4.0.7 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crx-to-zip.js CHANGED
@@ -4,8 +4,6 @@
4
4
  import encLatin1 from "crypto-js/enc-latin1.js";
5
5
  import sha256 from "crypto-js/sha256.js";
6
6
 
7
- const btoa = require("base-64").encode;
8
-
9
7
  function calcLength(a, b, c, d) {
10
8
  let length = 0;
11
9
  length += a << 0; // eslint-disable-line unicorn/prefer-math-trunc
package/index.js CHANGED
@@ -5,10 +5,10 @@ import {parseFragment} from "parse5";
5
5
  import unzipper from "unzipper";
6
6
  import urlToolkit from "url-toolkit";
7
7
  import crxToZip from "./crx-to-zip.js";
8
- import nodeFetch from "node-fetch";
8
+ import {fetch as undiciFetch} from "undici";
9
9
  import fetchEnhanced from "fetch-enhanced";
10
10
 
11
- const fetch = fetchEnhanced(nodeFetch, {undici: false});
11
+ const fetch = fetchEnhanced(undiciFetch, {undici: true});
12
12
  const clone = cloner();
13
13
 
14
14
  async function extract(res) {
@@ -71,7 +71,7 @@ function extractCssFromJs(js) {
71
71
  onToken: token => {
72
72
  if (token.type.label === "string") {
73
73
  const str = token.value.trim()
74
- .replace(/\n/gm, "")
74
+ .replace(/\n/g, "")
75
75
  .replace(/^\);}/, ""); // this is probably not universal to webpack's css-in-js strings
76
76
 
77
77
  if (str.length > 25 && isValidCSS(str)) { // hackish treshold to ignore short strings that may be valid CSS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fetch-css",
3
- "version": "4.0.7",
3
+ "version": "4.0.9",
4
4
  "description": "Extract CSS from websites and browser extensions",
5
5
  "author": "silverwind",
6
6
  "repository": "silverwind/fetch-css",
@@ -22,21 +22,20 @@
22
22
  "crx-to-zip.js"
23
23
  ],
24
24
  "dependencies": {
25
- "acorn": "8.8.1",
26
- "base-64": "1.0.0",
25
+ "acorn": "8.8.2",
27
26
  "crypto-js": "4.1.1",
28
- "fetch-enhanced": "11.1.0",
29
- "node-fetch": "3.3.0",
27
+ "fetch-enhanced": "11.1.1",
30
28
  "parse5": "7.1.2",
31
- "postcss": "8.4.20",
29
+ "postcss": "8.4.23",
32
30
  "rfdc": "1.3.0",
31
+ "undici": "5.22.0",
33
32
  "unzipper": "0.10.11",
34
33
  "url-toolkit": "2.2.5"
35
34
  },
36
35
  "devDependencies": {
37
- "eslint": "8.30.0",
38
- "eslint-config-silverwind": "65.0.0",
39
- "updates": "13.2.6",
40
- "versions": "10.4.1"
36
+ "eslint": "8.40.0",
37
+ "eslint-config-silverwind": "69.0.2",
38
+ "updates": "14.1.0",
39
+ "versions": "11.0.0"
41
40
  }
42
41
  }