<commit_before>module.exports = function( doxrayObject ) {

  doxrayObject.patterns.forEach(function( pattern ){
    // Check to see if we have everything that we need.
    if ( typeof pattern.colorPalette === 'undefined' ) return;
    if ( typeof pattern[ pattern.colorPalette ] === 'undefined' ) return;

    // Grab the code from file type specified in the colorPalette property.
    var palette = [];
    var code = pattern[ pattern.colorPalette ];
    code = code
      .replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm, '')
      .replace(/ +?/gm, '')
      .replace(/(\r\n|\n|\r)/gm, '')
      .split(';');
    for ( var i = 0; i < code.length; i++ ) {
      var ruleAsArray = code[ i ].split(':');
      if ( ruleAsArray.length === 2 ) {
        var key = ruleAsArray[ 0 ];
        var val = ruleAsArray[ 1 ];
        // Ignore Less or SASS variables.
        if ( val.charAt( 0 ) === '@' || val.charAt( 0 ) === '$' ) return;
        palette.push({
          variable: key,
          value: val
        });
      }
    }
    pattern.colorPalette = palette;
  });

  // Always return doxrayObject.
  return doxrayObject;

};<commit_msg>Code formatting.<commit_after>module.exports = function( doxrayObject ) {

  doxrayObject.patterns.forEach(function( pattern ){
    // Check to see if we have everything that we need.
    if ( typeof pattern.colorPalette === 'undefined' ) return;
    if ( typeof pattern[ pattern.colorPalette ] === 'undefined' ) return;
    // Grab the code from file type specified in the colorPalette property.
    var palette = [];
    var code = pattern[ pattern.colorPalette ];
    // Cleans up the code and splits it on semicolons placing each
    // property/value pair in an array
    code = code
      .replace( /(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm, '' )
      .replace( / +?/gm, '' )
      .replace( /(\r\n|\n|\r)/gm, '' )
      .split(';');
    for ( var i = 0; i < code.length; i++ ) {
      var keyValPairAsArray = code[ i ].split(':');
      if ( keyValPairAsArray.length === 2 ) {
        var key = keyValPairAsArray[ 0 ];
        var val = keyValPairAsArray[ 1 ];
        // Ignore Less or SASS variables.
        if ( val.charAt( 0 ) === '@' || val.charAt( 0 ) === '$' ) return;
        palette.push({
          variable: key,
          value: val
        });
      }
    }
    pattern.colorPalette = palette;
  });

  // Always return doxrayObject.
  return doxrayObject;

};
{'fraction_non_alphanumeric': 0.17218543046357615, 'fraction_numerical': 0.004966887417218543, 'mean_word_length': 2.1760840998685937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4710201', 'n_tokens_mistral': 794, 'n_tokens_neox': 762, 'n_words': 211}