refactor: dedupe web provider record helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:21:08 +01:00
parent 31d05bb3a4
commit b27a6f8196

View File

@@ -1,4 +1,5 @@
import path from "node:path";
import { isRecord } from "../utils.js";
import type { PluginLoadOptions } from "./loader.js";
import { loadPluginManifestRegistry } from "./manifest-registry.js";
import { loadBundledPluginPublicArtifactModuleSync } from "./public-surface-loader.js";
@@ -23,10 +24,6 @@ type BundledWebProviderPublicArtifactParams = {
onlyPluginIds?: readonly string[];
};
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isStringArray(value: unknown): value is string[] {
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
}