(u: unknown): u is TxReentrantLockChecks whether the given value is a TxReentrantLock.
Example (Checking for TxReentrantLock values)
import { TxReentrantLock } from "effect"
declare const someValue: unknown
if (TxReentrantLock.isTxReentrantLock(someValue)) {
console.log("This is a TxReentrantLock")
}guards
Source effect/TxReentrantLock.ts:6551 lines
export const const isTxReentrantLock: (
u: unknown
) => u is TxReentrantLock
Checks whether the given value is a TxReentrantLock.
Example (Checking for TxReentrantLock values)
import { TxReentrantLock } from "effect"
declare const someValue: unknown
if (TxReentrantLock.isTxReentrantLock(someValue)) {
console.log("This is a TxReentrantLock")
}
isTxReentrantLock = (u: unknownu: unknown): u: unknownu is TxReentrantLock => hasProperty<"~effect/transactions/TxReentrantLock">(self: unknown, property: "~effect/transactions/TxReentrantLock"): self is { [K in "~effect/transactions/TxReentrantLock"]: 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: "~effect/transactions/TxReentrantLock"TypeId)