.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / postcss-selector-parser / dist / selectors / root.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 _container = require('./container');
8
9 var _container2 = _interopRequireDefault(_container);
10
11 var _types = require('./types');
12
13 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
17 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
19 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) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
21 var Root = function (_Container) {
22     _inherits(Root, _Container);
23
24     function Root(opts) {
25         _classCallCheck(this, Root);
26
27         var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
28
29         _this.type = _types.ROOT;
30         return _this;
31     }
32
33     Root.prototype.toString = function toString() {
34         var str = this.reduce(function (memo, selector) {
35             var sel = String(selector);
36             return sel ? memo + sel + ',' : '';
37         }, '').slice(0, -1);
38         return this.trailingComma ? str + ',' : str;
39     };
40
41     Root.prototype.error = function error(message, options) {
42         if (this._error) {
43             return this._error(message, options);
44         } else {
45             return new Error(message);
46         }
47     };
48
49     _createClass(Root, [{
50         key: 'errorGenerator',
51         set: function set(handler) {
52             this._error = handler;
53         }
54     }]);
55
56     return Root;
57 }(_container2.default);
58
59 exports.default = Root;
60 module.exports = exports['default'];