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

checkcss

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkcss - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

16

index.js
const seen = new Set();
let defined;
let ignoreRE;
export function ignoreCSS(re) {
ignoreRE = re;
}
function checkClassNames(node, includeChildren = false) {
if (node?.classList) {
for (const cl of node.classList) {
// Ignore if matches the ignore regex
if (ignoreRE.test(cl)) continue;
// Ignore defined and already-seen classes

@@ -25,2 +33,10 @@ if (defined.has(cl) || seen.has(cl)) continue;

for (const rule of rules) {
if (!rule) continue;
let cssRules;
try {
cssRules = rule.cssRules;
} catch (err) {
console.log(`Unable to access ${rule.href}`);
continue;
}
if (rule?.cssRules) { // Rules can contain sub-rules (e.g. @media, @print)

@@ -27,0 +43,0 @@ ingestRules(rule.cssRules);

2

package.json
{
"name": "checkcss",
"version": "1.0.2",
"version": "1.1.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Utility method for warning when elements have a `class` attribute that refers to an undefined CSS class",

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