stylehacks
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -9,4 +9,5 @@ "use strict"; | ||
const node = selector.at(index); | ||
return node && node.value === value; | ||
return node && node.value.toLowerCase() === value; | ||
} | ||
module.exports = exports["default"]; |
@@ -34,7 +34,10 @@ 'use strict'; | ||
}); | ||
if (applied) { | ||
return list; | ||
} | ||
return [...list, hack]; | ||
}, []); | ||
css.walk(node => { | ||
@@ -45,5 +48,7 @@ processors.forEach(proc => { | ||
} | ||
if (opts.lint) { | ||
return proc.detectAndWarn(node); | ||
} | ||
return proc.detectAndResolve(node); | ||
@@ -58,2 +63,3 @@ }); | ||
const hack = new Plugin(); | ||
return hack.any(node); | ||
@@ -60,0 +66,0 @@ }); |
@@ -9,2 +9,3 @@ 'use strict'; | ||
const { selector } = node; | ||
// If the selector ends with a ':' it is likely a part of a custom mixin. | ||
@@ -14,4 +15,5 @@ if (!selector || selector[selector.length - 1] === ':') { | ||
} | ||
return false; | ||
} | ||
module.exports = exports['default']; |
@@ -21,2 +21,3 @@ "use strict"; | ||
}); | ||
this.nodes.push(node); | ||
@@ -28,4 +29,6 @@ } | ||
detect.apply(this, arguments); | ||
return !!node._stylehacks; | ||
} | ||
return false; | ||
@@ -36,3 +39,5 @@ } | ||
this.nodes = []; | ||
detect.apply(this, args); | ||
return this.resolve(); | ||
@@ -43,3 +48,5 @@ } | ||
this.nodes = []; | ||
detect.apply(this, args); | ||
return this.warn(); | ||
@@ -55,2 +62,3 @@ } | ||
const { message, browsers, identifier, hack } = node._stylehacks; | ||
return node.warn(this.result, message, { browsers, identifier, hack }); | ||
@@ -57,0 +65,0 @@ }); |
@@ -25,2 +25,3 @@ 'use strict'; | ||
const { before } = decl.raws; | ||
if (before && ~before.indexOf('_')) { | ||
@@ -32,2 +33,3 @@ this.push(decl, { | ||
} | ||
if (decl.prop[0] === '-' && decl.prop[1] !== '-' && _postcss2.default.vendor.prefix(decl.prop) === '') { | ||
@@ -34,0 +36,0 @@ this.push(decl, { |
@@ -21,3 +21,4 @@ 'use strict'; | ||
const params = rule.params.trim(); | ||
if (params === '\\0screen') { | ||
if (params.toLowerCase() === '\\0screen') { | ||
this.push(rule, { | ||
@@ -24,0 +25,0 @@ identifier: _identifiers.MEDIA_QUERY, |
@@ -21,3 +21,4 @@ 'use strict'; | ||
const params = rule.params.trim(); | ||
if (params === '\\0screen\\,screen\\9') { | ||
if (params.toLowerCase() === '\\0screen\\,screen\\9') { | ||
this.push(rule, { | ||
@@ -24,0 +25,0 @@ identifier: _identifiers.MEDIA_QUERY, |
@@ -21,3 +21,4 @@ 'use strict'; | ||
const params = rule.params.trim(); | ||
if (params === 'screen\\9') { | ||
if (params.toLowerCase() === 'screen\\9') { | ||
this.push(rule, { | ||
@@ -24,0 +25,0 @@ identifier: _identifiers.MEDIA_QUERY, |
@@ -27,4 +27,6 @@ 'use strict'; | ||
} | ||
const { selector } = rule; | ||
const trim = selector.trim(); | ||
if (trim.lastIndexOf(',') === selector.length - 1 || trim.lastIndexOf('\\') === selector.length - 1) { | ||
@@ -31,0 +33,0 @@ this.push(rule, { |
{ | ||
"name": "stylehacks", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Detect/remove browser hacks from CSS files.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
25001
24