From 59fe9158691cd328f1999c0bc46ca34fb75ca366 Mon Sep 17 00:00:00 2001 From: Phillip Barta Date: Mon, 23 Feb 2026 21:59:16 +0100 Subject: [PATCH] remove deprecated bodyParser() middleware --- index.js | 24 ------------------------ test/body-parser.js | 11 ----------- 2 files changed, 35 deletions(-) delete mode 100644 test/body-parser.js diff --git a/index.js b/index.js index c0526e16..48cff771 100644 --- a/index.js +++ b/index.js @@ -6,20 +6,6 @@ 'use strict' -/** - * @typedef {Object} Parsers - * @property {Function} json JSON parser - * @property {Function} raw Raw parser - * @property {Function} text Text parser - * @property {Function} urlencoded URL-encoded parser - */ - -/** - * Module exports. - * @type {Function & Parsers} - */ -exports = module.exports = bodyParser - /** * JSON parser. * @public @@ -43,13 +29,3 @@ exports.text = require('./lib/types/text') * @public */ exports.urlencoded = require('./lib/types/urlencoded') - -/** - * Create a middleware to parse json and urlencoded bodies. - * - * @deprecated - * @public - */ -function bodyParser () { - throw new Error('The bodyParser() generic has been split into individual middleware to use instead.') -} diff --git a/test/body-parser.js b/test/body-parser.js deleted file mode 100644 index fcdde650..00000000 --- a/test/body-parser.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' - -var assert = require('node:assert') - -var bodyParser = require('..') - -describe('bodyParser()', function () { - it('should throw an error', function () { - assert.throws(bodyParser, /bodyParser\(\) generic has been split/) - }) -})