querystring = require 'querystring'
log = require 'bog'

asInt = (s) ->
    return undefined unless s
    try
        n = parseInt(s, 10)
        throw Error('nan') if isNaN(n)
        n
    catch ex
        log.warn "Failed to interpret as int: #{s}"
        undefined

module.exports = (str) ->

    p = querystring.parse str

    {
        q: p.q ? ''
    }
