Skip to content

Commit

Permalink
cleanup: remove unnecessary require for global Buffer
Browse files Browse the repository at this point in the history
The Buffer object is globally available in Node.js, so there is no need to explicitly require it.
  • Loading branch information
Phillip9587 committed Nov 15, 2024
1 parent cc751cf commit d246446
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 13 deletions.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ unreleased
========================

* Remove `Object.setPrototypeOf` polyfill
* cleanup: remove unnecessary require for global Buffer

5.0.1 / 2024-10-08
==========
Expand Down
1 change: 0 additions & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @private
*/

var Buffer = require('node:buffer').Buffer
var contentDisposition = require('content-disposition');
var createError = require('http-errors')
var encodeUrl = require('encodeurl');
Expand Down
1 change: 0 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @api private
*/

var Buffer = require('node:buffer').Buffer
var contentType = require('content-type');
var etag = require('etag');
var mime = require('mime-types')
Expand Down
1 change: 0 additions & 1 deletion test/express.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
1 change: 0 additions & 1 deletion test/express.raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
1 change: 0 additions & 1 deletion test/express.static.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

var assert = require('assert')
var Buffer = require('node:buffer').Buffer
var express = require('..')
var path = require('path')
var request = require('supertest')
Expand Down
1 change: 0 additions & 1 deletion test/express.text.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
1 change: 0 additions & 1 deletion test/express.urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
1 change: 0 additions & 1 deletion test/res.attachment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

var Buffer = require('node:buffer').Buffer
var express = require('../')
, request = require('supertest');

Expand Down
1 change: 0 additions & 1 deletion test/res.download.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var after = require('after');
var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('..');
var path = require('path')
var request = require('supertest');
Expand Down
1 change: 0 additions & 1 deletion test/res.send.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

var assert = require('assert')
var Buffer = require('node:buffer').Buffer
var express = require('..');
var methods = require('methods');
var request = require('supertest');
Expand Down
1 change: 0 additions & 1 deletion test/res.sendFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var after = require('after');
var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('node:buffer').Buffer
var express = require('../')
, request = require('supertest')
var onFinished = require('on-finished');
Expand Down
1 change: 0 additions & 1 deletion test/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

var assert = require('assert');
var Buffer = require('node:buffer').Buffer

/**
* Module exports.
Expand Down
1 change: 0 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

var assert = require('assert');
var Buffer = require('node:buffer').Buffer
var utils = require('../lib/utils');

describe('utils.etag(body, encoding)', function(){
Expand Down

0 comments on commit d246446

Please sign in to comment.