<commit_before>export default function createSocketMiddleware (socket, prefix) {
  return store => {
    // handler for incoming actions (sent from server)
    socket.on('action', action => {
      const { type } = action

      // can ignore player commands if we're not an active player
      if (type.startsWith('player/') && !store.getState().player) {
        return
      }

      store.dispatch(action)
    })

    return next => action => {
      const { type } = action

      // only apply to socket.io requests
      if (!type.startsWith(prefix)) {
        return next(action)
      }

      // fire request action
      next(action)
<commit_msg>Let actions without a type property error out (again)<commit_after>export default function createSocketMiddleware (socket, prefix) {
  return store => {
    // handler for incoming actions (sent from server)
    socket.on('action', action => {
      const { type } = action

      // can ignore player commands if we're not an active player
      if (type.startsWith('player/') && !store.getState().player) {
        return
      }

      store.dispatch(action)
    })

    return next => action => {
      const { type } = action

      // only apply to socket.io requests
      if (!type || !type.startsWith(prefix)) {
        return next(action)
      }

      // fire request action
      next(action)

{'fraction_non_alphanumeric': 0.11371973587674249, 'fraction_numerical': 0.0, 'mean_word_length': 2.334963325183374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '791688', 'n_tokens_mistral': 368, 'n_tokens_neox': 360, 'n_words': 117}