@jswork/next-header-normalize

    1.0.1 • Public • Published

    next-header-normalize

    Normalize http header case.

    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.

    Install

    npm i @jswork/next-header-normalize

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    6.04 kB

    Total Files

    5

    Last publish

    Collaborators

    • afeiship