stylehacks
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -43,3 +43,3 @@ "use strict"; | ||
processors.forEach(proc => { | ||
if (!~proc.nodeTypes.indexOf(node.type)) { | ||
if (!proc.nodeTypes.includes(node.type)) { | ||
return; | ||
@@ -46,0 +46,0 @@ } |
@@ -26,3 +26,3 @@ "use strict"; | ||
any(node) { | ||
if (~this.nodeTypes.indexOf(node.type)) { | ||
if (this.nodeTypes.includes(node.type)) { | ||
detect.apply(this, arguments); | ||
@@ -29,0 +29,0 @@ return !!node._stylehacks; |
@@ -42,3 +42,3 @@ "use strict"; | ||
hacks.some(hack => { | ||
if (~before.indexOf(hack)) { | ||
if (before.includes(hack)) { | ||
this.push(node, { | ||
@@ -45,0 +45,0 @@ identifier: _identifiers.PROPERTY, |
@@ -33,3 +33,3 @@ "use strict"; | ||
if (before && ~before.indexOf('_')) { | ||
if (before && before.includes('_')) { | ||
this.push(decl, { | ||
@@ -36,0 +36,0 @@ identifier: _identifiers.PROPERTY, |
{ | ||
"name": "stylehacks", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Detect/remove browser hacks from CSS files.", | ||
@@ -10,7 +10,2 @@ "main": "dist/index.js", | ||
], | ||
"scripts": { | ||
"prebuild": "del-cli dist", | ||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepublish": "yarn build" | ||
}, | ||
"keywords": [ | ||
@@ -35,3 +30,3 @@ "browsers", | ||
"dependencies": { | ||
"browserslist": "^4.16.0", | ||
"browserslist": "^4.16.6", | ||
"postcss-selector-parser": "^6.0.4" | ||
@@ -51,3 +46,7 @@ }, | ||
}, | ||
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc" | ||
} | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"" | ||
}, | ||
"readme": "# stylehacks\n\n> Detect/remove browser hacks from CSS files.\n\n\n## Install\n\nWith [npm](https://npmjs.org/package/stylehacks) do:\n\n```\nnpm install stylehacks --save\n```\n\n\n## Example\n\nIn its default mode, stylehacks will remove hacks from your CSS file, based on\nthe browsers that you wish to support.\n\n### Input\n\n```css\nh1 {\n _color: white;\n color: rgba(255, 255, 255, 0.5);\n}\n```\n\n### Output\n\n```css\nh1 {\n color: rgba(255, 255, 255, 0.5);\n}\n```\n\n\n## API\n\n### `stylehacks.detect(node)`\n\nType: `function` \nReturns: `boolean`\n\nThis method will take any PostCSS *node*, run applicable plugins depending on\nits type, then will return a boolean depending on whether it found any of\nthe supported hacks. For example, if the `decl` node found below is passed to\nthe `detect` function, it will return `true`. But if the `rule` node is passed,\nit will return `false` instead.\n\n```css\nh1 { _color: red }\n```\n\n### `postcss([ stylehacks(opts) ])`\n\nstylehacks can also be consumed as a PostCSS plugin. See the\n[documentation](https://github.com/postcss/postcss#usage) for examples for\nyour environment.\n\n#### options\n\n##### lint\n\nType: `boolean` \nDefault: `false`\n\nIf lint mode is enabled, stylehacks will not remove hacks from the CSS; instead,\nit will add warnings to `Result#messages`.\n\n\n## Related\n\nstylehacks works well with your existing PostCSS setup:\n\n* [stylelint] - Comprehensive & modern CSS linter, to ensure that your code\n style rules are respected.\n\n\n## Contributing\n\nPull requests are welcome. If you add functionality, then please add unit tests\nto cover it.\n\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n\n[stylelint]: https://github.com/stylelint/stylelint\n" | ||
} |
@@ -55,4 +55,8 @@ # stylehacks | ||
### `stylehacks.process(css, [options]).then(function(result) {})` | ||
### `postcss([ stylehacks(opts) ])` | ||
stylehacks can also be consumed as a PostCSS plugin. See the | ||
[documentation](https://github.com/postcss/postcss#usage) for examples for | ||
your environment. | ||
#### options | ||
@@ -69,9 +73,2 @@ | ||
### `postcss([ stylehacks(opts) ])` | ||
stylehacks can also be consumed as a PostCSS plugin. See the | ||
[documentation](https://github.com/postcss/postcss#usage) for examples for | ||
your environment. | ||
## Related | ||
@@ -78,0 +75,0 @@ |
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
25519
24
92
Updatedbrowserslist@^4.16.6