How to use the disparity.unifiedNoColor function in disparity

To help you get started, we’ve selected a few disparity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fabsrc / graphql-schema-diff / src / diff.ts View on Github external
];
  }

  const [leftSchemaSDL, rightSchemaSDL] = [
    printSchema(leftSchema),
    printSchema(rightSchema)
  ];

  if (leftSchemaSDL === rightSchemaSDL) {
    return;
  }

  const diff = disparity.unified(leftSchemaSDL, rightSchemaSDL, {
    paths: [leftSchemaLocation, rightSchemaLocation]
  });
  const diffNoColor = disparity.unifiedNoColor(leftSchemaSDL, rightSchemaSDL, {
    paths: [leftSchemaLocation, rightSchemaLocation]
  });
  const dangerousChanges = findDangerousChanges(leftSchema, rightSchema);
  const breakingChanges = findBreakingChanges(leftSchema, rightSchema);

  return {
    diff,
    diffNoColor,
    dangerousChanges,
    breakingChanges
  };
}
github bahmutov / snap-shot-compare / src / utils.js View on Github external
function textDifference (expected, value, noColor) {
  const diff = noColor ? disparity.unifiedNoColor : disparity.unified
  const textDiff = diff(expected, value)
  return removeExplanation(textDiff)
}

disparity

Colorized string diff ideal for text/code that spans through multiple lines

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis