Symdiff
Calculates symmetric difference between CSS and template classes.
Install / Use
/learn @symdiff/SymdiffREADME
symdiff
Calculates symmetric difference between two arrays of strings. Main purpose is to detect unused CSS classes.
API
symdiff takes three arrays of strings as arguments:
- the classes used in CSS
- the classes used in templates
- classes to ignore
It outputs an object with the fields css and templates. For instance:
var css = ["grid", "grid-col", "grid-row"],
html= ["grid" ],
ignr= [ "grid-col" ];
symdiff(css, html, ignr)
> { css: ["grid-row"], templates: [] }
License
Apache 2
