Socket
Socket
Sign inDemoInstall

postcss

Package Overview
Dependencies
4
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.8 to 4.1.9

5

CHANGELOG.md

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

## 4.1.9
* Speed up `node.clone()`.
## 4.1.8
* Accepts `Processor` instance in `postcss()` constructor too.
* Accepts `Processor` instance in `postcss()` constructor too.

@@ -4,0 +7,0 @@ ## 4.1.7

12

lib/at-rule.js

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Container2 = require('./container');
var _container = require('./container');
var _Container3 = _interopRequireDefault(_Container2);
var _container2 = _interopRequireDefault(_container);

@@ -67,5 +67,5 @@ var AtRule = (function (_Container) {

return AtRule;
})(_Container3['default']);
})(_container2['default']);
exports['default'] = AtRule;
module.exports = exports['default'];

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Node2 = require('./node');
var _node = require('./node');
var _Node3 = _interopRequireDefault(_Node2);
var _node2 = _interopRequireDefault(_node);

@@ -35,5 +35,5 @@ var Comment = (function (_Node) {

return Comment;
})(_Node3['default']);
})(_node2['default']);
exports['default'] = Comment;
module.exports = exports['default'];

@@ -5,21 +5,21 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Declaration = require('./declaration');
var _declaration = require('./declaration');
var _Declaration2 = _interopRequireDefault(_Declaration);
var _declaration2 = _interopRequireDefault(_declaration);
var _Comment = require('./comment');
var _comment = require('./comment');
var _Comment2 = _interopRequireDefault(_Comment);
var _comment2 = _interopRequireDefault(_comment);
var _Node2 = require('./node');
var _node = require('./node');
var _Node3 = _interopRequireDefault(_Node2);
var _node2 = _interopRequireDefault(_node);

@@ -38,5 +38,5 @@ var Container = (function (_Node) {

Container.prototype.stringifyContent = function stringifyContent(builder) {
if (!this.nodes) {
return;
}var i = undefined,
if (!this.nodes) return;
var i = undefined,
last = this.nodes.length - 1;

@@ -87,5 +87,5 @@ while (last > 0) {

if (!this.nodes) {
return undefined;
}var index = undefined,
if (!this.nodes) return undefined;
var index = undefined,
result = undefined;

@@ -102,5 +102,3 @@ while (this.indexes[id] < this.nodes.length) {

if (result === false) {
return false;
}
if (result === false) return false;
};

@@ -373,3 +371,3 @@

}
nodes = [new _Declaration2['default'](nodes)];
nodes = [new _declaration2['default'](nodes)];
} else if (nodes.selector) {

@@ -382,3 +380,3 @@ var Rule = require('./rule');

} else if (nodes.text) {
nodes = [new _Comment2['default'](nodes)];
nodes = [new _comment2['default'](nodes)];
} else {

@@ -418,5 +416,5 @@ throw 'Unknown node type in node creation';

return Container;
})(_Node3['default']);
})(_node2['default']);
exports['default'] = Container;
module.exports = exports['default'];

@@ -5,7 +5,7 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }

@@ -20,26 +20,22 @@ var _warnOnce = require('./warn-once');

var _this = new _SyntaxError(message);
_SyntaxError.call(this, message);
this.reason = message;
_this.__proto__ = CssSyntaxError.prototype;
_this.reason = message;
_this.message = plugin ? plugin + ': ' : '';
_this.message += file ? file : '<css input>';
this.message = plugin ? plugin + ': ' : '';
this.message += file ? file : '<css input>';
if (typeof line !== 'undefined' && typeof column !== 'undefined') {
_this.line = line;
_this.column = column;
_this.message += ':' + line + ':' + column + ': ' + message;
this.line = line;
this.column = column;
this.message += ':' + line + ':' + column + ': ' + message;
} else {
_this.message += ': ' + message;
this.message += ': ' + message;
}
if (file) _this.file = file;
if (source) _this.source = source;
if (plugin) _this.plugin = plugin;
if (file) this.file = file;
if (source) this.source = source;
if (plugin) this.plugin = plugin;
if (Error.captureStackTrace) {
Error.captureStackTrace(_this, CssSyntaxError);
Error.captureStackTrace(this, CssSyntaxError);
}
return _this;
}

