has-pseudo-class
Advanced tools
Comparing version 0.0.1 to 1.0.1
12
index.js
@@ -1,12 +0,12 @@ | ||
'use strict'; | ||
'use strict' | ||
var pseudoClasses = require('pseudo-classes') | ||
module.exports = function hasPseudoClass(selector) { | ||
if (typeof selector != 'string') { | ||
throw new TypeError('has-pseudo-class expects a string'); | ||
module.exports = function hasPseudoClass (selector) { | ||
if (typeof selector !== 'string') { | ||
throw new TypeError('has-pseudo-class expected a string') | ||
} | ||
var pseudoClassRegex = new RegExp(':' + pseudoClasses().join('|:'), 'ig'); | ||
return pseudoClassRegex.test(selector); | ||
var pseudoClassRegex = new RegExp(':' + pseudoClasses().join('|:'), 'ig') | ||
return pseudoClassRegex.test(selector) | ||
} |
{ | ||
"name": "has-pseudo-class", | ||
"description": "Determine whether a selector contains a pseudo-class.", | ||
"author": "John Otander", | ||
"version": "0.0.1", | ||
"description": "Determine whether a selector contains a pseudo-class", | ||
"author": "John Otander <johnotander@gmail.com> (johnotander.com)", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "mocha test" | ||
"test": "ava" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/johnotander/has-pseudo-class.git" | ||
}, | ||
"keywords": [], | ||
"repository": "cssstats/has-pseudo-class", | ||
"keywords": [ | ||
"css", | ||
"pseudo", | ||
"class", | ||
"has" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/johnotander/has-pseudo-class/issues" | ||
}, | ||
"homepage": "https://github.com/johnotander/has-pseudo-class", | ||
"dependencies": { | ||
@@ -27,4 +25,4 @@ "pseudo-classes": "0.0.1" | ||
"devDependencies": { | ||
"mocha": "*" | ||
"ava": "^0.8.0" | ||
} | ||
} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2944
4
9
1
1
1