From 36aadfea6b201dd4bb13702b7655d7b024b8a061 Mon Sep 17 00:00:00 2001 From: Kodai Nakamura Date: Sat, 22 Feb 2025 20:38:37 +0900 Subject: [PATCH] refactor: reorganize replace-links module and add ignoreCase option --- src/main.ts | 2 +- src/replace-links/index.ts | 2 -- src/replace-links/replace-links.ts | 1 + src/replace-links/types.ts | 16 ---------------- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 src/replace-links/index.ts delete mode 100644 src/replace-links/types.ts diff --git a/src/main.ts b/src/main.ts index a85ab14..b99b034 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,7 +9,7 @@ import { PluginManifest, } from "obsidian"; import { PathAndAliases } from "./path-and-aliases.types"; -import { replaceLinks } from "./replace-links"; +import { replaceLinks } from "./replace-links/replace-links"; import { formatGitHubURL } from "./replace-urls/github"; import { formatJiraURL } from "./replace-urls/jira"; import { AutomaticLinkerPluginSettingsTab } from "./settings/settings"; diff --git a/src/replace-links/index.ts b/src/replace-links/index.ts deleted file mode 100644 index 06ffc6c..0000000 --- a/src/replace-links/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { replaceLinks } from "./replace-links"; -export type { ReplaceLinksOptions } from "./types"; diff --git a/src/replace-links/replace-links.ts b/src/replace-links/replace-links.ts index 0791db4..6664c0f 100644 --- a/src/replace-links/replace-links.ts +++ b/src/replace-links/replace-links.ts @@ -21,6 +21,7 @@ export const replaceLinks = ({ namespaceResolution?: boolean; baseDir?: string; ignoreDateFormats?: boolean; + ignoreCase?: boolean; }; }): string => { // Return the body unchanged if its length is below the minimum character count. diff --git a/src/replace-links/types.ts b/src/replace-links/types.ts deleted file mode 100644 index a41b9f5..0000000 --- a/src/replace-links/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { CandidateData, TrieNode } from "../trie"; - -export interface ReplaceLinksOptions { - body: string; - linkResolverContext: { - filePath: string; - trie: TrieNode; - candidateMap: Map; - }; - settings?: { - minCharCount?: number; - namespaceResolution?: boolean; - baseDir?: string; - ignoreDateFormats?: boolean; - }; -}