| 16774 | date = new Date(date); |
| 16775 | } |
| 16776 | return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`; |
| 16777 | } |
| 16778 | function validateCookieMaxAge(maxAge) { |
| 16779 | if (maxAge < 0) { |
| 16780 | throw new Error("Invalid cookie max-age"); |
| 16781 | } |
| 16782 | } |
| 16783 | function stringify(cookie) { |
| 16784 | if (cookie.name.length === 0) { |
| 16785 | return null; |
| 16786 | } |
| 16787 | validateCookieName(cookie.name); |
| 16788 | validateCookieValue(cookie.value); |
| 16789 | const out = [`${cookie.name}=${cookie.value}`]; |
| 16790 | if (cookie.name.startsWith("__Secure-")) { |
| 16791 | cookie.secure = true; |
| 16792 | } |