* Recursively serializes an object into an encoded URI parameter string.
*/
function serialize(obj, prefix) {
+ if (obj === null) {
+ return "";
+ }
const parameters = [];
Object.keys(obj).forEach((key) => {
const parameterKey = prefix ? prefix + "[" + key + "]" : key;
* Recursively serializes an object into an encoded URI parameter string.
*/
export function serialize(obj: object, prefix?: string): string {
- const parameters: string[] = [];
+ if (obj === null) {
+ return "";
+ }
+ const parameters: string[] = [];
Object.keys(obj).forEach((key) => {
const parameterKey = prefix ? prefix + "[" + key + "]" : key;
const value = obj[key];