jshttp / accepts

Higher-level content negotiation
MIT License
252 stars 42 forks source link

Ability to add additional types #19

Open btilford opened 4 years ago

btilford commented 4 years ago

It would be nice to add types so that the following would work.

// Accepts: application/hal+json
const accept = accepts(req);

switch(accept.type(['json', 'html'])) {
    case 'json':
       // would match both application/json and application/hal+json
    default:
      // 
}