-
Notifications
You must be signed in to change notification settings - Fork 59
/
index.js
43 lines (35 loc) · 1015 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {
getV2BrowserResponse,
getV3BrowserResponse,
} from "@aws-sdk/test-utils";
const getHTMLElement = (title, content) => {
const element = document.createElement("div");
element.style.margin = "30px";
const titleDiv = document.createElement("div");
titleDiv.innerHTML = title;
const contentDiv = document.createElement("textarea");
contentDiv.rows = 20;
contentDiv.cols = 50;
contentDiv.innerHTML = content;
element.appendChild(titleDiv);
element.appendChild(contentDiv);
return element;
};
const componentV2 = async () => {
const response = await getV2BrowserResponse();
return getHTMLElement(
"Data returned by v2:",
JSON.stringify(response, null, 2)
);
};
const componentV3 = async () => {
const response = await getV3BrowserResponse();
return getHTMLElement(
"Data returned by v3:",
JSON.stringify(response, null, 2)
);
};
(async () => {
document.body.appendChild(await componentV2());
document.body.appendChild(await componentV3());
})();