GoScrobble/web/node_modules/postcss-unique-selectors/dist/index.js

26 lines
703 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _postcss = require('postcss');
var _alphanumSort = require('alphanum-sort');
var _alphanumSort2 = _interopRequireDefault(_alphanumSort);
var _uniqs = require('uniqs');
var _uniqs2 = _interopRequireDefault(_uniqs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function unique(rule) {
rule.selector = (0, _alphanumSort2.default)((0, _uniqs2.default)(rule.selectors), { insensitive: true }).join();
}
exports.default = (0, _postcss.plugin)('postcss-unique-selectors', () => {
return css => css.walkRules(unique);
});
module.exports = exports['default'];