function(ast) {
    let detected = [];

    ast.traverse(function(node, index, parent) {
      // If we see a zero with unit and it is not degree,
      // then we don’t have an option
      if (node.is('percentage') &&
          node.first('number').content[1] === '0') {
        detected.push(false);
        return;
      }

      if (node.is('dimension') &&
          node.first('number').content === '0' &&
          node.first('ident').content !== 'deg') {
        detected.push(false);
        return;
      }

      // If we see a zero and previous node is not percentage
      // or dimension, then we have an option
      if (node.is('number') &&
          node.content === '0' &&
          !parent.is('percentage') &&
          !parent.is('dimension')) {
        detected.push(true);
      }
    });

    return detected;
  }
function(ast) {
    let detected = [];

    ast.traverse(function(node, index, parent) {
      
      
      if (node.is('percentage') &&
          node.first('number').content[1] === '0') {
        detected.push(false);
        return;
      }

      if (node.is('dimension') &&
          node.first('number').content === '0' &&
          node.first('ident').content !== 'deg') {
        detected.push(false);
        return;
      }

      
      
      if (node.is('number') &&
          node.content === '0' &&
          !parent.is('percentage') &&
          !parent.is('dimension')) {
        detected.push(true);
      }
    });

    return detected;
  }
function ( ast ) { let detected = [ ] ; ast . traverse ( function ( node , index , parent ) { // If we see a zero with unit and it is not degree, // then we don’t have an option if ( node . is ( 'percentage' ) && node . first ( 'number' ) . content [ 1 ] === '0' ) { detected . push ( false ) ; return ; } if ( node . is ( 'dimension' ) && node . first ( 'number' ) . content === '0' && node . first ( 'ident' ) . content !== 'deg' ) { detected . push ( false ) ; return ; } // If we see a zero and previous node is not percentage // or dimension, then we have an option if ( node . is ( 'number' ) && node . content === '0' && ! parent . is ( 'percentage' ) && ! parent . is ( 'dimension' ) ) { detected . push ( true ) ; } } ) ; return detected ; }
Detects the value of an option at the tree node.

@param {node} ast
Detects the value of an option at the tree node .