blob: 7ccfff199a209ed926d7b4a3a026a966bce8ca89 [file] [log] [blame]
Tim van der Lippe38208902021-05-11 16:37:59 +01001'use strict';
2
3const _ = require('lodash');
4
5/** @typedef {import('postcss').AtRule} AtRule */
6
7/**
8 * @param {AtRule} atRule
9 * @param {string} params
10 * @returns {AtRule} The atRulearation that was passed in.
11 */
12module.exports = function setAtRuleParams(atRule, params) {
13 if (_.has(atRule, 'raws.params')) {
14 _.set(atRule, 'raws.params.raw', params);
15 } else {
16 atRule.params = params;
17 }
18
19 return atRule;
20};