Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(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)
}
})
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;
}