@@ -2,7 +2,7 @@ import { expectTypeOf } from 'expect-type'
22import type { ComponentType } from 'react'
33import { describe , expect , test } from 'vitest'
44
5- import type { DataItemProps } from '../src'
5+ import type { DataItemProps , Path } from '../src'
66import { applyValue , createDataType , isCycleReference } from '../src'
77import { segmentArray } from '../src/utils'
88
@@ -95,17 +95,10 @@ describe('function createDataType', () => {
9595 }
9696 )
9797 expectTypeOf ( dataType ) . toEqualTypeOf < {
98- is :( value : unknown ) => value is string
98+ is :( value : unknown , path : Path ) => value is string
9999 Component : ComponentType < DataItemProps < string > >
100100 } > ( )
101- const someValue : unknown = null
102101 expectTypeOf ( dataType . is ) . returns . toBeBoolean ( )
103- if ( dataType . is ( someValue ) ) {
104- expectTypeOf ( someValue ) . toMatchTypeOf < string > ( )
105- } else {
106- expectTypeOf ( someValue ) . not . toMatchTypeOf < string > ( )
107- expectTypeOf ( someValue ) . toMatchTypeOf < unknown > ( )
108- }
109102 expect ( dataType . is ) . toBeTypeOf ( 'function' )
110103 expect ( dataType . Component ) . toBeTypeOf ( 'function' )
111104 } )
@@ -125,7 +118,7 @@ describe('function createDataType', () => {
125118 }
126119 )
127120 expectTypeOf ( dataType ) . toEqualTypeOf < {
128- is :( value : unknown ) => value is string
121+ is :( value : unknown , path : Path ) => value is string
129122 Component : ComponentType < DataItemProps < string > >
130123 Editor : ComponentType < DataItemProps < string > >
131124 } > ( )
@@ -155,7 +148,7 @@ describe('function createDataType', () => {
155148 }
156149 )
157150 expectTypeOf ( dataType ) . toEqualTypeOf < {
158- is :( value : unknown ) => value is string
151+ is :( value : unknown , path : Path ) => value is string
159152 Component : ComponentType < DataItemProps < string > >
160153 PreComponent : ComponentType < DataItemProps < string > >
161154 PostComponent : ComponentType < DataItemProps < string > >
@@ -191,7 +184,7 @@ describe('function createDataType', () => {
191184 }
192185 )
193186 expectTypeOf ( dataType ) . toEqualTypeOf < {
194- is :( value : unknown ) => value is string
187+ is :( value : unknown , path : Path ) => value is string
195188 Component : ComponentType < DataItemProps < string > >
196189 Editor : ComponentType < DataItemProps < string > >
197190 PreComponent : ComponentType < DataItemProps < string > >
0 commit comments