Asserts that a value is a non-null, non-array object that can be treated as a string-keyed record.
Unlike isRecord, this function does not narrow the value to a generic indexable structure. Instead,
it preserves the existing static type of the variable. This makes it ideal for validating option objects or
interface-based inputs where all properties may be optional.
functionrun(opts: Options = {}) { assertPlainObject(opts, `'opts' is not a record object.`); // `opts` remains `Options`, not widened or reduced. opts.value; // Fully typed access remains available. }
Asserts that a value is a non-null, non-array object that can be treated as a string-keyed record.
Unlike isRecord, this function does not narrow the value to a generic indexable structure. Instead, it preserves the existing static type of the variable. This makes it ideal for validating option objects or interface-based inputs where all properties may be optional.
Use this function when: