securityos/node_modules/stylelint-order/rules/properties-order/getNodeData.js

26 lines
538 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
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,
};
};