ccqp

1.0.0 • Public • Published

ccqp

Build Status npm version npm downloads minified size

express middleware to recursively transform query params keys to camel-case.

TL;DR

npm install ccqp
const express = require('express')
const ccqp = require('ccqp')
 
const app = express()
app.use(ccqp)
 
// ...

 

A request with the following querystring:

const qs = `
  ?first_name=John
  &LastName=Doe
  &date-of_-birth=01.01.1985
  &hair.color=brown
  &contact[email]=john.doe@example.com
  &contact[phone_number]=754-3010
`

will have the following req.query:

{
  firstName: 'John',
  lastName: 'Doe',
  dateOfBirth: '01.01.1985',
  hairColor: 'brown',
  contact: {
    email: 'john.doe@example.com',
    phoneNumber: '754-3010',
  },
 }

 

Package Sidebar

Install

npm i ccqp

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.27 kB

Total Files

7

Last publish

Collaborators

  • monojack