Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 16, 2022
1 parent 743531b commit 3c1ad4b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bench/fetch/bun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bench(`fetch(https://example.com) x ${count}`, async () => {

for (let i = 0; i < requests.length; i++) {
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
r.text()
r.text(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion bench/fetch/deno.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bench(`fetch(https://example.com) x ${count}`, async () => {

for (let i = 0; i < requests.length; i++) {
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
r.text()
r.text(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion bench/ffi/deno.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
const path = new URL(
"src/target/release/libffi_napi_bench." + extension,
import.meta.url
import.meta.url,
).pathname;

const {
Expand Down
4 changes: 2 additions & 2 deletions bench/hot-module-reloading/css-stress-test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (process.env.PROJECT === "bun") {
},

shell: false,
}
},
);
}

Expand Down Expand Up @@ -114,5 +114,5 @@ async function main() {
main().catch((error) =>
setTimeout(() => {
throw error;
})
}),
);
8 changes: 4 additions & 4 deletions bench/hot-module-reloading/css-stress-test/read-frames.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ fs.writeFileSync(
`${process.platform}-${
process.arch === "arm64" ? "aarch64" : process.arch
}` +
".json"
".json",
),
JSON.stringify(report, null, 2)
JSON.stringify(report, null, 2),
);

console.log(
Expand Down Expand Up @@ -101,7 +101,7 @@ console.log(
TOTAL_FRAMES,
"(" +
Math.round(
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100,
) +
"%)"
"%)",
);
4 changes: 2 additions & 2 deletions bench/json-stringify/bun.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { bench, run } from "mitata";

bench("JSON.stringify({hello: 'world'})", () =>
JSON.stringify({ hello: "world" })
JSON.stringify({ hello: "world" }),
);

const otherUint8Array = new Uint8Array(1024);
bench("Uint8Array.from(otherUint8Array)", () =>
Uint8Array.from(otherUint8Array)
Uint8Array.from(otherUint8Array),
);

run();
4 changes: 3 additions & 1 deletion bench/log/bun.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { bench, run } from "mitata";

bench("console.log('hello')", () => console.log("hello"));
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
bench("console.log({ hello: 'object' })", () =>
console.log({ hello: "object" }),
);
await run();
16 changes: 8 additions & 8 deletions bench/module-loader/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const hello${i} = "hello${i}";
${saveStack ? `globalThis.evaluationOrder.push("${file}");` : ""}
globalThis.counter++;
`,
"utf8"
"utf8",
);
var file2 = output + "/file" + i + ".js";

Expand All @@ -39,7 +39,7 @@ module.exports.hello${i} = "hello${i}";
${saveStack ? `globalThis.evaluationOrder.push("${file2}");` : ""}
globalThis.counter++;
`,
"utf8"
"utf8",
);
}

Expand All @@ -53,7 +53,7 @@ fs.writeFileSync(
: ""
}
`,
"utf8"
"utf8",
);

fs.writeFileSync(
Expand All @@ -66,7 +66,7 @@ fs.writeFileSync(
: ""
}
`,
"utf8"
"utf8",
);

fs.writeFileSync(
Expand All @@ -79,7 +79,7 @@ fs.writeFileSync(
console.timeEnd("import");
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
"utf8"
"utf8",
);

fs.writeFileSync(
Expand All @@ -92,7 +92,7 @@ export const THE_END = Foo.THE_END;
console.timeEnd("import.meta.require");
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
"utf8"
"utf8",
);

fs.writeFileSync(
Expand All @@ -106,7 +106,7 @@ fs.writeFileSync(
console.timeEnd("import.meta.require");
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
"utf8"
"utf8",
);

fs.writeFileSync(
Expand All @@ -120,7 +120,7 @@ fs.writeFileSync(
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');
`,
"utf8"
"utf8",
);

console.log(`
Expand Down

0 comments on commit 3c1ad4b

Please sign in to comment.