Use singe quotes consistently
This commit is contained in:
@@ -26,10 +26,10 @@ export async function loadNotesCache(): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
const json = await app.vault.adapter.read(notesCacheFilePath)
|
const json = await app.vault.adapter.read(notesCacheFilePath)
|
||||||
notesCache = JSON.parse(json)
|
notesCache = JSON.parse(json)
|
||||||
console.log("Notes cache loaded from the file")
|
console.log('Notes cache loaded from the file')
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
console.trace("Could not load Notes cache from the file")
|
console.trace('Could not load Notes cache from the file')
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ export function removeAnchors(name: string): string {
|
|||||||
export async function saveNotesCacheToFile(): Promise<void> {
|
export async function saveNotesCacheToFile(): Promise<void> {
|
||||||
const json = JSON.stringify(notesCache)
|
const json = JSON.stringify(notesCache)
|
||||||
await app.vault.adapter.write(notesCacheFilePath, json)
|
await app.vault.adapter.write(notesCacheFilePath, json)
|
||||||
console.log("Notes cache saved to the file")
|
console.log('Notes cache saved to the file')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isCacheOutdated(file: TFile): boolean {
|
export function isCacheOutdated(file: TFile): boolean {
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ export async function initGlobalSearchIndex(): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
const json = await app.vault.adapter.read(searchIndexFilePath)
|
const json = await app.vault.adapter.read(searchIndexFilePath)
|
||||||
minisearchInstance = MiniSearch.loadJSON(json, options)
|
minisearchInstance = MiniSearch.loadJSON(json, options)
|
||||||
console.log("MiniSearch index loaded from the file")
|
console.log('MiniSearch index loaded from the file')
|
||||||
await loadNotesCache()
|
await loadNotesCache()
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
console.trace("Could not load MiniSearch index from the file")
|
console.trace('Could not load MiniSearch index from the file')
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,7 +394,7 @@ async function saveIndexToFile(): Promise<void> {
|
|||||||
if (settings.storeIndexInFile && minisearchInstance && isIndexChanged) {
|
if (settings.storeIndexInFile && minisearchInstance && isIndexChanged) {
|
||||||
const json = JSON.stringify(minisearchInstance)
|
const json = JSON.stringify(minisearchInstance)
|
||||||
await app.vault.adapter.write(searchIndexFilePath, json)
|
await app.vault.adapter.write(searchIndexFilePath, json)
|
||||||
console.log("MiniSearch index saved to the file")
|
console.log('MiniSearch index saved to the file')
|
||||||
|
|
||||||
await saveNotesCacheToFile()
|
await saveNotesCacheToFile()
|
||||||
isIndexChanged = false
|
isIndexChanged = false
|
||||||
|
|||||||
Reference in New Issue
Block a user