(u: unknown): u is StoreEffectsOf<StoreContractValue>True for a value branded as a effects object.
guardseffects
Source src/Store.ts:6362 lines
export const const isStoreEffects: (
u: unknown
) => u is StoreEffectsOf<StoreContractValue>
True for a value branded as a
effects
object.
isStoreEffects = (u: unknownu: unknown): u: unknownu is type StoreEffectsOf<
C extends StoreContractValue
> = any
The object of effects produced by
effects
: the
HandleOf
structure (nested shape tree +
custom methods) with
Storage
added to every method's requirement channel, carrying the
StoreEffectsVariance
brand.
StoreEffectsOf<import StoreContractValueStoreContractValue> =>
import PredicatePredicate.const hasProperty: <"hyperlink-ts/Store/StoreEffects">(self: unknown, property: "hyperlink-ts/Store/StoreEffects") => self is { [K in "hyperlink-ts/Store/StoreEffects"]: unknown; } (+1 overload)Checks whether a value has a given property key.
When to use
Use when you need a Predicate guard for property access on unknown
values with a simple structural object check.
Details
Uses the in operator and isObjectKeyword. This does not check property
value types.
Example (Guarding object properties)
import { Predicate } from "effect"
const hasName = Predicate.hasProperty("name")
const data: unknown = { name: "Ada" }
if (hasName(data)) {
console.log(data.name)
}
hasProperty(u: unknownu, const TypeId: TypeIdBrand identifier for an
effects
object — Effect's v4 TypeId shape (a string-literal id,
present at runtime).
TypeId);