Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

refactor(core): reuse isPlainObject from FileToolModifier.utils.neutral

jkomynodcb60bde575f
diff --git a/ts/packages/core/src/utils/jsonSchema.ts b/ts/packages/core/src/utils/jsonSchema.ts
index 9d5bcbc45..0f4b92f5e 100644
--- a/ts/packages/core/src/utils/jsonSchema.ts
+++ b/ts/packages/core/src/utils/jsonSchema.ts
@@ -1,6 +1,7 @@
import { z } from 'zod/v3';
import { JsonSchemaRefResolutionError, JsonSchemaToZodError } from '../errors';
import { jsonSchemaToZod } from '@composio/json-schema-to-zod';
+import { isPlainObject } from './modifiers/FileToolModifier.utils.neutral';
const MAX_REF_CHAIN_DEPTH = 100;
const MAX_NODE_DEPTH = 512;
@@ -41,9 +42,6 @@ const resolvePointer = (root: Record<string, unknown>, pointer: string): unknown
.reduce<unknown>((cursor, seg) => stepInto(cursor, seg, pointer), root);
};
-const isPlainObject = (value: unknown): value is Record<string, unknown> =>
- value !== null && typeof value === 'object' && !Array.isArray(value);
-
/**
* Inlines internal JSON Schema `$ref` pointers (`#/$defs/...` and the
* legacy `#/definitions/...`) so the returned schema can be safely handed