diff --git a/src/main.ts b/src/main.ts index 41012bf..099502d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -72,7 +72,7 @@ export default class AutomaticLinkerPlugin extends Plugin { body: fileContent.slice(contentStart), linkResolverContext: { filePath: activeFile.path.replace(/\.md$/, ""), - trie: this.trie ?? buildCandidateTrie([]).trie, + trie: this.trie ?? buildCandidateTrie([], undefined).trie, candidateMap: this.candidateMap ?? new Map(), }, settings: { diff --git a/src/replace-links/index.ts b/src/replace-links/index.ts index 0740738..06ffc6c 100644 --- a/src/replace-links/index.ts +++ b/src/replace-links/index.ts @@ -1,2 +1,2 @@ -export { getEffectiveNamespace, replaceLinks } from "./replace-links"; +export { replaceLinks } from "./replace-links"; export type { ReplaceLinksOptions } from "./types"; diff --git a/src/trie.ts b/src/trie.ts index ba70753..59049e9 100644 --- a/src/trie.ts +++ b/src/trie.ts @@ -25,7 +25,10 @@ export interface TrieNode { * If the path starts with one of the baseDir (e.g. "pages/"), the directory immediately * under the baseDir is considered the effective namespace. */ -export const getEffectiveNamespace = (path: string, baseDir?: string): string => { +export const getEffectiveNamespace = ( + path: string, + baseDir?: string, +): string => { const prefix = baseDir + "/"; if (baseDir) { if (path.startsWith(prefix)) { @@ -67,7 +70,7 @@ export interface CandidateData { export const buildCandidateTrie = ( allFiles: PathAndAliases[], - baseDir?: string, + baseDir: string | undefined, ) => { // Process candidate strings from file paths. type Candidate = {