import { Maybe } from 'vest-utils'; import { TIsolate } from './Isolate'; import { IsolateKeys } from './IsolateKeys'; export function isIsolateType( node: Maybe, type: string, ): node is I { return node?.[IsolateKeys.Type] === type; } export function isSameIsolateType( a: A, b: B, ): boolean { return isIsolateType(a, b[IsolateKeys.Type]); } export function isSameIsolateIdentity( a: A, b: B, ): boolean { return Object.is(a, b) || (isSameIsolateType(a, b) && a.key === b.key); }