32 Commits

Author SHA1 Message Date
dufucun
f9954dd317 fix(test): remove duplicate word (#6456)
Signed-off-by: dufucun <dufuchun@sohu.com>
2025-04-16 11:18:38 -05:00
Szymon Łągiewka
41113599af fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Wes Todd
e9f9aaeebd Merge tag '4.19.0' into 5.x
4.19.0
2024-03-20 21:14:00 -05:00
Rakesh Bisht
c6ee8d6e7f lint: remove unused function arguments in tests
closes #5124
2023-02-20 22:57:13 -05:00
Nadav Ivgi
9482b82d0b Invoke default with same arguments as types in res.format
closes #3587
2022-03-26 01:29:40 -04:00
Douglas Christopher Wilson
318fd4b543 Merge tag '4.17.3' 2022-02-17 00:27:11 -05:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Douglas Christopher Wilson
302a6152b4 Merge tag '4.16.4' 2018-10-23 20:38:42 -04:00
Alejandro Estrada
40e04ec7a6 lint: remove usages of "=="
closes #3540
2018-02-13 19:30:57 -05:00
Douglas Christopher Wilson
62e12fe710 Merge tag '4.16.2' 2017-10-13 22:27:30 -04:00
Douglas Christopher Wilson
de129c289d tests: run mocha with --no-exit to detect hangs
closes #3439
2017-10-01 00:48:29 -04:00
Mike Tunnicliffe
e3bd14dcca Remove res.send(status, body) signature
closes #2942
2017-08-07 20:06:44 -04:00
Douglas Christopher Wilson
e0066227f7 lint: remove all unused varaibles 2017-08-06 00:19:32 -04:00
Behcet Uyar
24d1c98c0a Fix res.format error when only default provided
fixes #2665
2015-06-18 23:08:34 -04:00
Douglas Christopher Wilson
82689d68cf Merge tag '3.19.1' 2015-01-21 03:24:31 -05:00
Douglas Christopher Wilson
855176b633 tests: remove more mocking uses 2015-01-21 03:17:30 -05:00
Douglas Christopher Wilson
5019f38e29 tests: add more tests 2014-06-06 00:38:14 -04:00
Douglas Christopher Wilson
f14e39d451 set proper charset in content-type for res.send
This will write strings to sockets with an explicit "utf8" encoding
(which is the default) and will override the charset in the
Content-Type so it properly relfects the encoding of the response.

closes #1631
closes #2092
2014-05-21 01:31:08 -04:00
Jonathan Ong
328c6d3060 remove unnecessary test/support/http
backport of 643397ed21
2014-05-18 00:57:54 -04:00
Douglas Christopher Wilson
35c50601bd Merge tag '3.6.0' 2014-05-09 17:33:26 -04:00
Douglas Christopher Wilson
bc9bcb0317 Fix req.next when inside router instance
fixes #2016
2014-05-09 16:53:15 -04:00
Douglas Christopher Wilson
35a66d8a14 tests: add test for res.format in route
closes #2016
2014-05-08 21:15:48 -04:00
Jonathan Ong
2064f412cb remove res.charset usage 2014-03-07 16:46:54 -08:00
Jonathan Ong
643397ed21 remove unnecessary test/support/http 2014-03-05 22:06:14 -08:00
Eduardo Sorribas
69290cad6f res.format() now includes charset. Fixes #1744 2013-09-08 02:10:46 -04:00
Hage Yaapa
a38bdf6758 fixed test cases for res.format 2013-08-04 20:32:08 +05:30
TJ Holowaychuk
0f5560eebd updated tests to use "supertest" 2012-06-26 17:14:07 -07:00
TJ Holowaychuk
82b5b12ca7 Added .default() support to res.format() 2012-06-17 13:15:55 -07:00
TJ Holowaychuk
12e087820c Added: res.format() sets Vary: Accept 2012-04-12 20:11:15 -07:00
TJ Holowaychuk
298899d02c Added array support. Closes #1053 2012-03-23 17:58:41 -07:00
TJ Holowaychuk
eb3105ef25 Added extname support to res.format(). Closes #1024 2012-02-23 10:58:06 -08:00
TJ Holowaychuk
ffcaa04d2c renamed res.respondTo() to res.format()
since you are not really responding with it,
its basically as switch
2012-02-22 19:59:52 -08:00