Extract and set form values through the DOM—no frameworks required! https://github.com/TheoryOfNekomata/formxtra
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

123456789101112
  1. export const makeSearchParams = (beforeValues) => Object
  2. .entries(beforeValues)
  3. .reduce(
  4. (beforeSearchParams, [key, value]) => {
  5. const theValue = !Array.isArray(value) ? [value] : value
  6. theValue.forEach(v => {
  7. beforeSearchParams.append(key, v)
  8. })
  9. return beforeSearchParams
  10. },
  11. new URLSearchParams()
  12. )