Sha256: 7f82bc256d5a04e5be5195474babae8adf71ad3b3621010c875e5b76ba7db46c
Contents?: true
Size: 968 Bytes
Versions: 28
Compression:
Stored size: 968 Bytes
Contents
function removeItemAndRedundantWhiteSpace(list, item) { var prev = item.prev; var next = item.next; if (next !== null) { if (next.data.type === 'WhiteSpace' && (prev === null || prev.data.type === 'WhiteSpace')) { list.remove(next); } } else if (prev !== null && prev.data.type === 'WhiteSpace') { list.remove(prev); } list.remove(item); } module.exports = function compressBorder(node) { node.children.each(function(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 { removeItemAndRedundantWhiteSpace(list, item); } } }); };
Version data entries
28 entries across 27 versions & 9 rubygems