diff --git a/scripts/comparators/file-size.mjs b/scripts/comparators/file-size.mjs index 016de2fa..ba58bf06 100644 --- a/scripts/comparators/file-size.mjs +++ b/scripts/comparators/file-size.mjs @@ -1,7 +1,7 @@ import { stat, readdir } from 'node:fs/promises'; import path from 'node:path'; -import { BASE, HEAD, TITLE } from './constants.mjs'; +import { BASE, HEAD, TITLE } from '../constants.mjs'; const UNITS = ['B', 'KB', 'MB', 'GB']; diff --git a/scripts/comparators/object-assertion.mjs b/scripts/comparators/object-assertion.mjs index fe9e21c1..e2d7b4e3 100644 --- a/scripts/comparators/object-assertion.mjs +++ b/scripts/comparators/object-assertion.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert'; import { readdir, readFile } from 'node:fs/promises'; import { join } from 'node:path'; -import { BASE, HEAD, TITLE } from './constants.mjs'; +import { BASE, HEAD, TITLE } from '../constants.mjs'; const files = await readdir(BASE); diff --git a/src/generators/metadata/maps/builtin.json b/src/generators/metadata/maps/builtin.json index f7b48999..06fa4575 100644 --- a/src/generators/metadata/maps/builtin.json +++ b/src/generators/metadata/maps/builtin.json @@ -1,14 +1,14 @@ { "asynciterable": "https://tc39.github.io/ecma262/#sec-asynciterable-interface", "module namespace object": "https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects", - "null": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/null", - "undefined": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/undefined", - "boolean": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/boolean", - "number": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/number", - "bigint": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/bigint", - "string": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/string", - "symbol": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/symbol", - "integer": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/number", - "any": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures/#Data_types", - "this": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this" + "null": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type", + "undefined": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type", + "boolean": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type", + "number": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type", + "bigint": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type", + "string": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type", + "symbol": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#symbol_type", + "integer": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type", + "any": "https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types", + "this": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this" } diff --git a/src/generators/metadata/utils/__tests__/transformers.test.mjs b/src/generators/metadata/utils/__tests__/transformers.test.mjs index 86f0220d..79f25ac5 100644 --- a/src/generators/metadata/utils/__tests__/transformers.test.mjs +++ b/src/generators/metadata/utils/__tests__/transformers.test.mjs @@ -7,14 +7,14 @@ describe('transformTypeToReferenceLink', () => { it('should transform a JavaScript primitive type into a Markdown link', () => { strictEqual( transformTypeToReferenceLink('string'), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)' ); }); it('should transform a JavaScript global type into a Markdown link', () => { strictEqual( transformTypeToReferenceLink('Array'), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)' ); }); @@ -30,35 +30,35 @@ describe('transformTypeToReferenceLink', () => { it('should transform a basic Generic type into a Markdown link', () => { strictEqual( transformTypeToReferenceLink('{Promise}'), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)>' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)>' ); }); it('should partially transform a Generic type if only one part is known', () => { strictEqual( transformTypeToReferenceLink('{CustomType}', {}), - '``<[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type)>' + '``<[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type)>' ); }); it('should transform a Generic type with an inner union like {Promise}', () => { strictEqual( transformTypeToReferenceLink('{Promise}', {}), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) | [``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type)>' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type) | [``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type)>' ); }); it('should transform multi-parameter generics like {Map}', () => { strictEqual( transformTypeToReferenceLink('{Map}', {}), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)<[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type), [``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type)>' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type), [``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type)>' ); }); it('should handle outer unions with generics like {Promise | boolean}', () => { strictEqual( transformTypeToReferenceLink('{Promise | boolean}', {}), - '[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) | [``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type)> | [``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type)' + '[``](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type) | [``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type)> | [``](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type)' ); }); });