Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
skyrpex committed Mar 12, 2024
1 parent 10897ee commit 5e94ee8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,20 @@ export const AWS: SDK = new Proxy({} as any, {
return async (input: any) => {
const url = new URL(endpoint);
const { searchParams } = url;
for (const [k, v] of Object.entries(input)) {
if (k !== "PublishBatchRequestEntries") {
searchParams.set(k, v as any);
} else {
for (const [i, entry] of (v as any[]).entries()) {
for (const [k, v] of Object.entries(entry)) {
for (const [key, value] of Object.entries(input)) {
if (Array.isArray(value)) {
for (const [i, entry] of value.entries()) {
for (const [memberKey, memberValue] of Object.entries(
entry,
)) {
searchParams.set(
`PublishBatchRequestEntries.member.${i + 1}.${k}`,
v as any,
`${key}.member.${i + 1}.${memberKey}`,
memberValue as any,
);
}
}
} else {
searchParams.set(key, value as any);
}
}
searchParams.set("Action", resolveAction(methodName));
Expand Down

0 comments on commit 5e94ee8

Please sign in to comment.