mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 16:30:27 +00:00
22 lines
No EOL
566 B
TypeScript
22 lines
No EOL
566 B
TypeScript
import { type Vault } from "obsidian";
|
|
|
|
export function isValidJson(str: string): boolean {
|
|
try {
|
|
JSON.parse(str);
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
export function loadExternalCSS(href: string): Promise<void> {
|
|
return new Promise((resolve, reject) => {
|
|
const link = document.createElement('link');
|
|
link.rel = 'stylesheet';
|
|
link.type = 'text/css';
|
|
link.href = href;
|
|
link.onload = () => resolve();
|
|
link.onerror = reject;
|
|
document.head.appendChild(link);
|
|
});
|
|
} |