in packages/jest-mock/src/index.ts [409:444]
function getType(ref?: unknown): MockFunctionMetadataType | null {
const typeName = getObjectType(ref);
if (
typeName === 'Function' ||
typeName === 'AsyncFunction' ||
typeName === 'GeneratorFunction' ||
typeName === 'AsyncGeneratorFunction'
) {
return 'function';
} else if (Array.isArray(ref)) {
return 'array';
} else if (typeName === 'Object') {
return 'object';
} else if (
typeName === 'Number' ||
typeName === 'String' ||
typeName === 'Boolean' ||
typeName === 'Symbol'
) {
return 'constant';
} else if (
typeName === 'Map' ||
typeName === 'WeakMap' ||
typeName === 'Set'
) {
return 'collection';
} else if (typeName === 'RegExp') {
return 'regexp';
} else if (ref === undefined) {
return 'undefined';
} else if (ref === null) {
return 'null';
} else {
return null;
}
}