@apimatic/core
Advanced tools
Comparing version 0.7.8 to 0.7.9
@@ -49,3 +49,9 @@ import flatMap from 'lodash.flatmap'; | ||
var encode = function (m) { | ||
return skipEncode || typeof m === 'bigint' ? m.toString() : encodeURIComponent(m); | ||
var encodeParameter = ''; | ||
if (typeof m === 'string' || typeof m === 'number' || typeof m === 'bigint') { | ||
encodeParameter = skipEncode || typeof m === 'bigint' ? m.toString() : encodeURIComponent(m); | ||
} | ||
return encodeParameter; | ||
}; | ||
@@ -52,0 +58,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
} | ||
export declare type PathTemplatePrimitiveTypes = string | string[] | number | number[] | bigint | Array<bigint>; | ||
export declare type PathTemplatePrimitiveTypes = string | string[] | number | number[] | bigint | Array<bigint> | unknown; | ||
/** Path template argument type */ | ||
@@ -14,0 +14,0 @@ export declare type PathTemplateTypes = PathTemplatePrimitiveTypes | SkipEncode<PathTemplatePrimitiveTypes>; |
@@ -40,3 +40,12 @@ "use strict"; | ||
var encode = function (m) { | ||
return skipEncode || typeof m === 'bigint' ? m.toString() : encodeURIComponent(m); | ||
var encodeParameter = ''; | ||
if (typeof m === 'string' || | ||
typeof m === 'number' || | ||
typeof m === 'bigint') { | ||
encodeParameter = | ||
skipEncode || typeof m === 'bigint' | ||
? m.toString() | ||
: encodeURIComponent(m); | ||
} | ||
return encodeParameter; | ||
}; | ||
@@ -43,0 +52,0 @@ if (value instanceof SkipEncode) { |
{ | ||
"name": "@apimatic/core", | ||
"author": "Wajahat Iqbal", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"license": "SEE LICENSE IN LICENSE.md", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
@@ -20,3 +20,4 @@ /** | ||
| bigint | ||
| Array<bigint>; | ||
| Array<bigint> | ||
| unknown; | ||
@@ -53,4 +54,17 @@ /** Path template argument type */ | ||
let skipEncode = false; | ||
const encode = (m: string | number | bigint) => | ||
skipEncode || typeof m === 'bigint' ? m.toString() : encodeURIComponent(m); | ||
const encode = (m: string | number | bigint | unknown) => { | ||
let encodeParameter = ''; | ||
if ( | ||
typeof m === 'string' || | ||
typeof m === 'number' || | ||
typeof m === 'bigint' | ||
) { | ||
encodeParameter = | ||
skipEncode || typeof m === 'bigint' | ||
? m.toString() | ||
: encodeURIComponent(m); | ||
} | ||
return encodeParameter; | ||
}; | ||
if (value instanceof SkipEncode) { | ||
@@ -61,4 +75,4 @@ value = value.value; | ||
return Array.isArray(value) | ||
? (value as Array<string | number | bigint>) | ||
.map<string | number | bigint>(encode) | ||
? (value as Array<string | number | bigint | unknown>) | ||
.map<string | number | bigint | unknown>(encode) | ||
.join('/') | ||
@@ -65,0 +79,0 @@ : [encode(value)]; |
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
207871
5495