保誠-保戶業務員媒合平台
PAMapp/node_modules/jest-diff/build/index.js
@@ -3,7 +3,6 @@
Object.defineProperty(exports, '__esModule', {
  value: true
});
exports.diff = diff;
Object.defineProperty(exports, 'DIFF_DELETE', {
  enumerable: true,
  get: function () {
@@ -28,6 +27,7 @@
    return _cleanupSemantic.Diff;
  }
});
exports.diff = diff;
Object.defineProperty(exports, 'diffLinesRaw', {
  enumerable: true,
  get: function () {
@@ -121,13 +121,11 @@
const FORMAT_OPTIONS = {
  plugins: PLUGINS
};
const FORMAT_OPTIONS_0 = {...FORMAT_OPTIONS, indent: 0};
const FALLBACK_FORMAT_OPTIONS = {
  callToJSON: false,
  maxDepth: 10,
  plugins: PLUGINS
};
const FALLBACK_FORMAT_OPTIONS_0 = {...FALLBACK_FORMAT_OPTIONS, indent: 0}; // Generate a string that will highlight the difference between two values
}; // Generate a string that will highlight the difference between two values
// with green and red. (similar to how github does code diffing)
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
@@ -215,47 +213,20 @@
function compareObjects(a, b, options) {
  let difference;
  let hasThrown = false;
  const noDiffMessage = getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
  try {
    const aCompare = (0, _prettyFormat.format)(a, FORMAT_OPTIONS_0);
    const bCompare = (0, _prettyFormat.format)(b, FORMAT_OPTIONS_0);
    if (aCompare === bCompare) {
      difference = noDiffMessage;
    } else {
      const aDisplay = (0, _prettyFormat.format)(a, FORMAT_OPTIONS);
      const bDisplay = (0, _prettyFormat.format)(b, FORMAT_OPTIONS);
      difference = (0, _diffLines.diffLinesUnified2)(
        aDisplay.split('\n'),
        bDisplay.split('\n'),
        aCompare.split('\n'),
        bCompare.split('\n'),
        options
      );
    }
    const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
    difference = getObjectsDifference(a, b, formatOptions, options);
  } catch {
    hasThrown = true;
  } // If the comparison yields no results, compare again but this time
  }
  const noDiffMessage = getCommonMessage(_constants.NO_DIFF_MESSAGE, options); // If the comparison yields no results, compare again but this time
  // without calling `toJSON`. It's also possible that toJSON might throw.
  if (difference === undefined || difference === noDiffMessage) {
    const aCompare = (0, _prettyFormat.format)(a, FALLBACK_FORMAT_OPTIONS_0);
    const bCompare = (0, _prettyFormat.format)(b, FALLBACK_FORMAT_OPTIONS_0);
    if (aCompare === bCompare) {
      difference = noDiffMessage;
    } else {
      const aDisplay = (0, _prettyFormat.format)(a, FALLBACK_FORMAT_OPTIONS);
      const bDisplay = (0, _prettyFormat.format)(b, FALLBACK_FORMAT_OPTIONS);
      difference = (0, _diffLines.diffLinesUnified2)(
        aDisplay.split('\n'),
        bDisplay.split('\n'),
        aCompare.split('\n'),
        bCompare.split('\n'),
        options
      );
    }
    const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
    difference = getObjectsDifference(a, b, formatOptions, options);
    if (difference !== noDiffMessage && !hasThrown) {
      difference =
@@ -267,3 +238,30 @@
  return difference;
}
function getFormatOptions(formatOptions, options) {
  const {compareKeys} = (0, _normalizeDiffOptions.normalizeDiffOptions)(
    options
  );
  return {...formatOptions, compareKeys};
}
function getObjectsDifference(a, b, formatOptions, options) {
  const formatOptionsZeroIndent = {...formatOptions, indent: 0};
  const aCompare = (0, _prettyFormat.format)(a, formatOptionsZeroIndent);
  const bCompare = (0, _prettyFormat.format)(b, formatOptionsZeroIndent);
  if (aCompare === bCompare) {
    return getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
  } else {
    const aDisplay = (0, _prettyFormat.format)(a, formatOptions);
    const bDisplay = (0, _prettyFormat.format)(b, formatOptions);
    return (0, _diffLines.diffLinesUnified2)(
      aDisplay.split('\n'),
      bDisplay.split('\n'),
      aCompare.split('\n'),
      bCompare.split('\n'),
      options
    );
  }
}