From e16d8793841a5eb66de454a8d064d8f7e4c889b6 Mon Sep 17 00:00:00 2001 From: Bhavya Dhiman Date: Fri, 18 Oct 2024 02:06:17 +0530 Subject: [PATCH] chore(buffer): use node:buffer instead of safe-buffer --- lib/response.js | 2 +- lib/utils.js | 2 +- test/express.json.js | 2 +- test/express.raw.js | 2 +- test/express.static.js | 2 +- test/express.text.js | 2 +- test/express.urlencoded.js | 2 +- test/res.attachment.js | 2 +- test/res.download.js | 2 +- test/res.send.js | 2 +- test/res.sendFile.js | 2 +- test/support/utils.js | 2 +- test/utils.js | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/response.js b/lib/response.js index 937e985853..29511a74e0 100644 --- a/lib/response.js +++ b/lib/response.js @@ -12,7 +12,7 @@ * @private */ -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var contentDisposition = require('content-disposition'); var createError = require('http-errors') var encodeUrl = require('encodeurl'); diff --git a/lib/utils.js b/lib/utils.js index f66760a17c..67eacf274e 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -12,7 +12,7 @@ * @api private */ -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var contentType = require('content-type'); var etag = require('etag'); var mime = require('mime-types') diff --git a/test/express.json.js b/test/express.json.js index 859347e1dc..c92d8234bb 100644 --- a/test/express.json.js +++ b/test/express.json.js @@ -2,7 +2,7 @@ var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..') var request = require('supertest') diff --git a/test/express.raw.js b/test/express.raw.js index f6513a7d48..cd526e3913 100644 --- a/test/express.raw.js +++ b/test/express.raw.js @@ -2,7 +2,7 @@ var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..') var request = require('supertest') diff --git a/test/express.static.js b/test/express.static.js index e5100e8c8d..c7c7d4df89 100644 --- a/test/express.static.js +++ b/test/express.static.js @@ -1,7 +1,7 @@ 'use strict' var assert = require('assert') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..') var path = require('path') var request = require('supertest') diff --git a/test/express.text.js b/test/express.text.js index ce365fa73c..e5fd9e415a 100644 --- a/test/express.text.js +++ b/test/express.text.js @@ -2,7 +2,7 @@ var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..') var request = require('supertest') diff --git a/test/express.urlencoded.js b/test/express.urlencoded.js index 37afb07f38..2bf72b79b9 100644 --- a/test/express.urlencoded.js +++ b/test/express.urlencoded.js @@ -2,7 +2,7 @@ var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..') var request = require('supertest') diff --git a/test/res.attachment.js b/test/res.attachment.js index 6283ded0d6..1281584f3c 100644 --- a/test/res.attachment.js +++ b/test/res.attachment.js @@ -1,6 +1,6 @@ 'use strict' -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('../') , request = require('supertest'); diff --git a/test/res.download.js b/test/res.download.js index f7d795d57c..3ccd0c7744 100644 --- a/test/res.download.js +++ b/test/res.download.js @@ -3,7 +3,7 @@ var after = require('after'); var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..'); var path = require('path') var request = require('supertest'); diff --git a/test/res.send.js b/test/res.send.js index bce62c8d40..1f9b372c8c 100644 --- a/test/res.send.js +++ b/test/res.send.js @@ -1,7 +1,7 @@ 'use strict' var assert = require('assert') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('..'); var methods = require('methods'); var request = require('supertest'); diff --git a/test/res.sendFile.js b/test/res.sendFile.js index 7bba9cd6d1..d0b4b1b50c 100644 --- a/test/res.sendFile.js +++ b/test/res.sendFile.js @@ -3,7 +3,7 @@ var after = require('after'); var assert = require('assert') var asyncHooks = tryRequire('async_hooks') -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var express = require('../') , request = require('supertest') var onFinished = require('on-finished'); diff --git a/test/support/utils.js b/test/support/utils.js index 5ad4ca9841..50350943d4 100644 --- a/test/support/utils.js +++ b/test/support/utils.js @@ -5,7 +5,7 @@ */ var assert = require('assert'); -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer /** * Module exports. diff --git a/test/utils.js b/test/utils.js index aff3f03aa3..0b68d38a69 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,7 +1,7 @@ 'use strict' var assert = require('assert'); -var Buffer = require('safe-buffer').Buffer +var Buffer = require('node:buffer').Buffer var utils = require('../lib/utils'); describe('utils.etag(body, encoding)', function(){