postcss 5.2.16 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/CHANGELOG.md +22 -0
- package/README.md +29 -22
- package/docs/source-maps.md +2 -0
- package/lib/at-rule.js +87 -115
- package/lib/comment.js +32 -60
- package/lib/container.js +35 -95
- package/lib/css-syntax-error.js +13 -28
- package/lib/declaration.js +69 -98
- package/lib/lazy-result.js +2 -6
- package/lib/map-generator.js +11 -4
- package/lib/node.js +128 -177
- package/lib/parse.js +4 -4
- package/lib/parser.js +48 -40
- package/lib/postcss.d.ts +0 -29
- package/lib/postcss.js +5 -5
- package/lib/previous-map.js +7 -12
- package/lib/processor.js +2 -2
- package/lib/root.js +1 -15
- package/lib/rule.js +72 -86
- package/lib/stringifier.js +4 -1
- package/lib/terminal-highlight.js +20 -11
- package/lib/tokenize.js +50 -26
- package/package.json +46 -16
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
+
## 6.0.1
|
5
|
+
* Fix parser extensibility to use it in Safe Parser.
|
6
|
+
|
7
|
+
## 6.0 “Marquis Orias”
|
8
|
+
* Remove node.js 0.12 support.
|
9
|
+
* Remove deprecated method from PostCSS 4.
|
10
|
+
* Insert methods remove child from previous parent, instead of closing.
|
11
|
+
* Insert methods and cloning doesn’t clean `raws` anymore.
|
12
|
+
* Methods `moveTo`, `moveAfter`, `moveBefore` were deprecated.
|
13
|
+
* Options was changed in `Plugin#process(css, processOptions, pluginOptions)`.
|
14
|
+
* Add stream parser to reduce memory usage (by Oleh Kuchuk).
|
15
|
+
* Add `before()`/`after()` shortcuts for `node.parent.insertBefore(node, x)`.
|
16
|
+
* Add `Rule#raws.ownSemicolon` for semicolon after templates for `@apply`.
|
17
|
+
* Use `babel-preset-env` to compile npm package.
|
18
|
+
* Remove `js-base64` from dependencies (by Roman Dvornov).
|
19
|
+
* Fix error message on single `:` in CSS.
|
20
|
+
* Move tests to Jest.
|
21
|
+
* Clean up test (by Gabriel Kalani).
|
22
|
+
|
23
|
+
## 5.2.17
|
24
|
+
* Add `postcss-sass` suggestion to syntax error on `.sass` input.
|
25
|
+
|
4
26
|
## 5.2.16
|
5
27
|
* Better error on wrong argument in node constructor.
|
6
28
|
|
package/README.md
CHANGED
@@ -136,6 +136,8 @@ you can write a parser and/or stringifier to extend PostCSS.
|
|
136
136
|
* [`sugarss`] is a indent-based syntax like Sass or Stylus.
|
137
137
|
* [`postcss-scss`] allows you to work with SCSS
|
138
138
|
*(but does not compile SCSS to CSS)*.
|
139
|
+
* [`postcss-sass`] allows you to work with Sass
|
140
|
+
*(but does not compile Sass to CSS)*.
|
139
141
|
* [`postcss-less`] allows you to work with Less
|
140
142
|
*(but does not compile LESS to CSS)*.
|
141
143
|
* [`postcss-less-engine`] allows you to work with Less
|
@@ -145,12 +147,13 @@ you can write a parser and/or stringifier to extend PostCSS.
|
|
145
147
|
* [`postcss-safe-parser`] finds and fixes CSS syntax errors.
|
146
148
|
* [`midas`] converts a CSS string to highlighted HTML.
|
147
149
|
|
148
|
-
[`
|
150
|
+
[`sugarss`]: https://github.com/postcss/sugarss
|
151
|
+
[`postcss-scss`]: https://github.com/postcss/postcss-scss
|
152
|
+
[`postcss-sass`]: https://github.com/AleshaOleg/postcss-sass
|
149
153
|
[`postcss-less`]: https://github.com/webschik/postcss-less
|
150
154
|
[`postcss-less-engine`]: https://github.com/Crunch/postcss-less
|
151
|
-
[`postcss-scss`]: https://github.com/postcss/postcss-scss
|
152
155
|
[`postcss-js`]: https://github.com/postcss/postcss-js
|
153
|
-
[`
|
156
|
+
[`postcss-safe-parser`]: https://github.com/postcss/postcss-safe-parser
|
154
157
|
[`midas`]: https://github.com/ben-eb/midas
|
155
158
|
|
156
159
|
## Articles
|
@@ -158,10 +161,13 @@ you can write a parser and/or stringifier to extend PostCSS.
|
|
158
161
|
* [Some things you may think about PostCSS… and you might be wrong](http://julian.io/some-things-you-may-think-about-postcss-and-you-might-be-wrong)
|
159
162
|
* [What PostCSS Really Is; What It Really Does](http://davidtheclark.com/its-time-for-everyone-to-learn-about-postcss)
|
160
163
|
* [PostCSS Guides](http://webdesign.tutsplus.com/series/postcss-deep-dive--cms-889)
|
161
|
-
* [Mastering PostCSS for Web Design](https://www.packtpub.com/web-development/mastering-postcss-web-design)
|
162
164
|
|
163
165
|
More articles and videos you can find on [awesome-postcss](https://github.com/jjaderg/awesome-postcss) list.
|
164
166
|
|
167
|
+
## Books
|
168
|
+
|
169
|
+
* [Mastering PostCSS for Web Design](https://www.packtpub.com/web-development/mastering-postcss-web-design) by Alex Libby, Packt. (June 2016)
|
170
|
+
|
165
171
|
## Usage
|
166
172
|
|
167
173
|
You can start using PostCSS in just two steps:
|
@@ -178,13 +184,23 @@ Use [`postcss-loader`] in `webpack.config.js`:
|
|
178
184
|
```js
|
179
185
|
module.exports = {
|
180
186
|
module: {
|
181
|
-
|
187
|
+
rules: [
|
182
188
|
{
|
183
189
|
test: /\.css$/,
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
190
|
+
exclude: /node_modules/,
|
191
|
+
use: [
|
192
|
+
{
|
193
|
+
loader: 'style-loader',
|
194
|
+
},
|
195
|
+
{
|
196
|
+
loader: 'css-loader',
|
197
|
+
options: {
|
198
|
+
importLoaders: 1,
|
199
|
+
}
|
200
|
+
},
|
201
|
+
{
|
202
|
+
loader: 'postcss-loader'
|
203
|
+
}
|
188
204
|
]
|
189
205
|
}
|
190
206
|
]
|
@@ -243,7 +259,7 @@ tools like CodePen), just use [Browserify] or [webpack]. They will pack
|
|
243
259
|
PostCSS and plugins files into a single file.
|
244
260
|
|
245
261
|
To apply PostCSS plugins to React Inline Styles, JSS, Radium
|
246
|
-
and other CSS-in-JS, you can use [`postcss-js`] and transforms style objects.
|
262
|
+
and other [CSS-in-JS], you can use [`postcss-js`] and transforms style objects.
|
247
263
|
|
248
264
|
```js
|
249
265
|
var postcss = require('postcss-js');
|
@@ -255,6 +271,7 @@ prefixer({ display: 'flex' }); //=> { display: ['-webkit-box', '-webkit-flex', '
|
|
255
271
|
[`postcss-js`]: https://github.com/postcss/postcss-js
|
256
272
|
[Browserify]: http://browserify.org/
|
257
273
|
[webpack]: https://webpack.github.io/
|
274
|
+
[CSS-in-JS]: https://github.com/MicheleBertoli/css-in-js
|
258
275
|
|
259
276
|
### Runners
|
260
277
|
|
@@ -275,6 +292,7 @@ prefixer({ display: 'flex' }); //=> { display: ['-webkit-box', '-webkit-flex', '
|
|
275
292
|
For other environments, you can use the JS API:
|
276
293
|
|
277
294
|
```js
|
295
|
+
const fs = require('fs');
|
278
296
|
const postcss = require('postcss');
|
279
297
|
const precss = require('precss');
|
280
298
|
const autoprefixer = require('autoprefixer');
|
@@ -316,18 +334,7 @@ Common options:
|
|
316
334
|
[Midas]: https://github.com/ben-eb/midas
|
317
335
|
[SCSS]: https://github.com/postcss/postcss-scss
|
318
336
|
|
319
|
-
|
320
|
-
|
321
|
-
If you want to run PostCSS in Node.js 0.10, add the [Promise polyfill]:
|
322
|
-
|
323
|
-
```js
|
324
|
-
require('es6-promise').polyfill();
|
325
|
-
var postcss = require('postcss');
|
326
|
-
```
|
327
|
-
|
328
|
-
[Promise polyfill]: https://github.com/jakearchibald/es6-promise
|
329
|
-
|
330
|
-
## IDE Integration
|
337
|
+
## Editors & IDE Integration
|
331
338
|
|
332
339
|
### Atom
|
333
340
|
|
package/docs/source-maps.md
CHANGED
@@ -68,5 +68,7 @@ option as an object with the following parameters:
|
|
68
68
|
* `from` string: by default, PostCSS will set the `sources` property of the map
|
69
69
|
to the value of the `from` option. If you want to override this behaviour, you
|
70
70
|
can use `map.from` to explicitly set the source map's `sources` property.
|
71
|
+
Path should be absolute or relative from generated file
|
72
|
+
(`to` option in `process()` method).
|
71
73
|
|
72
74
|
[source maps]: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
|
package/lib/at-rule.js
CHANGED
@@ -2,16 +2,10 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
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
5
|
var _container = require('./container');
|
8
6
|
|
9
7
|
var _container2 = _interopRequireDefault(_container);
|
10
8
|
|
11
|
-
var _warnOnce = require('./warn-once');
|
12
|
-
|
13
|
-
var _warnOnce2 = _interopRequireDefault(_warnOnce);
|
14
|
-
|
15
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
10
|
|
17
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -39,121 +33,99 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
39
33
|
* media.nodes //=> []
|
40
34
|
*/
|
41
35
|
var AtRule = function (_Container) {
|
42
|
-
|
36
|
+
_inherits(AtRule, _Container);
|
37
|
+
|
38
|
+
function AtRule(defaults) {
|
39
|
+
_classCallCheck(this, AtRule);
|
40
|
+
|
41
|
+
var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
|
42
|
+
|
43
|
+
_this.type = 'atrule';
|
44
|
+
return _this;
|
45
|
+
}
|
46
|
+
|
47
|
+
AtRule.prototype.append = function append() {
|
48
|
+
var _Container$prototype$;
|
49
|
+
|
50
|
+
if (!this.nodes) this.nodes = [];
|
51
|
+
|
52
|
+
for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
|
53
|
+
children[_key] = arguments[_key];
|
54
|
+
}
|
55
|
+
|
56
|
+
return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
|
57
|
+
};
|
43
58
|
|
44
|
-
|
45
|
-
|
59
|
+
AtRule.prototype.prepend = function prepend() {
|
60
|
+
var _Container$prototype$2;
|
46
61
|
|
47
|
-
|
62
|
+
if (!this.nodes) this.nodes = [];
|
48
63
|
|
49
|
-
|
50
|
-
|
64
|
+
for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
65
|
+
children[_key2] = arguments[_key2];
|
51
66
|
}
|
52
67
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
* any {} block
|
113
|
-
*
|
114
|
-
* @example
|
115
|
-
* const root = postcss.parse('@media print, screen {}');
|
116
|
-
* const media = root.first;
|
117
|
-
* media.params //=> 'print, screen'
|
118
|
-
*/
|
119
|
-
|
120
|
-
/**
|
121
|
-
* @memberof AtRule#
|
122
|
-
* @member {object} raws - Information to generate byte-to-byte equal
|
123
|
-
* node string as it was in the origin input.
|
124
|
-
*
|
125
|
-
* Every parser saves its own properties,
|
126
|
-
* but the default CSS parser uses:
|
127
|
-
*
|
128
|
-
* * `before`: the space symbols before the node. It also stores `*`
|
129
|
-
* and `_` symbols before the declaration (IE hack).
|
130
|
-
* * `after`: the space symbols after the last child of the node
|
131
|
-
* to the end of the node.
|
132
|
-
* * `between`: the symbols between the property and value
|
133
|
-
* for declarations, selector and `{` for rules, or last parameter
|
134
|
-
* and `{` for at-rules.
|
135
|
-
* * `semicolon`: contains true if the last child has
|
136
|
-
* an (optional) semicolon.
|
137
|
-
* * `afterName`: the space between the at-rule name and its parameters.
|
138
|
-
*
|
139
|
-
* PostCSS cleans at-rule parameters from comments and extra spaces,
|
140
|
-
* but it stores origin content in raws properties.
|
141
|
-
* As such, if you don’t change a declaration’s value,
|
142
|
-
* PostCSS will use the raw value with comments.
|
143
|
-
*
|
144
|
-
* @example
|
145
|
-
* const root = postcss.parse(' @media\nprint {\n}')
|
146
|
-
* root.first.first.raws //=> { before: ' ',
|
147
|
-
* // between: ' ',
|
148
|
-
* // afterName: '\n',
|
149
|
-
* // after: '\n' }
|
150
|
-
*/
|
151
|
-
|
152
|
-
}]);
|
153
|
-
|
154
|
-
return AtRule;
|
68
|
+
return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
|
69
|
+
};
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @memberof AtRule#
|
73
|
+
* @member {string} name - the at-rule’s name immediately follows the `@`
|
74
|
+
*
|
75
|
+
* @example
|
76
|
+
* const root = postcss.parse('@media print {}');
|
77
|
+
* media.name //=> 'media'
|
78
|
+
* const media = root.first;
|
79
|
+
*/
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @memberof AtRule#
|
83
|
+
* @member {string} params - the at-rule’s parameters, the values
|
84
|
+
* that follow the at-rule’s name but precede
|
85
|
+
* any {} block
|
86
|
+
*
|
87
|
+
* @example
|
88
|
+
* const root = postcss.parse('@media print, screen {}');
|
89
|
+
* const media = root.first;
|
90
|
+
* media.params //=> 'print, screen'
|
91
|
+
*/
|
92
|
+
|
93
|
+
/**
|
94
|
+
* @memberof AtRule#
|
95
|
+
* @member {object} raws - Information to generate byte-to-byte equal
|
96
|
+
* node string as it was in the origin input.
|
97
|
+
*
|
98
|
+
* Every parser saves its own properties,
|
99
|
+
* but the default CSS parser uses:
|
100
|
+
*
|
101
|
+
* * `before`: the space symbols before the node. It also stores `*`
|
102
|
+
* and `_` symbols before the declaration (IE hack).
|
103
|
+
* * `after`: the space symbols after the last child of the node
|
104
|
+
* to the end of the node.
|
105
|
+
* * `between`: the symbols between the property and value
|
106
|
+
* for declarations, selector and `{` for rules, or last parameter
|
107
|
+
* and `{` for at-rules.
|
108
|
+
* * `semicolon`: contains true if the last child has
|
109
|
+
* an (optional) semicolon.
|
110
|
+
* * `afterName`: the space between the at-rule name and its parameters.
|
111
|
+
*
|
112
|
+
* PostCSS cleans at-rule parameters from comments and extra spaces,
|
113
|
+
* but it stores origin content in raws properties.
|
114
|
+
* As such, if you don’t change a declaration’s value,
|
115
|
+
* PostCSS will use the raw value with comments.
|
116
|
+
*
|
117
|
+
* @example
|
118
|
+
* const root = postcss.parse(' @media\nprint {\n}')
|
119
|
+
* root.first.first.raws //=> { before: ' ',
|
120
|
+
* // between: ' ',
|
121
|
+
* // afterName: '\n',
|
122
|
+
* // after: '\n' }
|
123
|
+
*/
|
124
|
+
|
125
|
+
|
126
|
+
return AtRule;
|
155
127
|
}(_container2.default);
|
156
128
|
|
157
129
|
exports.default = AtRule;
|
158
130
|
module.exports = exports['default'];
|
159
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
131
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIl0sIm1hcHBpbmdzIjoiOzs7O0FB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cgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJyAgQG1lZGlhXFxucHJpbnQge1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnICAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYmV0d2VlbjogJyAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYWZ0ZXJOYW1lOiAnXFxuJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGFmdGVyOiAnXFxuJyB9XG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZTtcbiJdfQ==
|
package/lib/comment.js
CHANGED
@@ -2,12 +2,6 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
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 _warnOnce = require('./warn-once');
|
8
|
-
|
9
|
-
var _warnOnce2 = _interopRequireDefault(_warnOnce);
|
10
|
-
|
11
5
|
var _node = require('./node');
|
12
6
|
|
13
7
|
var _node2 = _interopRequireDefault(_node);
|
@@ -29,61 +23,39 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
29
23
|
* @extends Node
|
30
24
|
*/
|
31
25
|
var Comment = function (_Node) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
/**
|
65
|
-
* @memberof Comment#
|
66
|
-
* @member {string} text - the comment’s text
|
67
|
-
*/
|
68
|
-
|
69
|
-
/**
|
70
|
-
* @memberof Comment#
|
71
|
-
* @member {object} raws - Information to generate byte-to-byte equal
|
72
|
-
* node string as it was in the origin input.
|
73
|
-
*
|
74
|
-
* Every parser saves its own properties,
|
75
|
-
* but the default CSS parser uses:
|
76
|
-
*
|
77
|
-
* * `before`: the space symbols before the node.
|
78
|
-
* * `left`: the space symbols between `/*` and the comment’s text.
|
79
|
-
* * `right`: the space symbols between the comment’s text.
|
80
|
-
*/
|
81
|
-
|
82
|
-
}]);
|
83
|
-
|
84
|
-
return Comment;
|
26
|
+
_inherits(Comment, _Node);
|
27
|
+
|
28
|
+
function Comment(defaults) {
|
29
|
+
_classCallCheck(this, Comment);
|
30
|
+
|
31
|
+
var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
|
32
|
+
|
33
|
+
_this.type = 'comment';
|
34
|
+
return _this;
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @memberof Comment#
|
39
|
+
* @member {string} text - the comment’s text
|
40
|
+
*/
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @memberof Comment#
|
44
|
+
* @member {object} raws - Information to generate byte-to-byte equal
|
45
|
+
* node string as it was in the origin input.
|
46
|
+
*
|
47
|
+
* Every parser saves its own properties,
|
48
|
+
* but the default CSS parser uses:
|
49
|
+
*
|
50
|
+
* * `before`: the space symbols before the node.
|
51
|
+
* * `left`: the space symbols between `/*` and the comment’s text.
|
52
|
+
* * `right`: the space symbols between the comment’s text.
|
53
|
+
*/
|
54
|
+
|
55
|
+
|
56
|
+
return Comment;
|
85
57
|
}(_node2.default);
|
86
58
|
|
87
59
|
exports.default = Comment;
|
88
60
|
module.exports = exports['default'];
|
89
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
61
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7O0lBUU1BLE87OztBQUVGLG1CQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLGlCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksU0FBWjtBQUZrQjtBQUdyQjs7QUFFRDs7Ozs7QUFLQTs7Ozs7Ozs7Ozs7Ozs7Ozs7a0JBY1dGLE8iLCJmaWxlIjoiY29tbWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBOb2RlIGZyb20gJy4vbm9kZSc7XG5cbi8qKlxuICogUmVwcmVzZW50cyBhIGNvbW1lbnQgYmV0d2VlbiBkZWNsYXJhdGlvbnMgb3Igc3RhdGVtZW50cyAocnVsZSBhbmQgYXQtcnVsZXMpLlxuICpcbiAqIENvbW1lbnRzIGluc2lkZSBzZWxlY3RvcnMsIGF0LXJ1bGUgcGFyYW1ldGVycywgb3IgZGVjbGFyYXRpb24gdmFsdWVzXG4gKiB3aWxsIGJlIHN0b3JlZCBpbiB0aGUgYHJhd3NgIHByb3BlcnRpZXMgZXhwbGFpbmVkIGFib3ZlLlxuICpcbiAqIEBleHRlbmRzIE5vZGVcbiAqL1xuY2xhc3MgQ29tbWVudCBleHRlbmRzIE5vZGUge1xuXG4gICAgY29uc3RydWN0b3IoZGVmYXVsdHMpIHtcbiAgICAgICA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