← Files RivetARCHIVED FILE

node_modules/body-parser/index.js

976 Bytes · Nov 7, 2026 · 13:16 UTC

↓ Download file

/*!
 * body-parser
 * Copyright(c) 2014-2015 Douglas Christopher Wilson
 * MIT Licensed
 */

'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
 */
exports.json = require('./lib/types/json')

/**
 * Raw parser.
 * @public
 */
exports.raw = require('./lib/types/raw')

/**
 * Text parser.
 * @public
 */
exports.text = require('./lib/types/text')

/**
 * URL-encoded parser.
 * @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.')
}

SHA-256: 4d33d19d4ce36726988a1fa508f4d6f15254cc52fe95b777b30f49d97d825668