strong-mock
Version:
Type safe mocking library for TypeScript
18 lines (17 loc) • 629 B
TypeScript
import type { Property } from '../proxy';
import type { TypeMatcher } from './matcher';
type ObjectType = Record<Property, unknown>;
/**
* Matches any plain object e.g. object literals or objects created with `Object.create()`.
*
* Classes, arrays, maps, sets etc. are not considered plain objects.
* You can use {@link containsObject} or {@link matches} to match those.
*
* @example
* const fn = mock<({ foo: string }) => number>();
* when(() => fn(It.isPlainObject())).thenReturn(42);
*
* fn({ foo: 'bar' }) // returns 42
*/
export declare const isPlainObject: <T extends ObjectType>() => TypeMatcher<T>;
export {};