| | |
| | | commonColor: _chalk.default.dim, |
| | | commonIndicator: ' ', |
| | | commonLineTrailingSpaceColor: noColor, |
| | | compareKeys: undefined, |
| | | contextLines: DIFF_CONTEXT_DEFAULT, |
| | | emptyFirstOrLastLinePlaceholder: '', |
| | | expand: true, |
| | |
| | | omitAnnotationLines: false, |
| | | patchColor: _chalk.default.yellow |
| | | }; |
| | | |
| | | const getCompareKeys = compareKeys => |
| | | compareKeys && typeof compareKeys === 'function' |
| | | ? compareKeys |
| | | : OPTIONS_DEFAULT.compareKeys; |
| | | |
| | | const getContextLines = contextLines => |
| | | typeof contextLines === 'number' && |
| | |
| | | const normalizeDiffOptions = (options = {}) => ({ |
| | | ...OPTIONS_DEFAULT, |
| | | ...options, |
| | | compareKeys: getCompareKeys(options.compareKeys), |
| | | contextLines: getContextLines(options.contextLines) |
| | | }); |
| | | |