Extract and set form values through the DOM—no frameworks required! https://github.com/TheoryOfNekomata/formxtra
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

13 行
325 B

  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. )