Add gateway-first pattern: when AGILITON_API_KEY is set, route all external API calls through the gateway with X-API-Key auth. Falls back to direct API access when gateway is unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
570 B
JavaScript
22 lines
570 B
JavaScript
export function isDisjoint(...headers) {
|
|
const sources = headers.filter(Boolean);
|
|
if (sources.length === 0 || sources.length === 1) {
|
|
return true;
|
|
}
|
|
let acc;
|
|
for (const header of sources) {
|
|
const parameters = Object.keys(header);
|
|
if (!acc || acc.size === 0) {
|
|
acc = new Set(parameters);
|
|
continue;
|
|
}
|
|
for (const parameter of parameters) {
|
|
if (acc.has(parameter)) {
|
|
return false;
|
|
}
|
|
acc.add(parameter);
|
|
}
|
|
}
|
|
return true;
|
|
}
|