Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(js-sdk/extract): fix zod type check with zod version discrepancy
Gergő Móricz0154e40685b0
diff --git a/apps/js-sdk/firecrawl/package.json b/apps/js-sdk/firecrawl/package.jsonindex 3fc252a07..32fa0b41b 100644--- a/apps/js-sdk/firecrawl/package.json+++ b/apps/js-sdk/firecrawl/package.json@@ -1,6 +1,6 @@{"name": "@mendable/firecrawl-js",- "version": "1.19.0",+ "version": "1.19.1","description": "JavaScript SDK for Firecrawl API","main": "dist/index.js","types": "dist/index.d.ts",diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.tsindex 006e37370..99e008d3f 100644--- a/apps/js-sdk/firecrawl/src/index.ts+++ b/apps/js-sdk/firecrawl/src/index.ts@@ -1130,15 +1130,14 @@ export default class FirecrawlApp {try {if (!params?.schema) {jsonSchema = undefined;- } else if (params.schema instanceof zt.ZodType) {- jsonSchema = zodToJsonSchema(params.schema);+ } else if (typeof params.schema === "object" && params.schema !== null && Object.getPrototypeOf(params.schema)?.constructor?.name?.startsWith("Zod")) {+ jsonSchema = zodToJsonSchema(params.schema as zt.ZodType);} else {jsonSchema = params.schema;}} catch (error: any) {throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);}-try {const response: AxiosResponse = await this.postRequest(