Types
Identity functions that help with narrowing.
Functions
isObject()
function isObject(variable): variable is Record<string, unknown>
Helper function to narrow an unknown value to an object (i.e. a TypeScript record).
Under the hood, this checks for typeof variable === "object"
, variable !== null
, and
!Array.isArray(variable)
.
Parameters
Parameter | Type |
---|---|
variable | unknown |
Returns
variable is Record<string, unknown>