From 80a3d685e6a3c22b26f8931efea402f69225ba31 Mon Sep 17 00:00:00 2001 From: ctcpip Date: Fri, 2 Aug 2024 15:06:29 -0500 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20use=20spread,=20update=20s?= =?UTF-8?q?upported=20ecmascript=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.yml | 2 ++ lib/response.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 9e282530d5..b18893b89f 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -2,6 +2,8 @@ root: true env: es6: true node: true +languageOptions: + ecmaVersion: 2022 rules: eol-last: error eqeqeq: [error, allow-null] diff --git a/lib/response.js b/lib/response.js index c14bc4b3a7..a5a33e8609 100644 --- a/lib/response.js +++ b/lib/response.js @@ -708,7 +708,7 @@ res.get = function(field){ res.clearCookie = function clearCookie(name, options) { // Force cookie expiration by setting expires to the past - const opts = Object.assign({ path: '/' } , options, { expires: new Date(1) }) + const opts = { path: '/', ...options, expires: new Date(1)}; // ensure maxAge is not passed delete opts.maxAge