0.1.3 • Published 10 years ago

hapi-queryparams v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Hapi.js Query Params (Plugin)

Build Status

Hapi.js Plugin for convert query params to

  • camel cases
  • lower case
  • all caps
  • first charecter CAP

WHY?

  • we had to support different query params from old clients so we want to convert all of them to lower case

How?

// server
server.register([
  register: require('hapi-queryparams'),
  options: {
  delete_original: true/false // remove the origin query param attribute
  //ONLY ONE OPTION SHOULD BE SET TO TRUE
    camel_case: true, // user_name => userName , UserName => userName
    all_caps: true,   // username => USERNAME
    lower_case: true, // UserName => username
    first_cap: true, // userName => UserName
  }
])
// correct way to pass options
server.register([
  register: require('hapi-queryparams'),
  options: {
  delete_original: true,
  camel_case: true
  }
])

// from user_name=doron2402 => userName=doron2402 // user_name will be deleted

** IMPORTANT: options must have only ONE param you can camel case and all caps,

Github

Check the GitHub issues.

LICENSE

LICENSE.

0.1.3

10 years ago

0.1.22

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago