File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010import { publicGenerators } from '../../src/generators/index.mjs' ;
1111import createGenerator from '../../src/generators.mjs' ;
1212import { parseChangelog , parseIndex } from '../../src/parsers/markdown.mjs' ;
13+ import { DEFAULT_TYPE_MAP } from '../../src/utils/parser/constants.mjs' ;
1314import { loadFromURL } from '../../src/utils/parser.mjs' ;
1415import { loadAndParse } from '../utils.mjs' ;
1516
@@ -120,9 +121,7 @@ export default {
120121 prompt : {
121122 message : 'Path to doc/api/type_map.json' ,
122123 type : 'text' ,
123- initialValue : import . meta. resolve (
124- '../../src/utils/parser/typeMap.json'
125- ) ,
124+ initialValue : DEFAULT_TYPE_MAP ,
126125 } ,
127126 } ,
128127 } ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export const loadFromURL = async url => {
1212
1313 if ( ! parsedUrl || parsedUrl . protocol === 'file:' ) {
1414 // Load from file system
15- return readFile ( parsedUrl || url , 'utf-8' ) ;
15+ return readFile ( parsedUrl ?? url , 'utf-8' ) ;
1616 } else {
1717 // Load from network
1818 const response = await fetch ( parsedUrl ) ;
Original file line number Diff line number Diff line change 11import globals from 'globals' ;
22
3+ // The default type map path
4+ export const DEFAULT_TYPE_MAP = import . meta. resolve ( './typeMap.json' ) ;
5+
36// These are string replacements specific to Node.js API docs for anchor IDs
47export const DOC_API_SLUGS_REPLACEMENTS = [
58 { from : / n o d e .j s / i, to : 'nodejs' } , // Replace Node.js
You can’t perform that action at this time.
0 commit comments