From 51968f94b5e820adeceef505539fa193ffe2d105 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Wed, 2 Oct 2024 15:32:30 -0700 Subject: [PATCH] Skip isNaN --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3e5162a..56ed1e6 100644 --- a/index.js +++ b/index.js @@ -100,7 +100,7 @@ function parse(str, options) { // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='. var max = len - 2; if (max < 0) return obj; - + var dec = (options && options.decode) || decode; var index = 0; var eqIdx = 0; @@ -203,7 +203,7 @@ function serialize(name, val, options) { if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; - if (isNaN(maxAge) || !isFinite(maxAge)) { + if (!isFinite(maxAge)) { throw new TypeError('option maxAge is invalid') }