/**
 * 搜索字符串解析模块
 */ namespace drunk . querystring { param str export function parse ( str ) { str = decodeURIComponent ( str ) ; let ret = { } ; str . split ( '&' ) . forEach ( ( pair ) => { let arr = pair . split ( '=' ) ; ret [ arr [ 0 ] ] = arr [ 1 ] ; } ) ; return ret ; } param obj export function stringify ( obj ) { return Object . keys ( obj ) . map ( key => key + '=' + encodeURIComponent ( obj [ key ] ) ) . join ( '&' ) ; } }