@dxos/echo
    Preparing search index...

    Variable instanceOfConst

    instanceOf: {
        <S extends AnyEntity>(
            schema: S,
        ): (value: unknown) => value is InstanceType<S>;
        <S extends AnyEntity>(schema: S, value: unknown): value is InstanceType<S>;
    } = ...

    Test if a value is an instance of a given object or relation type.

    Kind-agnostic counterpart to Obj.instanceOf / Relation.instanceOf — use this when the caller's input type is Type.AnyObj | Type.AnyRelation.

    Type declaration

    // Caller doesn't know whether `type` is object- or relation-kind.
    const matches = <T extends Type.AnyObj | Type.AnyRelation>(type: T, value: unknown) =>
    Entity.instanceOf(type, value);

    O(1) type-URI comparison with a typename fallback; no schema validation.