Skip to content

Commit adb950c

Browse files
aduh95RafaelGSS
authored andcommitted
tools,doc: move more MDN links to types
PR-URL: #58930 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Claudio Wunder <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
1 parent 8eecaa2 commit adb950c

File tree

5 files changed

+24
-29
lines changed

5 files changed

+24
-29
lines changed

doc/api/buffer.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ changes:
464464
description: No longer experimental.
465465
-->
466466

467-
A [`Blob`][] encapsulates immutable, raw data that can be safely shared across
467+
A {Blob} encapsulates immutable, raw data that can be safely shared across
468468
multiple worker threads.
469469

470470
### `new buffer.Blob([sources[, options]])`
@@ -5526,7 +5526,6 @@ introducing security vulnerabilities into an application.
55265526
[UTF-16]: https://en.wikipedia.org/wiki/UTF-16
55275527
[UTF-8]: https://en.wikipedia.org/wiki/UTF-8
55285528
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
5529-
[`Blob`]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
55305529
[`Buffer.alloc()`]: #static-method-bufferallocsize-fill-encoding
55315530
[`Buffer.allocUnsafe()`]: #static-method-bufferallocunsafesize
55325531
[`Buffer.allocUnsafeSlow()`]: #static-method-bufferallocunsafeslowsize

doc/api/cli.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ For more information, see the [TypeScript type-stripping][] documentation.
18161816
added: v22.0.0
18171817
-->
18181818

1819-
Disable exposition of [`WebSocket`][] on the global scope.
1819+
Disable exposition of {WebSocket} on the global scope.
18201820

18211821
### `--no-extra-info-on-fatal-exception`
18221822

