Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apimatic/core

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apimatic/core - npm Package Compare versions

Comparing version 0.10.12 to 0.10.13

7

es/http/requestBuilder.js

@@ -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) {

4

lib/http/requestBuilder.d.ts

@@ -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 {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc