Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/shared/ReactIODescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

export function getIODescription(value: any): string {
export function getIODescription(value: mixed): string {
if (!__DEV__) {
return '';
}
Expand All @@ -34,11 +34,13 @@ export function getIODescription(value: any): string {
return value.command;
} else if (
typeof value.request === 'object' &&
value.request !== null &&
typeof value.request.url === 'string'
) {
return value.request.url;
} else if (
typeof value.response === 'object' &&
value.response !== null &&
typeof value.response.url === 'string'
) {
return value.response.url;
Expand All @@ -53,7 +55,11 @@ export function getIODescription(value: any): string {
return value.name;
} else {
const str = value.toString();
if (str.startWith('[object ') || str.length < 5 || str.length > 500) {
if (
str.startsWith('[object ') ||
str.length < 5 ||
str.length > 500
) {
// This is probably not a useful description.
return '';
}
Expand Down
Loading