epiphany/node_modules/stylelint-order/rules/properties-order/getNodeData.js
2023-12-09 22:48:07 -08:00

25 lines
538 B
JavaScript

const { isProperty, vendor } = require('../../utils');
module.exports = function getNodeData(node, expectedOrder) {
if (isProperty(node)) {
let { prop } = node;
let unprefixedName = vendor.unprefixed(prop);
// Hack to allow -moz-osx-font-smoothing to be understood
// just like -webkit-font-smoothing
if (unprefixedName.startsWith('osx-')) {
unprefixedName = unprefixedName.slice(4);
}
return {
node,
name: prop,
unprefixedName,
orderData: expectedOrder[unprefixedName],
};
}
return {
node,
};
};