Security update for Core, with self-updated composer
[yaffs-website] / node_modules / uncss / node_modules / postcss / lib / result.js
1 'use strict';
2
3 exports.__esModule = true;
4
5 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; }; }();
6
7 var _warning = require('./warning');
8
9 var _warning2 = _interopRequireDefault(_warning);
10
11 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
15 var Result = function () {
16     function Result(processor, root, opts) {
17         _classCallCheck(this, Result);
18
19         this.processor = processor;
20         this.messages = [];
21         this.root = root;
22         this.opts = opts;
23         this.css = undefined;
24         this.map = undefined;
25     }
26
27     Result.prototype.toString = function toString() {
28         return this.css;
29     };
30
31     Result.prototype.warn = function warn(text) {
32         var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
33
34         if (!opts.plugin) {
35             if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
36                 opts.plugin = this.lastPlugin.postcssPlugin;
37             }
38         }
39
40         this.messages.push(new _warning2.default(text, opts));
41     };
42
43     Result.prototype.warnings = function warnings() {
44         return this.messages.filter(function (i) {
45             return i.type === 'warning';
46         });
47     };
48
49     _createClass(Result, [{
50         key: 'content',
51         get: function get() {
52             return this.css;
53         }
54     }]);
55
56     return Result;
57 }();
58
59 exports.default = Result;
60 module.exports = exports['default'];