@sp-api-sdk/catalog-items-api-2022-04-01
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -83,2 +83,20 @@ "use strict"; | ||
exports.setOAuthToObject = setOAuthToObject; | ||
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { | ||
if (typeof parameter === "object") { | ||
if (Array.isArray(parameter)) { | ||
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); | ||
} | ||
else { | ||
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)); | ||
} | ||
} | ||
else { | ||
if (urlSearchParams.has(key)) { | ||
urlSearchParams.append(key, parameter); | ||
} | ||
else { | ||
urlSearchParams.set(key, parameter); | ||
} | ||
} | ||
} | ||
/** | ||
@@ -90,15 +108,3 @@ * | ||
const searchParams = new URLSearchParams(url.search); | ||
for (const object of objects) { | ||
for (const key in object) { | ||
if (Array.isArray(object[key])) { | ||
searchParams.delete(key); | ||
for (const item of object[key]) { | ||
searchParams.append(key, item); | ||
} | ||
} | ||
else { | ||
searchParams.set(key, object[key]); | ||
} | ||
} | ||
} | ||
setFlattenedQueryParams(searchParams, objects); | ||
url.search = searchParams.toString(); | ||
@@ -105,0 +111,0 @@ }; |
@@ -75,2 +75,20 @@ /* tslint:disable */ | ||
}; | ||
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { | ||
if (typeof parameter === "object") { | ||
if (Array.isArray(parameter)) { | ||
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); | ||
} | ||
else { | ||
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)); | ||
} | ||
} | ||
else { | ||
if (urlSearchParams.has(key)) { | ||
urlSearchParams.append(key, parameter); | ||
} | ||
else { | ||
urlSearchParams.set(key, parameter); | ||
} | ||
} | ||
} | ||
/** | ||
@@ -82,15 +100,3 @@ * | ||
const searchParams = new URLSearchParams(url.search); | ||
for (const object of objects) { | ||
for (const key in object) { | ||
if (Array.isArray(object[key])) { | ||
searchParams.delete(key); | ||
for (const item of object[key]) { | ||
searchParams.append(key, item); | ||
} | ||
} | ||
else { | ||
searchParams.set(key, object[key]); | ||
} | ||
} | ||
} | ||
setFlattenedQueryParams(searchParams, objects); | ||
url.search = searchParams.toString(); | ||
@@ -97,0 +103,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, refer to the Catalog Items API Use Case Guide.", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"main": "dist/cjs/index.js", | ||
@@ -30,3 +30,3 @@ "module": "dist/es/index.js", | ||
"dependencies": { | ||
"@sp-api-sdk/common": "^1.9.16", | ||
"@sp-api-sdk/common": "^1.9.17", | ||
"axios": "^0.27.2" | ||
@@ -56,3 +56,3 @@ }, | ||
}, | ||
"gitHead": "e5aa87a6384048c9f49b97db7d5d7aca34927853" | ||
"gitHead": "07823635b37c2e82b4b6ad962d8ef4b7318a011c" | ||
} |
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
186670
3654
+ Addedaxios@1.7.8(transitive)
- Removedaxios@1.7.7(transitive)
Updated@sp-api-sdk/common@^1.9.17