Skip to content

Commit 84ee128

Browse files
authored
hotfix(mdn): type map URL fixes (#724)
* hotfix(mdn): type map URL fixes * fixup!
1 parent 0224d84 commit 84ee128

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

scripts/comparators/file-size.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { stat, readdir } from 'node:fs/promises';
22
import path from 'node:path';
33

4-
import { BASE, HEAD, TITLE } from './constants.mjs';
4+
import { BASE, HEAD, TITLE } from '../constants.mjs';
55

66
const UNITS = ['B', 'KB', 'MB', 'GB'];
77

scripts/comparators/object-assertion.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'node:assert';
22
import { readdir, readFile } from 'node:fs/promises';
33
import { join } from 'node:path';
44

5-
import { BASE, HEAD, TITLE } from './constants.mjs';
5+
import { BASE, HEAD, TITLE } from '../constants.mjs';
66

77
const files = await readdir(BASE);
88

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"asynciterable": "https://tc39.github.io/ecma262/#sec-asynciterable-interface",
33
"module namespace object": "https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects",
4-
"null": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/null",
5-
"undefined": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/undefined",
6-
"boolean": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/boolean",
7-
"number": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/number",
8-
"bigint": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/bigint",
9-
"string": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/string",
10-
"symbol": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/symbol",
11-
"integer": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/number",
12-
"any": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/#Data_types",
13-
"this": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this"
4+
"null": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type",
5+
"undefined": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type",
6+
"boolean": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type",
7+
"number": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type",
8+
"bigint": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type",
9+
"string": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type",
10+
"symbol": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#symbol_type",
11+
"integer": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type",
12+
"any": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types",
13+
"this": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this"
1414
}

src/generators/metadata/utils/__tests__/transformers.test.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ describe('transformTypeToReferenceLink', () => {
77
it('should transform a JavaScript primitive type into a Markdown link', () => {
88
strictEqual(
99
transformTypeToReferenceLink('string'),
10-
'[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)'
10+
'[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)'
1111
);
1212
});
1313

1414
it('should transform a JavaScript global type into a Markdown link', () => {
1515
strictEqual(
1616
transformTypeToReferenceLink('Array'),
17-
'[`<Array>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)'
17+
'[`<Array>`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)'
1818
);
1919
});
2020

@@ -30,35 +30,35 @@ describe('transformTypeToReferenceLink', () => {
3030
it('should transform a basic Generic type into a Markdown link', () => {
3131
strictEqual(
3232
transformTypeToReferenceLink('{Promise<string>}'),
33-
'[`<Promise>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)&gt;'
33+
'[`<Promise>`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)&gt;'
3434
);
3535
});
3636

3737
it('should partially transform a Generic type if only one part is known', () => {
3838
strictEqual(
3939
transformTypeToReferenceLink('{CustomType<string>}', {}),
40-
'`<CustomType>`&lt;[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)&gt;'
40+
'`<CustomType>`&lt;[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)&gt;'
4141
);
4242
});
4343

4444
it('should transform a Generic type with an inner union like {Promise<string|boolean>}', () => {
4545
strictEqual(
4646
transformTypeToReferenceLink('{Promise<string|boolean>}', {}),
47-
'[`<Promise>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) | [`<boolean>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type)&gt;'
47+
'[`<Promise>`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type) | [`<boolean>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type)&gt;'
4848
);
4949
});
5050

5151
it('should transform multi-parameter generics like {Map<string, number>}', () => {
5252
strictEqual(
5353
transformTypeToReferenceLink('{Map<string, number>}', {}),
54-
'[`<Map>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)&lt;[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type), [`<number>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type)&gt;'
54+
'[`<Map>`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)&lt;[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type), [`<number>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type)&gt;'
5555
);
5656
});
5757

5858
it('should handle outer unions with generics like {Promise<string|number> | boolean}', () => {
5959
strictEqual(
6060
transformTypeToReferenceLink('{Promise<string|number> | boolean}', {}),
61-
'[`<Promise>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) | [`<number>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type)&gt; | [`<boolean>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type)'
61+
'[`<Promise>`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[`<string>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type) | [`<number>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type)&gt; | [`<boolean>`](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type)'
6262
);
6363
});
6464
});

0 commit comments

Comments
 (0)