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

clear-cut

Package Overview
Dependencies
Maintainers
6
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clear-cut - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

appveyor.yml

42

index.js

@@ -95,27 +95,29 @@ /**

if (global.document) {
var validSelectorCache = {};
var testSelectorElement = global.document.createElement('div');
var validSelectorCache = {};
var testSelectorElement = null;
exports.isSelectorValid = function(selector) {
var valid = validSelectorCache[selector];
if (valid === undefined) {
try {
testSelectorElement.querySelector(selector);
valid = true;
} catch (error) {
valid = false;
}
validSelectorCache[selector] = valid;
exports.isSelectorValid = function(selector) {
var valid = validSelectorCache[selector];
if (valid === undefined) {
if (testSelectorElement == null) {
testSelectorElement = document.createElement('div')
}
return valid;
}
exports.validateSelector = function(selector) {
if (!exports.isSelectorValid(selector)) {
var error = new SyntaxError(selector + ' is not a valid selector');
error.code = 'EBADSELECTOR';
throw error;
try {
testSelectorElement.querySelector(selector);
valid = true;
} catch (error) {
valid = false;
}
validSelectorCache[selector] = valid;
}
return valid;
}
exports.validateSelector = function(selector) {
if (!exports.isSelectorValid(selector)) {
var error = new SyntaxError(selector + ' is not a valid selector');
error.code = 'EBADSELECTOR';
throw error;
}
}
{
"name": "clear-cut",
"version": "2.0.1",
"version": "2.0.2",
"description": "Calculate specificity of CSS selectors",

@@ -8,3 +8,3 @@ "main": "./index.js",

"benchmark": "coffee benchmark/benchmark.coffee",
"test": "node node_modules/.bin/jasmine-focused --coffee --captureExceptions spec"
"test": "node_modules/.bin/jasmine-focused --coffee --captureExceptions spec"
},

@@ -11,0 +11,0 @@ "license": "MIT",

@@ -1,2 +0,4 @@

# clear cut [![Build Status](https://travis-ci.org/atom/clear-cut.png?branch=master)](https://travis-ci.org/atom/clear-cut)
# Clear cut
[![OS X Build Status](https://travis-ci.org/atom/clear-cut.png?branch=master)](https://travis-ci.org/atom/clear-cut)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/civ54x89l06286m9/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/clear-cut/branch/master) [![Dependency Status](https://david-dm.org/atom/clear-cut.svg)](https://david-dm.org/atom/clear-cut)

@@ -3,0 +5,0 @@ Calculate the specificity of a CSS selector

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