Skip to content

Commit

Permalink
fix type error quick
Browse files Browse the repository at this point in the history
  • Loading branch information
roodboi committed Jan 21, 2024
1 parent 75d1ec2 commit 7f3c867
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions public-packages/schemaStream/tests/jsonParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, expect, test } from "bun:test"
import { lensPath, view } from "ramda"
import { z, ZodObject, ZodRawShape } from "zod"

const checkPathValue = (obj, path) => {
const checkPathValue = (obj: object, path: (string | number)[]) => {
const lens = lensPath(path)
const value = view(lens, obj)

Expand All @@ -12,11 +12,11 @@ const checkPathValue = (obj, path) => {
}

async function runTest<T extends ZodRawShape>(schema: ZodObject<T>, jsonData: object) {
let completed: (string | number | undefined)[][] = []
let completed: (string | number)[][] = []

const parser = new SchemaStream(schema, {
onKeyComplete({ completedPaths }) {
completed = completedPaths
completed = completedPaths as (string | number)[][]
}
})

Expand Down Expand Up @@ -77,7 +77,7 @@ describe("SchemaStream", () => {
const data = {}

const { result } = await runTest(schema, data)
console.log(result)

expect(result).toEqual({
someString: "default string",
someNumber: 420,
Expand Down

0 comments on commit 7f3c867

Please sign in to comment.