ConstThe value to check
true if u is a mutable record (plain object with string keys), false otherwise.
When true, TypeScript narrows the type to MutableRecord<string, unknown>.
const obj: unknown = { foo: 1 };
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 (an object with mutable string keys).
This function is an alias for isRecord, but narrows the type to
MutableRecord<string, unknown>, which is useful when you need to ensure that the object can be safely mutated (i.e., its properties can be added or changed).Type Narrowing Behavior:
unknowntoMutableRecord<string, unknown>null,undefined, primitives, arrays, and functionstruefor plain objects with mutable string keysfalsefor arrays and other non-record typesImplementation: This is a type alias for isRecord.