lib/clean.js
function(json, fields) {
    if (((typeof json) === 'object') && !Array.isArray(json))
      return hasFields(json,fields);
    else if (Array.isArray(json)) {
      var spliced = [];
      var n = json.length;
      while (n--)
        if (hasFields(json[n],fields))
          spliced.push(json[n]);

      if (spliced.length)
        return spliced;
      else
        return false;
    }
    else
      return console.error(new Error('Bad data passed to clean.forFields()'));
  }
function(json, fields) {
    if (((typeof json) === 'object') && !Array.isArray(json))
      return hasFields(json,fields);
    else if (Array.isArray(json)) {
      var spliced = [];
      var n = json.length;
      while (n--)
        if (hasFields(json[n],fields))
          spliced.push(json[n]);

      if (spliced.length)
        return spliced;
      else
        return false;
    }
    else
      return console.error(new Error('Bad data passed to clean.forFields()'));
  }
function ( json , fields ) { if ( ( ( typeof json ) === 'object' ) && ! Array . isArray ( json ) ) return hasFields ( json , fields ) ; else if ( Array . isArray ( json ) ) { var spliced = [ ] ; var n = json . length ; while ( n -- ) if ( hasFields ( json [ n ] , fields ) ) spliced . push ( json [ n ] ) ; if ( spliced . length ) return spliced ; else return false ; } else return console . error ( new Error ( 'Bad data passed to clean.forFields()' ) ) ; }
removes texts that don't have the specified fields
removes texts that don t have the specified fields