Skip to content

Commit 003d776

Browse files
committed
Cleanup
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 77caefa commit 003d776

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

_data/stages.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
import EleventyFetch from "@11ty/eleventy-fetch";
2-
3-
function arrayEquals(a, b) {
4-
return (
5-
Array.isArray(a) &&
6-
Array.isArray(b) &&
7-
a.length === b.length &&
8-
a.every((val, index) => val === b[index])
9-
);
10-
}
1+
import * as util from "node:util";
2+
import eleventyFetch from "@11ty/eleventy-fetch";
113

124
export default async () => {
13-
const json = await EleventyFetch("https://tc39.es/dataset/proposals.json", {
14-
duration: "1h", // 1 day
15-
type: "json", // also supports "text" or "buffer"
5+
const json = await eleventyFetch("https://tc39.es/dataset/proposals.json", {
6+
duration: "1h",
7+
type: "json",
168
});
179

1810
const stage3 = json.filter((v) => v.stage === 3);
11+
1912
return stage3.map((v) => {
20-
v.authorsAndChampions = arrayEquals(v.authors, v.champions)
13+
v.authorsAndChampions = util.isDeepStrictEqual(v.authors, v.champions)
2114
? v.authors
2215
: false;
2316
return v;

0 commit comments

Comments
 (0)