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

postcss-discard-comments

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-discard-comments - npm Package Compare versions

Comparing version 2.0.4 to 4.0.0-rc.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 4.0.0-rc.0
* Breaking: Drops support for Node 0.12, we now require at least Node 4.
* Breaking: Update PostCSS to 6.0.0.
# 2.0.4

@@ -2,0 +7,0 @@

16

dist/index.js
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _postcss = require('postcss');
var _commentRemover = require('./lib/commentRemover');

@@ -13,10 +17,7 @@

var _postcss = require('postcss');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var space = _postcss.list.space;
exports.default = (0, _postcss.plugin)('postcss-discard-comments', function () {
var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

@@ -32,7 +33,4 @@ var remover = new _commentRemover2.default(opts);

function replaceComments(source) {
var separator = arguments.length <= 1 || arguments[1] === undefined ? ' ' : arguments[1];
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
if (!source) {
return source;
}
var parsed = (0, _commentParser2.default)(source).reduce(function (value, node) {

@@ -39,0 +37,0 @@ if (node.type !== 'comment') {

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = commentParser;

@@ -9,3 +11,3 @@ function commentParser(input) {

var pos = 0;
var next = undefined;
var next = void 0;

@@ -23,5 +25,2 @@ while (pos < length) {

next = input.indexOf('*/', pos + 2);
if (! ~next) {
throw new Error('postcss-discard-comments: Unclosed */');
}
tokens.push({

@@ -28,0 +27,0 @@ type: 'comment',

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
function CommentRemover(options) {

@@ -16,10 +18,10 @@ this.options = options;

return true;
} else if (isImportant) {
if (this.options.removeAll || this._hasFirst) {
return true;
} else if (this.options.removeAllButFirst && !this._hasFirst) {
this._hasFirst = true;
return false;
}
}
if (this.options.removeAll || this._hasFirst) {
return true;
} else if (this.options.removeAllButFirst && !this._hasFirst) {
this._hasFirst = true;
return false;
}
}

@@ -26,0 +28,0 @@ };

{
"name": "postcss-discard-comments",
"version": "2.0.4",
"version": "4.0.0-rc.0",
"description": "Discard comments in your CSS files with PostCSS.",

@@ -11,5 +11,3 @@ "main": "dist/index.js",

"scripts": {
"pretest": "eslint src",
"prepublish": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/",
"test": "ava src/__tests__"
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
},

@@ -24,16 +22,8 @@ "keywords": [

"devDependencies": {
"ava": "^0.11.0",
"babel-cli": "^6.5.1",
"babel-core": "^6.5.1",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.5.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.5.0",
"del-cli": "^0.2.0",
"eslint": "^1.10.3",
"eslint-config-cssnano": "^1.0.0",
"postcss-scss": "^0.1.3",
"postcss-simple-vars": "^1.2.0"
"babel-cli": "^6.0.0",
"cross-env": "^3.0.0",
"postcss-scss": "^0.3.0",
"postcss-simple-vars": "^3.0.0"
},
"homepage": "https://github.com/ben-eb/postcss-discard-comments",
"homepage": "https://github.com/ben-eb/cssnano",
"author": {

@@ -44,12 +34,12 @@ "name": "Ben Briggs",

},
"repository": "ben-eb/postcss-discard-comments",
"repository": "ben-eb/cssnano",
"dependencies": {
"postcss": "^5.0.14"
"postcss": "^6.0.0"
},
"ava": {
"require": "babel-core/register"
"bugs": {
"url": "https://github.com/ben-eb/cssnano/issues"
},
"eslintConfig": {
"extends": "cssnano"
"engines": {
"node": ">=4"
}
}

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

# [postcss][postcss]-discard-comments [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-comments.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-comments.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-comments.svg)][deps]
# [postcss][postcss]-discard-comments

@@ -104,6 +104,5 @@ > Discard comments in your CSS files with PostCSS.

## Contributing
## Contributors
Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.
See [CONTRIBUTORS.md](https://github.com/ben-eb/cssnano/blob/master/CONTRIBUTORS.md).

@@ -113,8 +112,5 @@

MIT © Ben Briggs
MIT © [Ben Briggs](http://beneb.info)
[ci]: https://travis-ci.org/ben-eb/postcss-discard-comments
[deps]: https://gemnasium.com/ben-eb/postcss-discard-comments
[npm]: http://badge.fury.io/js/postcss-discard-comments
[postcss]: https://github.com/postcss/postcss
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