gulp-purgecss
Advanced tools
Comparing version 2.3.0 to 3.0.0
import internal from "stream"; | ||
type ExtractorFunction<T = string> = (content: T) => string[]; | ||
interface RawContent<T = string> { | ||
extension: string; | ||
raw: T; | ||
} | ||
interface RawCSS { | ||
raw: string; | ||
} | ||
interface ExtractorResultDetailed { | ||
attributes: { | ||
names: string[]; | ||
values: string[]; | ||
}; | ||
classes: string[]; | ||
ids: string[]; | ||
tags: string[]; | ||
undetermined: string[]; | ||
} | ||
type ExtractorResult = ExtractorResultDetailed | string[]; | ||
type ExtractorFunction<T = string> = (content: T) => ExtractorResult; | ||
interface Extractors { | ||
@@ -7,4 +25,14 @@ extensions: string[]; | ||
} | ||
type StringRegExpArray = Array<RegExp | string>; | ||
type ComplexSafelist = { | ||
standard?: StringRegExpArray; | ||
deep?: RegExp[]; | ||
greedy?: RegExp[]; | ||
variables?: StringRegExpArray; | ||
keyframes?: StringRegExpArray; | ||
}; | ||
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist; | ||
interface UserDefinedOptions { | ||
content: Array<string>; | ||
content: Array<string | RawContent>; | ||
css: Array<string | RawCSS>; | ||
defaultExtractor?: ExtractorFunction; | ||
@@ -19,7 +47,10 @@ extractors?: Array<Extractors>; | ||
variables?: boolean; | ||
whitelist?: string[]; | ||
whitelistPatterns?: Array<RegExp>; | ||
whitelistPatternsChildren?: Array<RegExp>; | ||
safelist?: UserDefinedSafelist; | ||
blocklist?: StringRegExpArray; | ||
} | ||
declare function gulpPurgeCSS(options: UserDefinedOptions): internal.Transform; | ||
type PurgeCSSUserDefinedOptions = UserDefinedOptions; | ||
interface UserDefinedOptions$0 extends Omit<PurgeCSSUserDefinedOptions, "css" | "content"> { | ||
content: string[]; | ||
} | ||
declare function gulpPurgeCSS(options: UserDefinedOptions$0): internal.Transform; | ||
export { gulpPurgeCSS as default }; |
import internal from "stream"; | ||
type ExtractorFunction<T = string> = (content: T) => string[]; | ||
interface RawContent<T = string> { | ||
extension: string; | ||
raw: T; | ||
} | ||
interface RawCSS { | ||
raw: string; | ||
} | ||
interface ExtractorResultDetailed { | ||
attributes: { | ||
names: string[]; | ||
values: string[]; | ||
}; | ||
classes: string[]; | ||
ids: string[]; | ||
tags: string[]; | ||
undetermined: string[]; | ||
} | ||
type ExtractorResult = ExtractorResultDetailed | string[]; | ||
type ExtractorFunction<T = string> = (content: T) => ExtractorResult; | ||
interface Extractors { | ||
@@ -7,4 +25,14 @@ extensions: string[]; | ||
} | ||
type StringRegExpArray = Array<RegExp | string>; | ||
type ComplexSafelist = { | ||
standard?: StringRegExpArray; | ||
deep?: RegExp[]; | ||
greedy?: RegExp[]; | ||
variables?: StringRegExpArray; | ||
keyframes?: StringRegExpArray; | ||
}; | ||
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist; | ||
interface UserDefinedOptions { | ||
content: Array<string>; | ||
content: Array<string | RawContent>; | ||
css: Array<string | RawCSS>; | ||
defaultExtractor?: ExtractorFunction; | ||
@@ -19,7 +47,10 @@ extractors?: Array<Extractors>; | ||
variables?: boolean; | ||
whitelist?: string[]; | ||
whitelistPatterns?: Array<RegExp>; | ||
whitelistPatternsChildren?: Array<RegExp>; | ||
safelist?: UserDefinedSafelist; | ||
blocklist?: StringRegExpArray; | ||
} | ||
declare function gulpPurgeCSS(options: UserDefinedOptions): internal.Transform; | ||
type PurgeCSSUserDefinedOptions = UserDefinedOptions; | ||
interface UserDefinedOptions$0 extends Omit<PurgeCSSUserDefinedOptions, "css" | "content"> { | ||
content: string[]; | ||
} | ||
declare function gulpPurgeCSS(options: UserDefinedOptions$0): internal.Transform; | ||
export { gulpPurgeCSS as default }; |
@@ -1,1 +0,1 @@ | ||
import e from"through2";import r from"plugin-error";import t from"glob";import n from"purgecss";export default function(o){return e.obj((async function(e,s,c){if(e.isNull())return c(null,e);if(e.isBuffer())try{const r={...o,content:(i=o.content,i.reduce((e,r)=>[...e,...t.sync(r)],[])),css:[{raw:e.contents.toString()}],stdin:!0},s=(await(new n).purge(r))[0],u=r.rejected&&s.rejected?s.rejected.join(" {}\n")+" {}":s.css;e.contents=Buffer.from(u,"utf-8"),c(null,e)}catch(e){this.emit("error",new r("gulp-purgecss",e.message))}var i;if(e.isStream()){const t=e;let s="";t.on("readable",e=>{s+=e.read().toString()}).on("end",async()=>{try{const r={...o,css:[s]},i=(await(new n).purge(r))[0],u=r.rejected&&i.rejected?i.rejected.join(" {}\n")+" {}":i.css;t.contents=Buffer.from(u,"utf-8"),c(null,e)}catch(e){this.emit("error",new r("gulp-purgecss",e.message))}})}}))} | ||
import e from"through2";import r from"plugin-error";import t from"glob";import n from"purgecss";function o(o){return e.obj((async function(e,s,c){if(e.isNull())return c(null,e);if(e.isBuffer())try{const r={...o,content:(i=o.content,i.reduce((e,r)=>[...e,...t.sync(r)],[])),css:[{raw:e.contents.toString()}],stdin:!0},s=(await(new n).purge(r))[0],u=r.rejected&&s.rejected?s.rejected.join(" {}\n")+" {}":s.css;e.contents=Buffer.from(u,"utf-8"),c(null,e)}catch(e){this.emit("error",new r("gulp-purgecss",e.message))}var i;if(e.isStream()){const t=e;let s="";t.on("readable",e=>{s+=e.read().toString()}).on("end",async()=>{try{const r={...o,css:[s]},i=(await(new n).purge(r))[0],u=r.rejected&&i.rejected?i.rejected.join(" {}\n")+" {}":i.css;t.contents=Buffer.from(u,"utf-8"),c(null,e)}catch(e){this.emit("error",new r("gulp-purgecss",e.message))}})}}))}export default o; |
@@ -1,1 +0,1 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=e(require("through2")),t=e(require("plugin-error")),n=e(require("glob")),s=e(require("purgecss"));module.exports=function(e){return r.obj((async function(r,c,u){if(r.isNull())return u(null,r);if(r.isBuffer())try{const t={...e,content:(o=e.content,o.reduce((e,r)=>[...e,...n.sync(r)],[])),css:[{raw:r.contents.toString()}],stdin:!0},c=(await(new s).purge(t))[0],i=t.rejected&&c.rejected?c.rejected.join(" {}\n")+" {}":c.css;r.contents=Buffer.from(i,"utf-8"),u(null,r)}catch(e){this.emit("error",new t("gulp-purgecss",e.message))}var o;if(r.isStream()){const n=r;let c="";n.on("readable",e=>{c+=e.read().toString()}).on("end",async()=>{try{const t={...e,css:[c]},o=(await(new s).purge(t))[0],i=t.rejected&&o.rejected?o.rejected.join(" {}\n")+" {}":o.css;n.contents=Buffer.from(i,"utf-8"),u(null,r)}catch(e){this.emit("error",new t("gulp-purgecss",e.message))}})}}))}; | ||
"use strict";var e=require("through2"),t=require("plugin-error"),r=require("glob"),n=require("purgecss");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),c=u(t),o=u(r),i=u(n);module.exports=function(e){return s.default.obj((async function(t,r,n){if(t.isNull())return n(null,t);if(t.isBuffer())try{const r={...e,content:(u=e.content,u.reduce((e,t)=>[...e,...o.default.sync(t)],[])),css:[{raw:t.contents.toString()}],stdin:!0},s=(await(new i.default).purge(r))[0],c=r.rejected&&s.rejected?s.rejected.join(" {}\n")+" {}":s.css;t.contents=Buffer.from(c,"utf-8"),n(null,t)}catch(e){this.emit("error",new c.default("gulp-purgecss",e.message))}var u;if(t.isStream()){const r=t;let u="";r.on("readable",e=>{u+=e.read().toString()}).on("end",async()=>{try{const s={...e,css:[u]},c=(await(new i.default).purge(s))[0],o=s.rejected&&c.rejected?c.rejected.join(" {}\n")+" {}":c.css;r.contents=Buffer.from(o,"utf-8"),n(null,t)}catch(e){this.emit("error",new c.default("gulp-purgecss",e.message))}})}}))}; |
{ | ||
"name": "gulp-purgecss", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "Gulp plugin for purgecss", | ||
@@ -40,4 +40,4 @@ "author": "Ffloriel", | ||
"plugin-error": "^1.0.1", | ||
"purgecss": "^2.3.0", | ||
"through2": "^3.0.1" | ||
"purgecss": "^3.0.0", | ||
"through2": "^4.0.1" | ||
}, | ||
@@ -52,3 +52,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "5314e41edf328e2ad2639549e1587b82a964a42e" | ||
"gitHead": "4a2a9504a41fe361f5aa36f3a2e50eabee84aec0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9866
116
+ Addedcommander@6.2.1(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedpurgecss@3.1.3(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedthrough2@4.0.2(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcommander@5.1.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedpostcss@7.0.32(transitive)
- Removedpurgecss@2.3.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsupports-color@5.5.06.1.0(transitive)
- Removedthrough2@3.0.2(transitive)
Updatedpurgecss@^3.0.0
Updatedthrough2@^4.0.1