How to use query-string-for-all - 2 common examples

To help you get started, we’ve selected a few query-string-for-all examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github podlove / podlove-ui / packages / utils / url.js View on Github external
export const addQueryParameter = (url, additionalParameters = {}) => {
  const parser = document.createElement('a')
  parser.href = url

  const existingParameters = queryString.parse(parser.search)
  parser.search = queryString.stringify(Object.assign({}, existingParameters, additionalParameters))

  return parser.href
}
github podlove / podlove-ui / packages / utils / url.js View on Github external
export const addQueryParameter = (url, additionalParameters = {}) => {
  const parser = document.createElement('a')
  parser.href = url

  const existingParameters = queryString.parse(parser.search)
  parser.search = queryString.stringify(Object.assign({}, existingParameters, additionalParameters))

  return parser.href
}

query-string-for-all

Parse and stringify URL query strings

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular query-string-for-all functions