/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/manifest.ts
20 строк
583 B
Michael Naumov
chore: switch tabs to spaces
04 дек 2025, 22:01
04 дек 2025, 22:01
903401e
Код
Авторство
О чём код?
import fs from "node:fs"; import { PluginManifest } from "../types/manifest.js"; let cachedManifest: PluginManifest | null | undefined; export function getManifest(): PluginManifest | null { if (cachedManifest !== undefined) { return cachedManifest; } try { const data = fs.readFileSync("manifest.json", "utf8"); cachedManifest = JSON.parse(data); return cachedManifest as PluginManifest; } catch (err) { console.error("Failed to load JSON file:", err); cachedManifest = null; return cachedManifest; } }