File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change 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" ;
11
3
12
4
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" ,
16
8
} ) ;
17
9
18
10
const stage3 = json . filter ( ( v ) => v . stage === 3 ) ;
11
+
19
12
return stage3 . map ( ( v ) => {
20
- v . authorsAndChampions = arrayEquals ( v . authors , v . champions )
13
+ v . authorsAndChampions = util . isDeepStrictEqual ( v . authors , v . champions )
21
14
? v . authors
22
15
: false ;
23
16
return v ;
You can’t perform that action at this time.
0 commit comments