Skip to content

Commit

Permalink
Skip isNaN
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 2, 2024
1 parent 9e7ca51 commit 51968f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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')
}

Expand Down

0 comments on commit 51968f9

Please sign in to comment.