How to use the qs/lib/utils.encode function in qs

To help you get started, we’ve selected a few qs 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 ipfs / js-ipfs-http-client / src / utils / send-request.js View on Github external
(byte === 0x2D) ||
            (byte === 0x2E) ||
            (byte === 0x5F) ||
            (byte === 0x7E)
          ) {
            uriEncoded += String.fromCharCode(byte)
          } else {
            const hex = byte.toString(16)
            // String.prototype.padStart() not widely supported yet
            const padded = hex.length === 1 ? `0${hex}` : hex
            uriEncoded += `%${padded}`
          }
        }
        return uriEncoded
      }
      return qsDefaultEncoder(data)
    }
  })
github algolia / algoliasearch-helper-js / src / url.js View on Github external
function recursiveEncode(input) {
  if (isPlainObject(input)) {
    return mapValues(input, recursiveEncode);
  }
  if (Array.isArray(input)) {
    return map(input, recursiveEncode);
  }
  if (isString(input)) {
    return encode(input);
  }
  return input;
}

qs

A querystring parser that supports nesting and arrays, with a depth limit

BSD-3-Clause
Latest version published 13 days ago

Package Health Score

94 / 100
Full package analysis