You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
534 B
17 lines
534 B
2 years ago
|
export default function compressBorder(node) {
|
||
|
node.children.forEach((node, item, list) => {
|
||
|
if (node.type === 'Identifier' && node.name.toLowerCase() === 'none') {
|
||
|
if (list.head === list.tail) {
|
||
|
// replace `none` for zero when `none` is a single term
|
||
|
item.data = {
|
||
|
type: 'Number',
|
||
|
loc: node.loc,
|
||
|
value: '0'
|
||
|
};
|
||
|
} else {
|
||
|
list.remove(item);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
};
|