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>
15 lines
490 B
JavaScript
15 lines
490 B
JavaScript
const isObjectLike = (value) => typeof value === 'object' && value !== null;
|
|
export function isObject(input) {
|
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
|
|
return false;
|
|
}
|
|
if (Object.getPrototypeOf(input) === null) {
|
|
return true;
|
|
}
|
|
let proto = input;
|
|
while (Object.getPrototypeOf(proto) !== null) {
|
|
proto = Object.getPrototypeOf(proto);
|
|
}
|
|
return Object.getPrototypeOf(input) === proto;
|
|
}
|