@jswork/next-header-normalize

1.0.3 • Public • Published

next-header-normalize

Normalize http header.

version license size download

installation

npm install -S @jswork/next-header-normalize

usage

import '@jswork/next-header-normalize';

const header = {
  'AcceptLanguage': 'zh-CN',
  'contentLength': 521,
  'X-Powered-By': null,
  'Content-Type': 'application/json; charset=utf-8',
  'cache-control': 'public, max-age=31536000',
  'authorization': 'Bearer xxx.my-token+'
};

const result = nx.headerNormalize(header, { lowerCase: true, compact: true });

/*
{
  'accept-language': 'zh-CN',
  'content-length': 521,
  'content-type': 'application/json; charset=utf-8',
  'cache-control': 'public, max-age=31536000',
  'authorization': 'Bearer xxx.my-token+'
}
*/

license

Code released under the MIT license.

Dependents (1)

Package Sidebar

Install

npm i @jswork/next-header-normalize

Homepage

js.work

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

6.54 kB

Total Files

6

Last publish

Collaborators

  • afeiship