Optional
decode: null | ((input) => string)Optional
seperator: null | stringOptional
equals: null | stringimport { string } from "@rjweb/utils"
string.kv('K=12') // {K:'12'}
string.kv('E="400"') // {E:'"400"'}
string.kv('sofhjjsihgai') // {sofhjjsihgai:''}
string.kv('hi=ok&eeee=%20') // {hi:'ok', eeee:'%20'}
string.kv('hi=ok&eeee=%20', decodeURIComponent) // {hi:'ok', eeee:' '}
string.kv('aaa&bbb') // {aaa:'', bbb:''}
string.kv('aaa#g.1', null, '#', '.') // {aaa:'', g: '1'}
1.12.19
nodejs, browser
Parse a String into an Object using basic key value syntax