@@ -50,5 +46,5 @@

CssSyntaxError.prototype.showSourceCode = function showSourceCode(color) {
if (!this.source) {
return '';
}var num = this.line - 1;
if (!this.source) return '';
var num = this.line - 1;
var lines = this.source.split('\n');

@@ -55,0 +51,0 @@

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Node2 = require('./node');
var _node = require('./node');
var _Node3 = _interopRequireDefault(_Node2);
var _node2 = _interopRequireDefault(_node);

@@ -42,5 +42,5 @@ var Declaration = (function (_Node) {

return Declaration;
})(_Node3['default']);
})(_node2['default']);
exports['default'] = Declaration;
module.exports = exports['default'];

@@ -5,13 +5,13 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _CssSyntaxError = require('./css-syntax-error');
var _cssSyntaxError = require('./css-syntax-error');
var _CssSyntaxError2 = _interopRequireDefault(_CssSyntaxError);
var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
var _PreviousMap = require('./previous-map');
var _previousMap = require('./previous-map');
var _PreviousMap2 = _interopRequireDefault(_PreviousMap);
var _previousMap2 = _interopRequireDefault(_previousMap);

@@ -40,3 +40,3 @@ var _path = require('path');

var map = new _PreviousMap2['default'](this.css, opts, this.id);
var map = new _previousMap2['default'](this.css, opts, this.id);
if (map.text) {

@@ -61,9 +61,9 @@ this.map = map;

var error = new _CssSyntaxError2['default'](message);
var error = new _cssSyntaxError2['default'](message);
var origin = this.origin(line, column);
if (origin) {
error = new _CssSyntaxError2['default'](message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
error = new _cssSyntaxError2['default'](message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
} else {
error = new _CssSyntaxError2['default'](message, line, column, this.css, this.file, opts.plugin);
error = new _cssSyntaxError2['default'](message, line, column, this.css, this.file, opts.plugin);
}

@@ -82,10 +82,9 @@

Input.prototype.origin = function origin(line, column) {
if (!this.map) {
return false;
}var consumer = this.map.consumer();
if (!this.map) return false;
var consumer = this.map.consumer();
var from = consumer.originalPositionFor({ line: line, column: column });
if (!from.source) {
return false;
}var result = {
if (!from.source) return false;
var result = {
file: this.mapResolve(from.source),

@@ -92,0 +91,0 @@ line: from.line,

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _MapGenerator = require('./map-generator');
var _mapGenerator = require('./map-generator');
var _MapGenerator2 = _interopRequireDefault(_MapGenerator);
var _mapGenerator2 = _interopRequireDefault(_mapGenerator);

@@ -20,5 +20,5 @@ var _warnOnce = require('./warn-once');

var _Result = require('./result');
var _result = require('./result');
var _Result2 = _interopRequireDefault(_Result);
var _result2 = _interopRequireDefault(_result);

@@ -29,5 +29,5 @@ var _parse = require('./parse');

var _Root = require('./root');
var _root = require('./root');
var _Root2 = _interopRequireDefault(_Root);
var _root2 = _interopRequireDefault(_root);

@@ -48,5 +48,5 @@ var Promise = global.Promise || require('es6-promise').Promise;

var root = undefined;
if (css instanceof _Root2['default']) {
if (css instanceof _root2['default']) {
root = css;
} else if (css instanceof LazyResult || css instanceof _Result2['default']) {
} else if (css instanceof LazyResult || css instanceof _result2['default']) {
root = css.root;

@@ -64,3 +64,3 @@ if (css.map && typeof opts.map === 'undefined') {

this.result = new _Result2['default'](processor, root, opts);
this.result = new _result2['default'](processor, root, opts);
}

@@ -87,5 +87,5 @@

if (plugins.length === 0) {
return resolve();
}var promise = this.run(plugins.shift());
if (plugins.length === 0) return resolve();
var promise = this.run(plugins.shift());
if (isPromise(promise)) {

@@ -131,5 +131,4 @@ promise.then(function () {

LazyResult.prototype.sync = function sync() {
if (this.processed) {
return this.result;
}this.processed = true;
if (this.processed) return this.result;
this.processed = true;

@@ -186,3 +185,3 @@ if (this.processing) {

if (returned instanceof _Root2['default']) {
if (returned instanceof _root2['default']) {
this.result.root = returned;

@@ -195,8 +194,7 @@ } else {

LazyResult.prototype.stringify = function stringify() {
if (this.stringified) {
return this.result;
}this.stringified = true;
if (this.stringified) return this.result;
this.stringified = true;
this.sync();
var map = new _MapGenerator2['default'](this.result.root, this.result.opts);
var map = new _mapGenerator2['default'](this.result.root, this.result.opts);
var data = map.generate();

@@ -203,0 +201,0 @@ this.result.css = data[0];

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _Base64 = require('js-base64');
var _jsBase64 = require('js-base64');
var _mozilla = require('source-map');
var _sourceMap = require('source-map');
var _mozilla2 = _interopRequireDefault(_mozilla);
var _sourceMap2 = _interopRequireDefault(_sourceMap);

@@ -88,5 +88,5 @@ var _path = require('path');

_class.prototype.clearAnnotation = function clearAnnotation() {
if (this.mapOpts.annotation === false) {
return;
}var node = undefined;
if (this.mapOpts.annotation === false) return;
var node = undefined;
for (var i = this.root.nodes.length - 1; i >= 0; i--) {

@@ -137,3 +137,3 @@ node = this.root.nodes[i];

if (this.mapOpts.sourcesContent === false) {
map = new _mozilla2['default'].SourceMapConsumer(prev.text);
map = new _sourceMap2['default'].SourceMapConsumer(prev.text);
if (map.sourcesContent) {

@@ -170,3 +170,3 @@ map.sourcesContent = map.sourcesContent.map(function () {

if (this.isInline()) {
content = 'data:application/json;base64,' + _Base64.Base64.encode(this.map.toString());
content = 'data:application/json;base64,' + _jsBase64.Base64.encode(this.map.toString());
} else if (typeof this.mapOpts.annotation === 'string') {

@@ -227,3 +227,3 @@ content = this.mapOpts.annotation;

this.css = '';
this.map = new _mozilla2['default'].SourceMapGenerator({ file: this.outputFile() });
this.map = new _sourceMap2['default'].SourceMapGenerator({ file: this.outputFile() });

@@ -230,0 +230,0 @@ var line = 1;

@@ -5,9 +5,9 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _CssSyntaxError = require('./css-syntax-error');
var _cssSyntaxError = require('./css-syntax-error');
var _CssSyntaxError2 = _interopRequireDefault(_CssSyntaxError);
var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);

@@ -29,5 +29,3 @@ var defaultStyle = {

var cloneNode = function cloneNode(obj, parent) {
if (typeof obj !== 'object') {
return obj;
}var cloned = new obj.constructor();
var cloned = new obj.constructor();

@@ -37,4 +35,5 @@ for (var i in obj) {

var value = obj[i];
var type = typeof value;
if (i === 'parent' && typeof value === 'object') {
if (i === 'parent' && type === 'object') {
if (parent) cloned[i] = parent;

@@ -48,3 +47,4 @@ } else if (i === 'source') {

} else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
cloned[i] = cloneNode(value, cloned);
if (type === 'object') value = cloneNode(value);
cloned[i] = value;
}

@@ -74,3 +74,3 @@ }

} else {
return new _CssSyntaxError2['default'](message);
return new _cssSyntaxError2['default'](message);
}

@@ -198,5 +198,3 @@ };

value = this[own];
if (typeof value !== 'undefined') {
return value;
}
if (typeof value !== 'undefined') return value;
}

@@ -214,5 +212,5 @@

// Floating child without parent
if (!parent) {
return defaultStyle[detect];
} // Detect style by other nodes
if (!parent) return defaultStyle[detect];
// Detect style by other nodes
var root = this.root();

@@ -219,0 +217,0 @@ if (!root.styleCache) root.styleCache = {};

'use strict';
exports.__esModule = true;
exports['default'] = parse;
var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = parse;
var _parser = require('./parser');
var _Parser = require('./parser');
var _parser2 = _interopRequireDefault(_parser);
var _Parser2 = _interopRequireDefault(_Parser);
var _input = require('./input');
var _Input = require('./input');
var _input2 = _interopRequireDefault(_input);
var _Input2 = _interopRequireDefault(_Input);
function parse(css, opts) {
var input = new _Input2['default'](css, opts);
var input = new _input2['default'](css, opts);
var parser = new _Parser2['default'](input);
var parser = new _parser2['default'](input);
parser.tokenize();

@@ -22,0 +21,0 @@ parser.loop();

@@ -5,29 +5,29 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _Declaration = require('./declaration');
var _declaration = require('./declaration');
var _Declaration2 = _interopRequireDefault(_Declaration);
var _declaration2 = _interopRequireDefault(_declaration);
var _tokenizer = require('./tokenize');
var _tokenize = require('./tokenize');
var _tokenizer2 = _interopRequireDefault(_tokenizer);
var _tokenize2 = _interopRequireDefault(_tokenize);
var _Comment = require('./comment');
var _comment = require('./comment');
var _Comment2 = _interopRequireDefault(_Comment);
var _comment2 = _interopRequireDefault(_comment);
var _AtRule = require('./at-rule');
var _atRule = require('./at-rule');
var _AtRule2 = _interopRequireDefault(_AtRule);
var _atRule2 = _interopRequireDefault(_atRule);
var _Root = require('./root');
var _root = require('./root');
var _Root2 = _interopRequireDefault(_Root);
var _root2 = _interopRequireDefault(_root);
var _Rule = require('./rule');
var _rule = require('./rule');
var _Rule2 = _interopRequireDefault(_Rule);
var _rule2 = _interopRequireDefault(_rule);

@@ -41,3 +41,3 @@ var Parser = (function () {

this.pos = 0;
this.root = new _Root2['default']();
this.root = new _root2['default']();
this.current = this.root;

@@ -52,3 +52,3 @@ this.spaces = '';

Parser.prototype.tokenize = function tokenize() {
this.tokens = _tokenizer2['default'](this.input);
this.tokens = _tokenize2['default'](this.input);
};

@@ -94,3 +94,3 @@

Parser.prototype.comment = function comment(token) {
var node = new _Comment2['default']();
var node = new _comment2['default']();
this.init(node, token[2], token[3]);

@@ -113,3 +113,3 @@ node.source.end = { line: token[4], column: token[5] };

Parser.prototype.emptyRule = function emptyRule(token) {
var node = new _Rule2['default']();
var node = new _rule2['default']();
this.init(node, token[2], token[3]);

@@ -196,3 +196,3 @@ node.between = '';

var node = new _Rule2['default']();
var node = new _rule2['default']();
this.init(node, tokens[0][2], tokens[0][3]);

@@ -206,3 +206,3 @@

Parser.prototype.decl = function decl(tokens) {
var node = new _Declaration2['default']();
var node = new _declaration2['default']();
this.init(node);

@@ -289,3 +289,3 @@

Parser.prototype.atrule = function atrule(token) {
var node = new _AtRule2['default']();
var node = new _atRule2['default']();
node.name = token[1].slice(1);

@@ -424,5 +424,5 @@ if (node.name === '') {

if (colon === false) {
return;
}if (this.input.safe) {
if (colon === false) return;
if (this.input.safe) {
var split = undefined;

@@ -429,0 +429,0 @@ for (split = colon - 1; split >= 0; split--) {

@@ -5,19 +5,19 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Declaration = require('./declaration');
var _declaration = require('./declaration');
var _Declaration2 = _interopRequireDefault(_Declaration);
var _declaration2 = _interopRequireDefault(_declaration);
var _Processor = require('./processor');
var _processor = require('./processor');
var _Processor2 = _interopRequireDefault(_Processor);
var _processor2 = _interopRequireDefault(_processor);
var _Comment = require('./comment');
var _comment = require('./comment');
var _Comment2 = _interopRequireDefault(_Comment);
var _comment2 = _interopRequireDefault(_comment);
var _AtRule = require('./at-rule');
var _atRule = require('./at-rule');
var _AtRule2 = _interopRequireDefault(_AtRule);
var _atRule2 = _interopRequireDefault(_atRule);

@@ -36,9 +36,9 @@ var _vendor = require('./vendor');

var _Rule = require('./rule');
var _rule = require('./rule');
var _Rule2 = _interopRequireDefault(_Rule);
var _rule2 = _interopRequireDefault(_rule);
var _Root = require('./root');
var _root = require('./root');
var _Root2 = _interopRequireDefault(_Root);
var _root2 = _interopRequireDefault(_root);

@@ -53,3 +53,3 @@ var postcss = function postcss() {

}
return new _Processor2['default'](plugins);
return new _processor2['default'](plugins);
};

@@ -61,3 +61,3 @@

transformer.postcssPlugin = name;
transformer.postcssVersion = _Processor2['default'].prototype.version;
transformer.postcssVersion = _processor2['default'].prototype.version;
return transformer;

@@ -77,15 +77,15 @@ };

postcss.comment = function (defaults) {
return new _Comment2['default'](defaults);
return new _comment2['default'](defaults);
};
postcss.atRule = function (defaults) {
return new _AtRule2['default'](defaults);
return new _atRule2['default'](defaults);
};
postcss.decl = function (defaults) {
return new _Declaration2['default'](defaults);
return new _declaration2['default'](defaults);
};
postcss.rule = function (defaults) {
return new _Rule2['default'](defaults);
return new _rule2['default'](defaults);
};
postcss.root = function (defaults) {
return new _Root2['default'](defaults);
return new _root2['default'](defaults);
};

@@ -92,0 +92,0 @@

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _Base64 = require('js-base64');
var _jsBase64 = require('js-base64');
var _mozilla = require('source-map');
var _sourceMap = require('source-map');
var _mozilla2 = _interopRequireDefault(_mozilla);
var _sourceMap2 = _interopRequireDefault(_sourceMap);

@@ -38,3 +38,3 @@ var _path = require('path');

if (!this.consumerCache) {
this.consumerCache = new _mozilla2['default'].SourceMapConsumer(this.text);
this.consumerCache = new _sourceMap2['default'].SourceMapConsumer(this.text);
}

@@ -49,5 +49,4 @@ return this.consumerCache;

PreviousMap.prototype.startWith = function startWith(string, start) {
if (!string) {
return false;
}return string.substr(0, start.length) === start;
if (!string) return false;
return string.substr(0, start.length) === start;
};

@@ -67,3 +66,3 @@

} else if (this.startWith(text, base64)) {
return _Base64.Base64.decode(text.substr(base64.length));
return _jsBase64.Base64.decode(text.substr(base64.length));
} else {

@@ -76,10 +75,10 @@ var encoding = text.match(/data:application\/json;([^,]+),/)[1];

PreviousMap.prototype.loadMap = function loadMap(file, prev) {
if (prev === false) {
return false;
}if (prev) {
if (prev === false) return false;
if (prev) {
if (typeof prev === 'string') {
return prev;
} else if (prev instanceof _mozilla2['default'].SourceMapConsumer) {
return _mozilla2['default'].SourceMapGenerator.fromSourceMap(prev).toString();
} else if (prev instanceof _mozilla2['default'].SourceMapGenerator) {
} else if (prev instanceof _sourceMap2['default'].SourceMapConsumer) {
return _sourceMap2['default'].SourceMapGenerator.fromSourceMap(prev).toString();
} else if (prev instanceof _sourceMap2['default'].SourceMapGenerator) {
return prev.toString();

@@ -86,0 +85,0 @@ } else if (typeof prev === 'object' && prev.mappings) {

@@ -5,9 +5,9 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _LazyResult = require('./lazy-result');
var _lazyResult = require('./lazy-result');
var _LazyResult2 = _interopRequireDefault(_LazyResult);
var _lazyResult2 = _interopRequireDefault(_lazyResult);

@@ -31,3 +31,3 @@ var Processor = (function () {

return new _LazyResult2['default'](this, css, opts);
return new _lazyResult2['default'](this, css, opts);
};

@@ -34,0 +34,0 @@

@@ -5,7 +5,7 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

@@ -16,5 +16,5 @@ var _warnOnce = require('./warn-once');

var _Warning = require('./warning');
var _warning = require('./warning');
var _Warning2 = _interopRequireDefault(_Warning);
var _warning2 = _interopRequireDefault(_warning);

@@ -46,3 +46,3 @@ var Result = (function () {

this.messages.push(new _Warning2['default'](text, opts));
this.messages.push(new _warning2['default'](text, opts));
};

@@ -49,0 +49,0 @@

@@ -5,11 +5,11 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Container2 = require('./container');
var _container = require('./container');
var _Container3 = _interopRequireDefault(_Container2);
var _container2 = _interopRequireDefault(_container);

@@ -86,5 +86,5 @@ var Root = (function (_Container) {

return Root;
})(_Container3['default']);
})(_container2['default']);
exports['default'] = Root;
module.exports = exports['default'];

@@ -5,13 +5,13 @@ 'use strict';

var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _Container2 = require('./container');
var _container = require('./container');
var _Container3 = _interopRequireDefault(_Container2);
var _container2 = _interopRequireDefault(_container);

@@ -48,5 +48,5 @@ var _list = require('./list');

return Rule;
})(_Container3['default']);
})(_container2['default']);
exports['default'] = Rule;
module.exports = exports['default'];

@@ -8,5 +8,4 @@ 'use strict';

function warnOnce(message) {
if (printed[message]) {
return;
}printed[message] = true;
if (printed[message]) return;
printed[message] = true;

@@ -13,0 +12,0 @@ if (typeof console !== 'undefined' && console.warn) console.warn(message);

@@ -5,3 +5,3 @@ 'use strict';

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

@@ -8,0 +8,0 @@ var Warning = (function () {

{
"name": "postcss",
"version": "4.1.8",
"version": "4.1.9",
"description": "Tool for transforming CSS with JS plugins",

@@ -34,2 +34,3 @@ "keywords": [

"gulp-util": "3.0.4",
"gulp-run": "1.6.8",
"fs-extra": "0.18.2",

@@ -42,3 +43,3 @@ "through2": "0.6.5",

"chai": "2.3.0",
"babel-core": "5.2.2"
"babel-core": "5.2.13"
},

@@ -64,5 +65,5 @@ "benchmarkDependencies": {

"scripts": {
"test": "gulp && yaspeller ."
"test": "gulp"
},
"main": "lib/postcss"
}

@@ -88,6 +88,6 @@ # PostCSS [![Build Status][ci-img]][ci] [![Gitter][chat-img]][chat]

Preprocessors are a template languages, when you mix styles with code
(like a PHP with HTML).
In contrast, in PostCSS you write some custom subset of CSS.
All code can be only in JS plugins.
Preprocessors are template languages, where you mix styles with code
(like PHP does with HTML).
In contrast, in PostCSS you write a custom subset of CSS.
All code can only be in JS plugins.

@@ -99,7 +99,7 @@ As a result, PostCSS offers three main benefits:

* **Future CSS:** PostCSS plugins can read and rebuild an entire document,
meaning that they can provide new language features. For example, [cssnext]
meaning that they can provide new language features. For example, [cssnext]
transpiles the latest W3C drafts to current CSS syntax.
* **New abilities:** PostCSS transforms are often more powerful than
preprocessor equivalents. For example, [Autoprefixer] would be impossible
with preprocessors.
* **New abilities:** PostCSS plugins can read and change every part of CSS.
It makes many new classes of tools possible. [Autoprefixer], [`doiuse`]
or [`postcss-colorblind`] are good examples.

@@ -110,3 +110,3 @@ [3 times faster]: https://github.com/postcss/postcss/blob/master/benchmark/general.js

You need to make 2 steps for using PostCSS:
You just need to follow these two steps to use PostCSS:

@@ -116,3 +116,3 @@ 1. Add PostCSS to your build tool.

There are plugins for [Grunt], [Gulp], [webpack] and [Broccoli].
There are plugins for [Grunt], [Gulp], [webpack], [Broccoli] and [Brunch].

@@ -128,3 +128,3 @@ ```js

For other environments your can use [CLI tool] or JS API:
For other environments you can use the [CLI tool] or the JS API:

@@ -141,3 +141,3 @@ ```js

Read the [PostCSS API] for more details about JS API.
Read the [PostCSS API] for more details about the JS API.

@@ -148,2 +148,3 @@ [PostCSS API]: https://github.com/postcss/postcss/blob/master/docs/api.md

[webpack]: https://github.com/postcss/postcss-loader
[Brunch]: https://github.com/iamvdo/postcss-brunch
[Grunt]: https://github.com/nDmitry/grunt-postcss

@@ -154,2 +155,9 @@ [Gulp]: https://github.com/postcss/gulp-postcss

### Control
With [`postcss-plugin-context`] you can run different plugins
on different parts of CSS.
[`postcss-plugin-context`]: https://github.com/postcss/postcss-plugin-context
### Packs

@@ -176,2 +184,3 @@

the W3C Custom Properties.
* [`postcss-css-variables`] supports variables for descendant/nested rules and at-rules
* [`postcss-custom-selectors`] adds custom aliases for selectors.

@@ -183,2 +192,3 @@ * [`postcss-font-variant`] transpiles human-readable `font-variant` to more

* [`postcss-media-minmax`] adds `<=` and `=>` statements to media queries.
* [`postcss-selector-not`] transforms CSS4 `:not()` to CSS3 `:not()`.
* [`mq4-hover-shim`] supports the `@media (hover)` feature.

@@ -305,2 +315,4 @@

[`postcss-simple-extend`]: https://github.com/davidtheclark/postcss-simple-extend
[`postcss-css-variables`]: https://github.com/MadLittleMods/postcss-css-variables
[`postcss-selector-not`]: https://github.com/postcss/postcss-selector-not
[`postcss-default-unit`]: https://github.com/antyakushev/postcss-default-unit

@@ -362,4 +374,5 @@ [`postcss-media-minmax`]: https://github.com/postcss/postcss-media-minmax

* [Plugin Guidelines](https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md)
* [Plugin Boilerplate](https://github.com/postcss/postcss-plugin-boilerplate)
* [PostCSS API](https://github.com/postcss/postcss/blob/master/docs/api.md)
* [Plugin Boilerplate](https://github.com/postcss/postcss-plugin-boilerplate)
* [Ask questions](https://gitter.im/postcss/postcss)

@@ -366,0 +379,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc