调整语法

master
yutent 2023-11-01 15:50:57 +08:00
parent 0619b424fe
commit 08576a85e0
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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"