purgecss-from-html 5.0.0 → 6.0.0

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.
@@ -1 +1 @@
1
- import s from"parse5";import*as t from"parse5-htmlparser2-tree-adapter";const e=(s,t)=>({attributes:{names:[...s.attributes.names,...t.attributes.names],values:[...s.attributes.values,...t.attributes.values]},classes:[...s.classes,...t.classes],ids:[...s.ids,...t.ids],tags:[...s.tags,...t.tags],undetermined:[]}),a=s=>{const t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[s.name],undetermined:[]};for(const[e,a]of Object.entries(s.attribs))"class"===e?t.classes.push(...a.split(" ")):"id"===e?t.ids.push(...a.split(" ")):(t.attributes.names.push(e),t.attributes.values.push(...a.split(" ")));return e(r(s),t)},r=s=>{let t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[],undetermined:[]};for(const i of s.children){const s=i;switch(s.type){case"tag":t=e(t,a(s));break;case"root":t=e(t,r(s))}}return t},i=e=>{const a=s.parse(e,{treeAdapter:t});return r(a)};export{i as default};
1
+ import*as s from"parse5";import*as t from"parse5-htmlparser2-tree-adapter";const e=(s,t)=>({attributes:{names:[...s.attributes.names,...t.attributes.names],values:[...s.attributes.values,...t.attributes.values]},classes:[...s.classes,...t.classes],ids:[...s.ids,...t.ids],tags:[...s.tags,...t.tags],undetermined:[]}),a=s=>{const t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[s.name],undetermined:[]};for(const[e,a]of Object.entries(s.attribs))"class"===e?t.classes.push(...a.split(" ")):"id"===e&&t.ids.push(...a.split(" ")),t.attributes.names.push(e),t.attributes.values.push(...a.split(" "));return e(r(s),t)},r=s=>{let t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[],undetermined:[]};for(const i of s.childNodes){const s=i;switch(s.type){case"tag":t=e(t,a(s));break;case"root":t=e(t,r(s))}}return t},i=e=>{const a=s.parse(e,{treeAdapter:t.adapter});return r(a)};export{i as default};
@@ -1 +1 @@
1
- "use strict";var e=require("parse5"),t=require("parse5-htmlparser2-tree-adapter");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var a=s(e),u=r(t);const n=(e,t)=>({attributes:{names:[...e.attributes.names,...t.attributes.names],values:[...e.attributes.values,...t.attributes.values]},classes:[...e.classes,...t.classes],ids:[...e.ids,...t.ids],tags:[...e.tags,...t.tags],undetermined:[]}),i=e=>{const t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[e.name],undetermined:[]};for(const[s,r]of Object.entries(e.attribs))"class"===s?t.classes.push(...r.split(" ")):"id"===s?t.ids.push(...r.split(" ")):(t.attributes.names.push(s),t.attributes.values.push(...r.split(" ")));return n(c(e),t)},c=e=>{let t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[],undetermined:[]};for(const s of e.children){const e=s;switch(e.type){case"tag":t=n(t,i(e));break;case"root":t=n(t,c(e))}}return t};module.exports=e=>{const t=a.default.parse(e,{treeAdapter:u});return c(t)};
1
+ "use strict";var e=require("parse5"),t=require("parse5-htmlparser2-tree-adapter");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var r=s(e),a=s(t);const u=(e,t)=>({attributes:{names:[...e.attributes.names,...t.attributes.names],values:[...e.attributes.values,...t.attributes.values]},classes:[...e.classes,...t.classes],ids:[...e.ids,...t.ids],tags:[...e.tags,...t.tags],undetermined:[]}),i=e=>{const t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[e.name],undetermined:[]};for(const[s,r]of Object.entries(e.attribs))"class"===s?t.classes.push(...r.split(" ")):"id"===s&&t.ids.push(...r.split(" ")),t.attributes.names.push(s),t.attributes.values.push(...r.split(" "));return u(n(e),t)},n=e=>{let t={attributes:{names:[],values:[]},classes:[],ids:[],tags:[],undetermined:[]};for(const s of e.childNodes){const e=s;switch(e.type){case"tag":t=u(t,i(e));break;case"root":t=u(t,n(e))}}return t};module.exports=e=>{const t=r.parse(e,{treeAdapter:a.adapter});return n(t)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purgecss-from-html",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "HTML extractor for PurgeCSS",
5
5
  "author": "Ffloriel",
6
6
  "homepage": "https://github.com/FullHuman/purgecss#readme",
@@ -25,12 +25,8 @@
25
25
  "url": "https://github.com/FullHuman/purgecss/issues"
26
26
  },
27
27
  "dependencies": {
28
- "parse5": "^6.0.0",
29
- "parse5-htmlparser2-tree-adapter": "^6.0.0"
30
- },
31
- "devDependencies": {
32
- "@types/parse5": "^6.0.0",
33
- "@types/parse5-htmlparser2-tree-adapter": "^6.0.0"
28
+ "parse5": "^7.1.2",
29
+ "parse5-htmlparser2-tree-adapter": "^7.0.0"
34
30
  },
35
31
  "publishConfig": {
36
32
  "access": "public",