tools,doc: update JavaScript primitive types to match MDN Web Docs

- Update primitive types to lower case, so the anchor of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures will work correctly.
- Add `bigint` to primitive types to match MDN Web Doc.

PR-URL: https://github.com/nodejs/node/pull/60581
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
JustApple 2025-11-08 23:23:47 +08:00 committed by GitHub
parent 9f01ff2914
commit b15070b5ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,13 +3,14 @@ const jsDocPrefix = `${mdnPrefix}/JavaScript/`;
const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`;
const jsPrimitives = {
boolean: 'Boolean',
integer: 'Number', // Not a primitive, used for clarification.
null: 'Null',
number: 'Number',
string: 'String',
symbol: 'Symbol',
undefined: 'Undefined',
boolean: 'boolean',
integer: 'number', // Not a primitive, used for clarification.
null: 'null',
number: 'number',
string: 'string',
symbol: 'symbol',
undefined: 'undefined',
bigint: 'bigint',
};
const jsGlobalObjectsUrl = `${jsDocPrefix}Reference/Global_Objects/`;
@ -43,7 +44,6 @@ const customTypesMap = {
'AsyncGeneratorFunction': 'https://tc39.es/proposal-async-iteration/#sec-asyncgeneratorfunction-constructor',
'bigint': `${jsDocPrefix}Reference/Global_Objects/BigInt`,
'WebAssembly.Instance':
`${jsDocPrefix}Reference/Global_Objects/WebAssembly/Instance`,
'WebAssembly.Memory':