xjs-common 10.1.1 → 10.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,4 +4,6 @@ export declare namespace UHttp {
4
4
  function concatParamsWithEncoding(end: string, params: {
5
5
  [k: string]: string | string[];
6
6
  }): string;
7
+ /** normalize object keys to lower case. */
8
+ function normalizeHeaders(headers: Record<string, any>): Record<string, any>;
7
9
  }
@@ -22,4 +22,11 @@ var UHttp;
22
22
  return result.substring(0, result.length - 1);
23
23
  }
24
24
  UHttp.concatParamsWithEncoding = concatParamsWithEncoding;
25
+ /** normalize object keys to lower case. */
26
+ function normalizeHeaders(headers) {
27
+ if (!headers)
28
+ return {};
29
+ return Object.entries(headers).reduce((a, b) => { a[b[0].toLowerCase()] = b[1]; return a; }, {});
30
+ }
31
+ UHttp.normalizeHeaders = normalizeHeaders;
25
32
  })(UHttp = exports.UHttp || (exports.UHttp = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xjs-common",
3
- "version": "10.1.1",
3
+ "version": "10.1.2",
4
4
  "description": "library modules for typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",