<commit_before>class Config
  constructor: ->
    @sockets = {}
    @engines = {}
    @middle = {}
    @production = false
    
  load: (path) -> @set require path
  get: (key) -> @[key] || undefined
  set: (key, val) -> 
    return unless key?
    val ?= true
    if typeof key is 'object'
      @[key] = val for key, val of obj
    else if typeof key is 'string'
      @[key] = val
    else
      # TODO: Throw error?
    return
  
module.exports = Config
<commit_msg>fix for middleware order<commit_after>class Config
  constructor: ->
    @sockets = {}
    @engines = {}
    @defaultMiddle = {}
    @middle = [] # array to preserve order
    @production = false
    
  load: (path) -> @set require path
  get: (key) -> @[key] || undefined
  set: (key, val) -> 
    return unless key?
    val ?= true
    if typeof key is 'object'
      @[key] = val for key, val of obj
    else if typeof key is 'string'
      @[key] = val
    else
      # TODO: Throw error?
    return
  
module.exports = Config
{'fraction_non_alphanumeric': 0.131, 'fraction_numerical': 0.0, 'mean_word_length': 2.198083067092652, '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': '2593899', 'n_tokens_mistral': 329, 'n_tokens_neox': 325, 'n_words': 112}