Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cookieDef.key; // $ExpectType string | undefined
cookieDef.value; // ExpectType string | undefined
cookieDef.expires; // $ExpectType string | Date | undefined
cookieDef.maxAge; // $ExpectType number | undefined
cookieDef.domain; // $ExpectType string
cookieDef.path; // $ExpectType string
cookieDef.secure; // $ExpectType boolean | undefined
cookieDef.httpOnly; // $ExpectType boolean | undefined
cookieDef.hostOnly; // $ExpectType boolean | undefined
cookieDef.session; // $ExpectType boolean | undefined
cookieDef.extensions; // $ExpectType { key: string; value: string; }[] | undefined
// Cookie Tests
let cookie = new pmCollection.Cookie();
cookie = new pmCollection.Cookie(cookieDef);
cookie.domain; // $ExpectType string
cookie.expires; // $ExpectType Date
cookie.extensions; // $ExpectType { key: string; value: string; }[] | undefined
cookie.hostOnly; // $ExpectType boolean | undefined
cookie.httpOnly; // $ExpectType boolean | undefined
cookie.maxAge; // $ExpectType number | undefined
cookie.path; // $ExpectType string
cookie.secure; // $ExpectType boolean | undefined
cookie.session; // $ExpectType boolean | undefined
cookie.value; // $ExpectType string | undefined
cookie.update(cookieDef); // $ExpectType void
cookie.valueOf(); // $ExpectType string
};
cookieDef.key; // $ExpectType string | undefined
cookieDef.value; // ExpectType string | undefined
cookieDef.expires; // $ExpectType string | Date | undefined
cookieDef.maxAge; // $ExpectType number | undefined
cookieDef.domain; // $ExpectType string
cookieDef.path; // $ExpectType string
cookieDef.secure; // $ExpectType boolean | undefined
cookieDef.httpOnly; // $ExpectType boolean | undefined
cookieDef.hostOnly; // $ExpectType boolean | undefined
cookieDef.session; // $ExpectType boolean | undefined
cookieDef.extensions; // $ExpectType { key: string; value: string; }[] | undefined
// Cookie Tests
let cookie = new pmCollection.Cookie();
cookie = new pmCollection.Cookie(cookieDef);
cookie.domain; // $ExpectType string
cookie.expires; // $ExpectType Date
cookie.extensions; // $ExpectType { key: string; value: string; }[] | undefined
cookie.hostOnly; // $ExpectType boolean | undefined
cookie.httpOnly; // $ExpectType boolean | undefined
cookie.maxAge; // $ExpectType number | undefined
cookie.path; // $ExpectType string
cookie.secure; // $ExpectType boolean | undefined
cookie.session; // $ExpectType boolean | undefined
cookie.value; // $ExpectType string | undefined
cookie.update(cookieDef); // $ExpectType void
cookie.valueOf(); // $ExpectType string
deserialize = function (cookie) {
if (!cookie) {
return;
}
return new PostmanCookie({
name: cookie.key,
value: cookie.value,
expires: cookie.expires === 'Infinity' ? null : cookie.expires,
maxAge: cookie.maxAge,
domain: cookie.domain,
path: cookie.path,
secure: cookie.secure,
httpOnly: cookie.httpOnly,
hostOnly: cookie.hostOnly,
extensions: cookie.extensions
});
},
toPostmanCookie = function (cookie) {
cookie.toJSON && (cookie = cookie.toJSON());
return new sdk.Cookie({
name: cookie.key,
value: cookie.value,
expires: cookie.expires === 'Infinity' ? null : cookie.expires,
maxAge: cookie.maxAge,
domain: cookie.domain,
path: cookie.path,
secure: cookie.secure,
httpOnly: cookie.httpOnly,
hostOnly: cookie.hostOnly,
extensions: cookie.extensions
});
},