Browse Source

updated types

Mish Ushakov 1 year ago
parent
commit
b2db6fe6d1
4 changed files with 4 additions and 4 deletions
  1. 1 1
      README.md
  2. 1 1
      examples/hn.ts
  3. 1 1
      package.json
  4. 1 1
      src/models.ts

+ 1 - 1
README.md

@@ -131,7 +131,7 @@ const { data } = await scraper.run(page, schema, {
 })
 
 // Show the result from LLM
-console.log(data?.top)
+console.log(data.top)
 
 await page.close()
 await browser.close()

+ 1 - 1
examples/hn.ts

@@ -37,7 +37,7 @@ const { data } = await scraper.run(page, schema, {
 })
 
 // Show the result from LLM
-console.log(data?.top)
+console.log(data.top)
 
 await page.close()
 await browser.close()

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "type": "module",
   "name": "llm-scraper",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "description": "Turn any webpage intro structured data using LLMs",
   "main": "dist/index.js",
   "scripts": {

+ 1 - 1
src/models.ts

@@ -12,7 +12,7 @@ import {
 import { zodToJsonSchema } from 'zod-to-json-schema'
 
 export type ScraperCompletionResult<T extends z.ZodSchema<any>> = {
-  data: z.infer<T> | null
+  data: z.infer<T>
   url: string
 }