From 08576a85e012415beaff066f36c78fdd50a9db20 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 1 Nov 2023 15:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cookie.js | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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"