@sp-api-sdk/aplus-content-api-2020-11-01
Advanced tools
Comparing version 1.10.4 to 1.10.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": "With the A+ Content API, you can build applications that help selling partners add rich marketing content to their Amazon product detail pages. A+ content helps selling partners share their brand and product story, which helps buyers make informed purchasing decisions. Selling partners assemble content by choosing from content modules and adding images and text.", | ||
"version": "1.10.4", | ||
"version": "1.10.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
469658
8193
Updated@sp-api-sdk/common@^1.9.17