File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,7 +253,13 @@ export function isHookState(value: unknown): value is Hook {
253253 return false ;
254254 }
255255 const obj = value as Record < string , unknown > ;
256- return "memoizedState" in obj && "next" in obj && "queue" in obj ;
256+ return (
257+ "memoizedState" in obj &&
258+ "baseState" in obj &&
259+ "baseQueue" in obj &&
260+ "queue" in obj &&
261+ "next" in obj
262+ ) ;
257263}
258264
259265/**
@@ -264,7 +270,13 @@ export function isEffectState(value: unknown): value is Effect {
264270 return false ;
265271 }
266272 const obj = value as Record < string , unknown > ;
267- return "tag" in obj && "create" in obj && "deps" in obj ;
273+ return (
274+ "tag" in obj &&
275+ "create" in obj &&
276+ "destroy" in obj &&
277+ "deps" in obj &&
278+ "next" in obj
279+ ) ;
268280}
269281
270282/**
@@ -364,7 +376,18 @@ export function isUpdateQueue<S>(value: unknown): value is UpdateQueue<S> {
364376 return false ;
365377 }
366378 const obj = value as Record < string , unknown > ;
367- return "pending" in obj && "lanes" in obj && "dispatch" in obj ;
379+ return (
380+ "pending" in obj &&
381+ ( obj [ "pending" ] === null || typeof obj [ "pending" ] === "object" ) &&
382+ "lanes" in obj &&
383+ typeof obj [ "lanes" ] === "number" &&
384+ "dispatch" in obj &&
385+ ( obj [ "dispatch" ] === null || typeof obj [ "dispatch" ] === "function" ) &&
386+ "lastRenderedReducer" in obj &&
387+ ( obj [ "lastRenderedReducer" ] === null ||
388+ typeof obj [ "lastRenderedReducer" ] === "function" ) &&
389+ "lastRenderedState" in obj
390+ ) ;
368391}
369392
370393/**
You can’t perform that action at this time.
0 commit comments