koa-camelcase-keys
A koa middleware for converting object keys to camelCase using
camelcase-keys
.
Installation
$ npm i --save koa-camelcase-keys
Usage
const Koa = const bodyParser = const camelCase = const app = // convert json body to objectapp // camel case the object from bodyParser middlerwareapp // Or// exclude some routesappappapp // Or// exclude some keysappapp // Or// disable deep matchapp
API
camelCase({ deep: true, exclude: [], excludeRoutes: '' } = {})
excludeRoutes
Type: string[]
RegExp[]
Default: ''
Exclude routes from being camelCased.
exclude
Type: string[]
RegExp[]
Default: []
Exclude keys from being camelCased.
deep
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
License
MIT @ Mindspop