Parsing of a query string with Ramda.js.

let query_string = '?p=ハッカー製&auccat=22844&alocale=0jp&acc=jp';

// First to Last
pipe(tail, split('&'),  map(split('=')), fromPairs)(query_string);
    { acc: 'jp', alocale: '0jp', auccat: '22844', p: 'ハッカー製' }

// Last to First
compose(fromPairs, map(split('=')), split('&'), tail)(query_string);
    { acc: 'jp', alocale: '0jp', auccat: '22844', p: 'ハッカー製' }

// Check for question mark first.
const cleanQuery = ifElse(
  pipe(head, equals('?')),
  tail,
  identity
);

query_string = '?_from=R40&_nkw=mario&_sacat=0';
pipe(
  cleanQuery,
  split('&'),
  map(split('=')),
  fromPairs
)(query_string);
    { _from: 'R40', _nkw: 'mario', _sacat: '0' }

Example