<commit_before>import { combineReducers } from 'redux';
import { omit, find } from 'lodash';
import * as types from '../types';

export const extensions = (state = [], action) => {
  if (action.type === types.BUILD_UPDATED && action.packages)
    return omit(action.packages, ['theme']);
  return state;
};

export const theme = (state = '', action) => {
  if (action.type === types.BUILD_UPDATED && action.packages)
    return find(action.packages, (name, namespace) => namespace === 'theme');
  return state;
};

const siteId = (state = null, action) => {
  if (action.type === types.BUILD_UPDATED && action.siteId) return action.siteId;
  return state;
};

const environment = (state = 'pre', action) => {
  if (action.type === types.BUILD_UPDATED && action.environment) return action.environment;
  return state;
};

const amp = (state = false, action) => {
  if (action.type === types.BUILD_UPDATED && action.amp) return action.amp;
  return state;
};

const ssr = (state = true, action) => {
  if (action.type === types.CLIENT_RENDERED) return false;
  return state;
};

export default combineReducers({
  extensions,
  theme,
  ssr,
  siteId,
  environment,
  amp,
});<commit_msg>Switch to packages instead of extensions and theme<commit_after>import { combineReducers } from 'redux';
import * as types from '../types';

const packages = (state = {}, action) => {
  if (action.type === types.BUILD_UPDATED && action.packages)
    return action.packages;
  return state;
}

const siteId = (state = null, action) => {
  if (action.type === types.BUILD_UPDATED && action.siteId) return action.siteId;
  return state;
};

const environment = (state = 'pre', action) => {
  if (action.type === types.BUILD_UPDATED && action.environment) return action.environment;
  return state;
};

const amp = (state = false, action) => {
  if (action.type === types.BUILD_UPDATED && action.amp) return action.amp;
  return state;
};

const ssr = (state = true, action) => {
  if (action.type === types.CLIENT_RENDERED) return false;
  return state;
};

export default combineReducers({
  ssr,
  siteId,
  environment,
  amp,
  packages,
});
{'fraction_non_alphanumeric': 0.15547205260685767, 'fraction_numerical': 0.0, 'mean_word_length': 4.095693779904306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1880846', 'n_tokens_mistral': 684, 'n_tokens_neox': 678, 'n_words': 192}