Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
720 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = void 0;
|
---|
7 |
|
---|
8 | function CommentRemover(options) {
|
---|
9 | this.options = options;
|
---|
10 | }
|
---|
11 |
|
---|
12 | CommentRemover.prototype.canRemove = function (comment) {
|
---|
13 | const remove = this.options.remove;
|
---|
14 |
|
---|
15 | if (remove) {
|
---|
16 | return remove(comment);
|
---|
17 | } else {
|
---|
18 | const isImportant = comment.indexOf('!') === 0;
|
---|
19 |
|
---|
20 | if (!isImportant) {
|
---|
21 | return true;
|
---|
22 | }
|
---|
23 |
|
---|
24 | if (this.options.removeAll || this._hasFirst) {
|
---|
25 | return true;
|
---|
26 | } else if (this.options.removeAllButFirst && !this._hasFirst) {
|
---|
27 | this._hasFirst = true;
|
---|
28 | return false;
|
---|
29 | }
|
---|
30 | }
|
---|
31 | };
|
---|
32 |
|
---|
33 | var _default = CommentRemover;
|
---|
34 | exports.default = _default;
|
---|
35 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.