droboticflow-new/scripts/lib/source-data-source.mjs
2026-06-16 20:06:00 +08:00

15 lines
415 B
JavaScript

export function inferSourceDataSource(sourcePath, override = "") {
const explicit = String(override || "").trim().toUpperCase();
if (explicit === "FILESYSTEM") {
return "LOCAL";
}
if (explicit) {
return explicit;
}
const normalizedPath = String(sourcePath || "").trim().toLowerCase();
if (!normalizedPath) {
return "";
}
return normalizedPath.startsWith("bos://") ? "BOS" : "LOCAL";
}