Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (value === undefined) {
return EMPTY;
}
if (key === null) {
key = EMPTY;
}
if (value === null) {
return encode ? urlEncoder.encode(key) : key;
}
if (encode) {
key = urlEncoder.encode(key);
value = urlEncoder.encode(value);
}
return key + EQUALS + value;
}
});
value = obj.value;
if (value === undefined) {
return EMPTY;
}
if (key === null) {
key = EMPTY;
}
if (value === null) {
return encode ? urlEncoder.encode(key) : key;
}
if (encode) {
key = urlEncoder.encode(key);
value = urlEncoder.encode(value);
}
return key + EQUALS + value;
}
});
unparseSingle: function (obj, encode) {
if (!obj) { return EMPTY; }
var key = obj.key,
value = obj.value;
if (value === undefined) {
return EMPTY;
}
if (key === null) {
key = EMPTY;
}
if (value === null) {
return encode ? urlEncoder.encode(key) : key;
}
if (encode) {
key = urlEncoder.encode(key);
value = urlEncoder.encode(value);
}
return key + EQUALS + value;
}
});