File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { OptionsJson } from 'body-parser' ;
2- import { json } from 'body-parser' ;
2+ import bodyParser from 'body-parser' ;
33import { coreHandler } from 'routup' ;
44
55export function createJsonHandler ( options ?: OptionsJson ) {
6- const handler = json ( options ) ;
6+ const handler = bodyParser . json ( options ) ;
77
88 return coreHandler ( ( req , res , next ) => {
99 handler ( req , res , next ) ;
Original file line number Diff line number Diff line change 11import type { Options } from 'body-parser' ;
2- import { raw } from 'body-parser' ;
2+ import bodyParser from 'body-parser' ;
33import { coreHandler } from 'routup' ;
44
55export function createRawHandler ( options ?: Options ) {
6- const handler = raw ( options ) ;
6+ const handler = bodyParser . raw ( options ) ;
77 return coreHandler ( ( req , res , next ) => {
88 handler ( req , res , next ) ;
99 } ) ;
Original file line number Diff line number Diff line change 11import type { OptionsText } from 'body-parser' ;
2- import { text } from 'body-parser' ;
2+ import bodyParser from 'body-parser' ;
33import { coreHandler } from 'routup' ;
44
55export function createTextHandler ( options ?: OptionsText ) {
6- const handler = text ( options ) ;
6+ const handler = bodyParser . text ( options ) ;
77
88 return coreHandler ( ( req , res , next ) => {
99 handler ( req , res , next ) ;
Original file line number Diff line number Diff line change 11import type { OptionsUrlencoded } from 'body-parser' ;
2- import { urlencoded } from 'body-parser' ;
2+ import bodyParser from 'body-parser' ;
33import { coreHandler } from 'routup' ;
44
55export function createUrlEncodedHandler ( options ?: OptionsUrlencoded ) {
6- const handler = urlencoded ( {
6+ const handler = bodyParser . urlencoded ( {
77 extended : false ,
88 ...( options || { } ) ,
99 } ) ;
You can’t perform that action at this time.
0 commit comments