```coffeescript
minimatch = require 'minimatch'

module.exports =
  class Filters
    @firstElementFilter: (value, i) ->
      i == 0

    @fieldMatchFilter: (filter, value) ->
      for k, v of filter
        return false unless value[k]? and minimatch value[k], v
      true
```

Enable using regex as filter.
user
```coffeescript
minimatch = require 'minimatch'

# Returns whether the string {str} matches the filter {filter}.
matches = (str, filter) ->
  if filter instanceof RegExp
    filter.test str
  else
    minimatch str, filter

module.exports =
  class Filters
    @firstElementFilter: (value, i) ->
      i == 0

    @fieldMatchFilter: (filter, value) ->
      for k, v of filter
        return false unless value[k]? and matches value[k], v
      true
```
assistant