-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Vaughn
committed
Jan 27, 2022
1 parent
664d65b
commit 1571c58
Showing
6 changed files
with
4,521 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/react-devtools-shared/src/__tests__/__serializers__/profilingSerializer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import hasOwnProperty from 'shared/hasOwnProperty'; | ||
|
||
const FILTERED_VERSION_STRING = '<filtered-version>'; | ||
|
||
// test() is part of Jest's serializer API | ||
export function test(maybeProfile) { | ||
if ( | ||
maybeProfile != null && | ||
typeof maybeProfile === 'object' && | ||
hasOwnProperty.call(maybeProfile, 'reactVersion') && | ||
maybeProfile.reactVersion !== FILTERED_VERSION_STRING | ||
) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
// print() is part of Jest's serializer API | ||
export function print(profile, serialize, indent) { | ||
return serialize({ | ||
...profile, | ||
reactVersion: FILTERED_VERSION_STRING, | ||
}); | ||
} |
Oops, something went wrong.