Skip to content

Commit

Permalink
chore(check if compareKeys is function)
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Andreev committed Oct 24, 2021
1 parent c99f1e6 commit 2feb474
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/jest-diff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ For other applications, you can provide an options object as a third argument:
| `includeChangeCounts` | `false` |
| `omitAnnotationLines` | `false` |
| `patchColor` | `chalk.yellow` |

For more information about the options, see the following examples.

### Example of options for labels
Expand Down
2 changes: 1 addition & 1 deletion packages/pretty-format/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ const getConfig = (options?: OptionsReceived): Config => ({
? getColorsHighlight(options)
: getColorsEmpty(),
compareKeys:
options && options.compareKeys !== undefined
options && typeof options.compareKeys === 'function'
? options.compareKeys
: DEFAULT_OPTIONS.compareKeys,
escapeRegex: getEscapeRegex(options),
Expand Down

0 comments on commit 2feb474

Please sign in to comment.