Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function diff (actual, expected, color) {
const { defaultOptions, diffOptions } = concordanceOptions(color)
const result = concordance.compare(actual, expected, defaultOptions)
return concordance.diffDescriptors(
result.actual || concordance.describe(actual, defaultOptions),
result.expected || concordance.describe(expected, defaultOptions),
diffOptions
)
}
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
options = Object.assign({}, options, concordanceDiffOptions);
return {
label: 'Difference:',
formatted: concordance.diffDescriptors(actualDescriptor, expectedDescriptor, options)
};
}
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
const diffOptions = Object.assign({}, options, concordanceDiffOptions)
return concordance.diffDescriptors(actualDescriptor, expectedDescriptor, diffOptions)
}
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
const diffOptions = Object.assign({}, options, concordanceDiffOptions)
return concordance.diffDescriptors(actualDescriptor, expectedDescriptor, diffOptions)
}
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
options = {...options, ...concordanceDiffOptions};
return {
label: 'Difference:',
formatted: concordance.diffDescriptors(actualDescriptor, expectedDescriptor, options)
};
}