@@ -3948,7 +3948,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
39483948
[`NO_COLOR`]: https://no-color.org
39493949
[`SlowBuffer`]: buffer.md#class-slowbuffer
39503950
[`Web Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
3951-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
39523951
[`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328
39533952
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
39543953
[`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder

doc/api/globals.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ changes:
3636
<!-- type=global -->
3737

3838
A utility class used to signal cancelation in selected `Promise`-based APIs.
39-
The API is based on the Web API [`AbortController`][].
39+
The API is based on the Web API {AbortController}.
4040

4141
```js
4242
const ac = new AbortController();
@@ -350,9 +350,7 @@ added: v23.0.0
350350
351351
<!-- type=global -->
352352

353-
The `CloseEvent` class. See [`CloseEvent`][] for more details.
354-
355-
A browser-compatible implementation of [`CloseEvent`][]. Disable this API
353+
A browser-compatible implementation of {CloseEvent}. Disable this API
356354
with the [`--no-experimental-websocket`][] CLI flag.
357355

358356
## Class: `CompressionStream`
@@ -482,7 +480,7 @@ changes:
482480
483481
<!-- type=global -->
484482

485-
A browser-compatible implementation of the [`CustomEvent` Web API][].
483+
A browser-compatible implementation of {CustomEvent}.
486484

487485
## Class: `DecompressionStream`
488486

@@ -526,7 +524,7 @@ added:
526524
> Stability: 1 - Experimental. Enable this API with the [`--experimental-eventsource`][]
527525
> CLI flag.
528526
529-
A browser-compatible implementation of the [`EventSource`][] class.
527+
A browser-compatible implementation of {EventSource}.
530528

531529
## `EventTarget`
532530

@@ -718,7 +716,7 @@ added: v15.0.0
718716
719717
<!-- type=global -->
720718

721-
The `MessageEvent` class. See [`MessageEvent`][] for more details.
719+
A browser-compatible implementation of {MessageEvent}.
722720

723721
## `MessagePort`
724722

@@ -1166,10 +1164,10 @@ added: v0.0.1
11661164
added: v22.4.0
11671165
-->
11681166

1169-
> Stability: 1.0 - Early development.
1167+
> Stability: 1.0 - Early development. Enable this API with the
1168+
> [`--experimental-webstorage`][] CLI flag.
11701169
1171-
A browser-compatible implementation of [`Storage`][]. Enable this API with the
1172-
[`--experimental-webstorage`][] CLI flag.
1170+
A browser-compatible implementation of {Storage}.
11731171

11741172
## `structuredClone(value[, options])`
11751173

@@ -1211,7 +1209,7 @@ added: v17.0.0
12111209
12121210
<!-- type=global -->
12131211

1214-
The WHATWG `DOMException` class. See [`DOMException`][] for more details.
1212+
The WHATWG {DOMException} class.
12151213

12161214
## `TextDecoder`
12171215

@@ -1362,7 +1360,7 @@ changes:
13621360

13631361
> Stability: 2 - Stable
13641362
1365-
A browser-compatible implementation of [`WebSocket`][]. Disable this API
1363+
A browser-compatible implementation of {WebSocket}. Disable this API
13661364
with the [`--no-experimental-websocket`][] CLI flag.
13671365

13681366
## Class: `WritableStream`
@@ -1418,18 +1416,12 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
14181416
[`--localstorage-file`]: cli.md#--localstorage-filefile
14191417
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
14201418
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
1421-
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
14221419
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
1423-
[`CloseEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/CloseEvent
14241420
[`CompressionStream`]: webstreams.md#class-compressionstream
14251421
[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy
1426-
[`CustomEvent` Web API]: https://dom.spec.whatwg.org/#customevent
1427-
[`DOMException`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException
14281422
[`DecompressionStream`]: webstreams.md#class-decompressionstream
1429-
[`EventSource`]: https://developer.mozilla.org/en-US/docs/Web/API/EventSource
14301423
[`EventTarget` and `Event` API]: events.md#eventtarget-and-event-api
14311424
[`MessageChannel`]: worker_threads.md#class-messagechannel
1432-
[`MessageEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent
14331425
[`MessagePort`]: worker_threads.md#class-messageport
14341426
[`PerformanceEntry`]: perf_hooks.md#class-performanceentry
14351427
[`PerformanceMark`]: perf_hooks.md#class-performancemark
@@ -1443,7 +1435,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
14431435
[`ReadableStreamDefaultController`]: webstreams.md#class-readablestreamdefaultcontroller
14441436
[`ReadableStreamDefaultReader`]: webstreams.md#class-readablestreamdefaultreader
14451437
[`ReadableStream`]: webstreams.md#class-readablestream
1446-
[`Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
14471438
[`TextDecoderStream`]: webstreams.md#class-textdecoderstream
14481439
[`TextDecoder`]: util.md#class-utiltextdecoder
14491440
[`TextEncoderStream`]: webstreams.md#class-textencoderstream
@@ -1453,7 +1444,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
14531444
[`URLPattern`]: url.md#class-urlpattern
14541445
[`URLSearchParams`]: url.md#class-urlsearchparams
14551446
[`URL`]: url.md#class-url
1456-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
14571447
[`WritableStreamDefaultController`]: webstreams.md#class-writablestreamdefaultcontroller
14581448
[`WritableStreamDefaultWriter`]: webstreams.md#class-writablestreamdefaultwriter
14591449
[`WritableStream`]: webstreams.md#class-writablestream

doc/api/http.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4241,7 +4241,7 @@ added:
42414241
- v22.5.0
42424242
-->
42434243
4244-
A browser-compatible implementation of [`WebSocket`][].
4244+
A browser-compatible implementation of {WebSocket}.
42454245
42464246
[RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt
42474247
[`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
@@ -4259,7 +4259,6 @@ A browser-compatible implementation of [`WebSocket`][].
42594259
[`Headers`]: globals.md#class-headers
42604260
[`TypeError`]: errors.md#class-typeerror
42614261
[`URL`]: url.md#the-whatwg-url-api
4262-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
42634262
[`agent.createConnection()`]: #agentcreateconnectionoptions-callback
42644263
[`agent.getName()`]: #agentgetnameoptions
42654264
[`destroy()`]: #agentdestroy

tools/doc/type-parser.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/';
1+
const mdnPrefix = 'https://developer.mozilla.org/en-US/docs/Web';
2+
const jsDocPrefix = `${mdnPrefix}/JavaScript/`;
23

34
const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`;
45
const jsPrimitives = {
@@ -32,8 +33,7 @@ const customTypesMap = {
3233
'AbortController': 'globals.html#class-abortcontroller',
3334
'AbortSignal': 'globals.html#class-abortsignal',
3435

35-
'ArrayBufferView':
36-
'https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView',
36+
'ArrayBufferView': `${mdnPrefix}/API/ArrayBufferView`,
3737

3838
'AsyncIterator': 'https://tc39.github.io/ecma262/#sec-asynciterator-interface',
3939

@@ -137,6 +137,14 @@ const customTypesMap = {
137137
'CustomEvent': 'events.html#class-customevent',
138138
'EventListener': 'events.html#event-listener',
139139

140+
'CloseEvent': `${mdnPrefix}/API/CloseEvent`,
141+
'EventSource': `${mdnPrefix}/API/EventSource`,
142+
'MessageEvent': `${mdnPrefix}/API/MessageEvent`,
143+
144+
'DOMException': `${mdnPrefix}/API/DOMException`,
145+
'Storage': `${mdnPrefix}/API/Storage`,
146+
'WebSocket': `${mdnPrefix}/API/WebSocket`,
147+
140148
'FileHandle': 'fs.html#class-filehandle',
141149
'fs.Dir': 'fs.html#class-fsdir',
142150
'fs.Dirent': 'fs.html#class-fsdirent',

0 commit comments

Comments
 (0)