summaryrefslogtreecommitdiff
path: root/node_modules/postcss-merge-longhand/src/lib/getDecls.js
blob: 5f8cc8c56f546f08630ceefa5495aaf4d03ffff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';
/**
 * @param {import('postcss').Rule} rule
 * @param {string[]} properties
 * @return {import('postcss').Declaration[]}
 */
module.exports = function getDecls(rule, properties) {
  return /** @type {import('postcss').Declaration[]} */ (
    rule.nodes.filter(
      (node) =>
        node.type === 'decl' && properties.includes(node.prop.toLowerCase())
    )
  );
};