Structure fixtures so they can be tested for exclusivity without extensive exclude declarations
This commit is contained in:
parent
882a91c54f
commit
266d23f7bb
2 changed files with 422 additions and 730 deletions
|
|
@ -209,10 +209,14 @@ function detect(value: unknown): TypeName {
|
||||||
}
|
}
|
||||||
|
|
||||||
const tagType = getObjectType(value);
|
const tagType = getObjectType(value);
|
||||||
if (tagType) {
|
if (tagType && tagType !== 'Object') {
|
||||||
return tagType;
|
return tagType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasPromiseApi(value)) {
|
||||||
|
return 'Promise';
|
||||||
|
}
|
||||||
|
|
||||||
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
||||||
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
||||||
}
|
}
|
||||||
|
|
@ -1120,7 +1124,7 @@ const methodTypeMap = {
|
||||||
isWhitespaceString: 'whitespace string',
|
isWhitespaceString: 'whitespace string',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
function keysOf<T extends Record<PropertyKey, unknown>>(value: T): Array<keyof T> {
|
export function keysOf<T extends Record<PropertyKey, unknown>>(value: T): Array<keyof T> {
|
||||||
return Object.keys(value) as Array<keyof T>;
|
return Object.keys(value) as Array<keyof T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1144
test/test.ts
1144
test/test.ts
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue