diff --git a/lib/cookie.js b/lib/cookie.js index e6c84a9..a3a2e65 100644 --- a/lib/cookie.js +++ b/lib/cookie.js @@ -29,7 +29,7 @@ export function serialize(key, val, opts) { if (opts.hasOwnProperty('expires') && opts.expires) { // pairs.push('Expires=' + opts.expires.toUTCString()) // 有效期, 已不建议使用,改用 max-age - if (Date.isDate(opts.expires)) { + if (opts.expires instanceof Date) { opts.maxAge = ~~(opts.expires.getTime() / 1000) } else { opts.maxAge = +opts.expires diff --git a/package.json b/package.json index d9ff047..543484d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gm5/response", - "version": "2.0.1", + "version": "2.0.2", "type": "module", "description": "对Http的response进一步封装, 提供常用的API", "main": "index.js", @@ -11,7 +11,7 @@ "http" ], "dependencies": { - "iofs": "^1.5.0" + "iofs": "^1.5.3" }, "repository": "https://git.wkit.fun/gm5/response.git", "license": "MIT"