@apimatic/core
Advanced tools
Comparing version 0.10.12 to 0.10.13
@@ -88,3 +88,8 @@ import { __spreadArray, __read, __assign, __awaiter, __generator, __values } from 'tslib'; | ||
} | ||
setHeader(this._headers, name, value.toString()); | ||
if (typeof value === 'object') { | ||
setHeader(this._headers, name, JSON.stringify(value)); | ||
return; | ||
} | ||
// String() is used to convert boolean, number, bigint, or unknown types | ||
setHeader(this._headers, name, String(value)); | ||
}; | ||
@@ -91,0 +96,0 @@ DefaultRequestBuilder.prototype.headers = function (headersToMerge) { |
@@ -35,3 +35,3 @@ /// <reference types="node" /> | ||
contentType(contentTypeHeaderValue: string): void; | ||
header(name: string, value?: string | boolean | number | bigint | null): void; | ||
header(name: string, value?: unknown): void; | ||
headers(headersToMerge: Record<string, string>): void; | ||
@@ -100,3 +100,3 @@ query(name: string, value: QueryValue | Record<string, QueryValue>, prefixFormat?: ArrayPrefixFunction): void; | ||
contentType(contentTypeHeaderValue: string): void; | ||
header(name: string, value?: string | boolean | number | bigint | null): void; | ||
header(name: string, value?: unknown): void; | ||
headers(headersToMerge: Record<string, string>): void; | ||
@@ -103,0 +103,0 @@ query(name: string, value: QueryValue | Record<string, QueryValue>, prefixFormat?: ArrayPrefixFunction): void; |
@@ -87,3 +87,8 @@ "use strict"; | ||
} | ||
httpHeaders_1.setHeader(this._headers, name, value.toString()); | ||
if (typeof value === 'object') { | ||
httpHeaders_1.setHeader(this._headers, name, JSON.stringify(value)); | ||
return; | ||
} | ||
// String() is used to convert boolean, number, bigint, or unknown types | ||
httpHeaders_1.setHeader(this._headers, name, String(value)); | ||
}; | ||
@@ -90,0 +95,0 @@ DefaultRequestBuilder.prototype.headers = function (headersToMerge) { |
{ | ||
"name": "@apimatic/core", | ||
"author": "APIMatic Ltd.", | ||
"version": "0.10.12", | ||
"version": "0.10.13", | ||
"license": "MIT", | ||
@@ -86,3 +86,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "96d47bc2390aefc3119b26012053cb630de7b796" | ||
"gitHead": "e6eca29f8d49f29e5aee126152b0a50da23824dc" | ||
} |
@@ -115,3 +115,3 @@ import JSONBig from '@apimatic/json-bigint'; | ||
contentType(contentTypeHeaderValue: string): void; | ||
header(name: string, value?: string | boolean | number | bigint | null): void; | ||
header(name: string, value?: unknown): void; | ||
headers(headersToMerge: Record<string, string>): void; | ||
@@ -275,10 +275,12 @@ query( | ||
} | ||
public header( | ||
name: string, | ||
value?: string | boolean | number | bigint | null | ||
): void { | ||
public header(name: string, value?: unknown): void { | ||
if (value === null || typeof value === 'undefined') { | ||
return; | ||
} | ||
setHeader(this._headers, name, value.toString()); | ||
if (typeof value === 'object') { | ||
setHeader(this._headers, name, JSON.stringify(value)); | ||
return; | ||
} | ||
// String() is used to convert boolean, number, bigint, or unknown types | ||
setHeader(this._headers, name, String(value)); | ||
} | ||
@@ -285,0 +287,0 @@ public headers(headersToMerge: Record<string, string>): void { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194952
4960