@lucidtech/las-sdk-core
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -10,3 +10,3 @@ import { Credentials } from './credentials'; | ||
getProcesses(search?: { | ||
[key: string]: string; | ||
[key: string]: string | Array<string>; | ||
}): Promise<any>; | ||
@@ -13,0 +13,0 @@ postProcesses(stateMachineArn: string, inputData: any): Promise<any>; |
export declare function buildURL(url: string, params?: { | ||
[key: string]: string; | ||
[key: string]: string | Array<string>; | ||
}): string; |
@@ -7,5 +7,12 @@ "use strict"; | ||
} | ||
var queryString = new URLSearchParams(params); | ||
return url + "?" + queryString; | ||
var queryString = Object.entries(params).map(function (param) { | ||
var key = param[0], value = param[1]; | ||
if (typeof value === 'string') { | ||
return key + "=" + value; | ||
} | ||
return key + "=" + value.join(','); | ||
}).join('&'); | ||
var searchParams = new URLSearchParams(queryString); | ||
return url + "?" + searchParams; | ||
} | ||
exports.buildURL = buildURL; |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
@@ -22,4 +22,3 @@ "maintainers": [ | ||
"axios": "^0.19.0" | ||
}, | ||
"gitHead": "010fe6de6318379747a90176e376d94261130d22" | ||
} | ||
} |
@@ -38,3 +38,3 @@ import axios, { AxiosRequestConfig } from 'axios'; | ||
getProcesses(search?: { [key: string]: string }) { | ||
getProcesses(search?: { [key: string]: string|Array<string> }) { | ||
const url = buildURL('/processes', search); | ||
@@ -41,0 +41,0 @@ return this.makeGetRequest(url); |
@@ -1,2 +0,2 @@ | ||
export function buildURL(url: string, params?: { [ key: string ]: string }) { | ||
export function buildURL(url: string, params?: { [ key: string ]: string|Array<string> }) { | ||
if (!params) { | ||
@@ -6,4 +6,14 @@ return url; | ||
const queryString = new URLSearchParams(params); | ||
return `${url}?${queryString}`; | ||
const queryString = Object.entries(params).map((param) => { | ||
const [ key, value ] = param; | ||
if (typeof value === 'string') { | ||
return `${key}=${value}`; | ||
} | ||
return `${key}=${value.join(',')}`; | ||
}).join('&'); | ||
const searchParams = new URLSearchParams(queryString); | ||
return `${url}?${searchParams}`; | ||
} |
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
32466
538