22// we don't need to check it for stability references
33export const IGNORE_STABILITY_STEMS = [ 'documentation' ] ;
44
5- import globals from 'globals' ;
6-
75// These are string replacements specific to Node.js API docs for anchor IDs
86export const DOC_API_SLUGS_REPLACEMENTS = [
97 { from : / n o d e .j s / i, to : 'nodejs' } , // Replace Node.js
@@ -14,21 +12,6 @@ export const DOC_API_SLUGS_REPLACEMENTS = [
1412 { from : / ^ (? ! - + $ ) .* ?( - - + ) / g, to : '-' } , // Replace multiple hyphens
1513] ;
1614
17- // This is the base URL of the MDN Web documentation
18- export const DOC_MDN_BASE_URL = 'https://developer.mozilla.org/en-US/docs/Web/' ;
19-
20- // This is the base URL of the Man7 documentation
21- export const DOC_MAN_BASE_URL = 'http://man7.org/linux/man-pages/man' ;
22-
23- // This is the base URL for the MDN JavaScript documentation
24- export const DOC_MDN_BASE_URL_JS = `${ DOC_MDN_BASE_URL } JavaScript/` ;
25-
26- // This is the base URL for the MDN JavaScript primitives documentation
27- export const DOC_MDN_BASE_URL_JS_PRIMITIVES = `${ DOC_MDN_BASE_URL_JS } Data_structures` ;
28-
29- // This is the base URL for the MDN JavaScript global objects documentation
30- export const DOC_MDN_BASE_URL_JS_GLOBALS = `${ DOC_MDN_BASE_URL_JS } Reference/Global_Objects/` ;
31-
3215// These are regular expressions used to determine if a given Markdown heading
3316// is a specific type of API Doc entry (e.g., Event, Class, Method, etc)
3417// and to extract the inner content of said Heading to be used as the API doc entry name
@@ -76,60 +59,5 @@ export const DOC_API_HEADING_TYPES = [
7659// This regex is used to match basic TypeScript generic types (e.g., Promise<string>)
7760export const TYPE_GENERIC_REGEX = / ^ ( [ ^ < ] + ) < ( [ ^ > ] + ) > $ / ;
7861
79- // This is a mapping for types within the Markdown content and their respective
80- // JavaScript primitive types within the MDN JavaScript docs
81- // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#primitive_values
82- export const DOC_TYPES_MAPPING_PRIMITIVES = {
83- null : 'null' ,
84- undefined : 'undefined' ,
85- boolean : 'boolean' ,
86- number : 'number' ,
87- bigint : 'bigint' ,
88- string : 'string' ,
89- symbol : 'symbol' ,
90- integer : 'number' ,
91- } ;
92-
93- // This is a mapping for types within the Markdown content and their respective
94- // JavaScript globals types within the MDN JavaScript docs
95- // @see DOC_MDN_BASE_URL_JS_GLOBALS
96- export const DOC_TYPES_MAPPING_GLOBALS = {
97- // This is updated with every ES-spec, so, as long as the
98- // `globals` package is up-to-date, so will our globals list.
99- ...Object . fromEntries ( Object . keys ( globals . builtin ) . map ( e => [ e , e ] ) ) ,
100- AsyncGeneratorFunction : 'AsyncGeneratorFunction' ,
101- AsyncIterator : 'AsyncIterator' ,
102- AsyncFunction : 'AsyncFunction' ,
103- TypedArray : 'TypedArray' ,
104- ErrorEvent : 'ErrorEvent' ,
105- 'WebAssembly.Instance' : 'WebAssembly/Instance' ,
106- } ;
107-
108- // This is a mapping for miscellaneous types within the Markdown content and their respective
109- // external reference on appropriate 3rd-party vendors/documentation sites.
110- export const DOC_TYPES_MAPPING_OTHER = {
111- any : `${ DOC_MDN_BASE_URL_JS_PRIMITIVES } #Data_types` ,
112- this : `${ DOC_MDN_BASE_URL_JS } Reference/Operators/this` ,
113-
114- ArrayBufferView : `${ DOC_MDN_BASE_URL } /API/ArrayBufferView` ,
115-
116- AsyncIterable : 'https://tc39.github.io/ecma262/#sec-asynciterable-interface' ,
117-
118- 'Module Namespace Object' :
119- 'https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects' ,
120-
121- Iterable : `${ DOC_MDN_BASE_URL_JS } Reference/Iteration_protocols#The_iterable_protocol` ,
122-
123- CloseEvent : `${ DOC_MDN_BASE_URL } /API/CloseEvent` ,
124- EventSource : `${ DOC_MDN_BASE_URL } /API/EventSource` ,
125- MessageEvent : `${ DOC_MDN_BASE_URL } /API/MessageEvent` ,
126-
127- DOMException : `${ DOC_MDN_BASE_URL } /API/DOMException` ,
128- Storage : `${ DOC_MDN_BASE_URL } /API/Storage` ,
129- WebSocket : `${ DOC_MDN_BASE_URL } /API/WebSocket` ,
130-
131- FormData : `${ DOC_MDN_BASE_URL } API/FormData` ,
132- Headers : `${ DOC_MDN_BASE_URL } /API/Headers` ,
133- Response : `${ DOC_MDN_BASE_URL } /API/Response` ,
134- Request : `${ DOC_MDN_BASE_URL } /API/Request` ,
135- } ;
62+ // This is the base URL of the Man7 documentation
63+ export const DOC_MAN_BASE_URL = 'http://man7.org/linux/man-pages/man' ;
0 commit comments