mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:00:43 +00:00
fix(plugins): satisfy registry lint
This commit is contained in:
@@ -36,7 +36,7 @@ export async function readJsonFile<T>(filePath: string): Promise<T | null> {
|
||||
}
|
||||
}
|
||||
|
||||
export function readJsonFileSync<T>(filePath: string): T | null {
|
||||
export function readJsonFileSync(filePath: string): unknown {
|
||||
try {
|
||||
const raw = readFileSync(filePath, "utf8");
|
||||
return JSON.parse(raw) as T;
|
||||
|
||||
@@ -130,7 +130,7 @@ export async function readPersistedInstalledPluginIndex(
|
||||
export function readPersistedInstalledPluginIndexSync(
|
||||
options: InstalledPluginIndexStoreOptions = {},
|
||||
): InstalledPluginIndex | null {
|
||||
const parsed = readJsonFileSync<unknown>(resolveInstalledPluginIndexStorePath(options));
|
||||
const parsed = readJsonFileSync(resolveInstalledPluginIndexStorePath(options));
|
||||
return parseInstalledPluginIndex(parsed);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,10 +200,11 @@ describe("plugin registry facade", () => {
|
||||
|
||||
it("normalizes plugin config ids through registry contribution aliases", () => {
|
||||
const index = createIndex("openai");
|
||||
const plugin = index.plugins[0];
|
||||
index.plugins[0] = {
|
||||
...index.plugins[0]!,
|
||||
...plugin,
|
||||
contributions: {
|
||||
...index.plugins[0]!.contributions,
|
||||
...plugin.contributions,
|
||||
providers: ["openai", "openai-codex"],
|
||||
channels: ["openai-chat"],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user