ConstThe value to check
true if u is a non-null, non-array object, false otherwise.
When true, TypeScript narrows the type to MutableRecord<string, unknown>.
const obj: unknown = { foo: 1 } as const;
if (isMutableRecord(obj)) {
obj['bar'] = 2; // Safe: obj is now known to be a mutable record
}
isRecord - For the underlying implementation and more details
Type guard that checks if a value is a mutable record.
This function has the same runtime behavior as isRecord (non-null, non-array object check), but narrows the type to
MutableRecord<string, unknown>, which is useful when you need to add or overwrite properties on the narrowed object.Type Narrowing Behavior:
unknowntoMutableRecord<string, unknown>null,undefined, primitives, functions, and arraystruefor every other non-null object (see isRecord for details on non-plain objects such asDate,Map, andSet)Implementation: This is a type alias for isRecord.