File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ 1.0.1 (????-??-??)
5+ ------------------
6+
7+ * Fix weird Typescript / Node disagreement on whether JSON import assertions
8+ are required or forbidden
9+
10+
4111.0.0 (2024-01-15)
512------------------
613
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import { Link } from 'ketting' ;
33import { PageProps } from '../types.js' ;
4-
5- // List of links from the IANA website, auto generated
6- import ianaLinks from '../data/iana-links.json' ;
7- // List of links from this project, overrides some IANA links with better
8- // descriptions
9- import editorLinks from '../data/editor-links.json' ;
10- //List of links from the Level 3 REST (https://level3.rest) specification.
11- import level3RestLinks from '../data/level3-rest-links.json' ;
4+ import { readFileSync } from 'node:fs' ;
125
136type LinkDescriptions = Record < string , { href : string ; description : string } > ;
147
8+ function loadLinkData ( fileName : string ) {
9+ return JSON . parse (
10+ readFileSync ( new URL ( import . meta. url + '/..' ) . pathname + '/../data/' + fileName + '.json' , 'utf-8' )
11+ ) ;
12+ }
13+
1514const linkDescriptions : LinkDescriptions = {
16- ...ianaLinks ,
17- ...editorLinks ,
18- ...level3RestLinks
15+ ...loadLinkData ( 'iana-links' ) ,
16+ ...loadLinkData ( 'editor-links' ) ,
17+ ...loadLinkData ( 'level3-rest-links' )
1918} ;
2019
2120export function LinksTable ( props : PageProps ) {
You can’t perform that action at this time.
0 commit comments