/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/postcss-discard-comments/src/lib/commentRemover.js
32 строки
690 B
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
'use strict'; /** @param {import('../index.js').Options} options */ function CommentRemover(options) { this.options = options; } /** * @param {string} comment * @return {boolean | undefined} */ CommentRemover.prototype.canRemove = function (comment) { const remove = this.options.remove; if (remove) { return remove(comment); } else { const isImportant = comment.indexOf('!') === 0; if (!isImportant) { return true; } if (this.options.removeAll || this._hasFirst) { return true; } else if (this.options.removeAllButFirst && !this._hasFirst) { this._hasFirst = true; return false; } } }; module.exports = CommentRemover;