From 312b2b4c18dc6ee4aca5e6a015138f3ff65bf69b Mon Sep 17 00:00:00 2001 From: katai5plate Date: Sun, 19 Sep 2021 09:11:39 +0900 Subject: [PATCH] #3 comment out diff --- _scripts/utils.js | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/_scripts/utils.js b/_scripts/utils.js index ffb0a2e..6f88066 100644 --- a/_scripts/utils.js +++ b/_scripts/utils.js @@ -2,7 +2,7 @@ const fs = require("fs-extra"); const pathLib = require("path"); const deepmerge = require("deepmerge"); const eol = require("eol"); -const Diff = require("diff"); +// const Diff = require("diff"); const prettier = require("prettier"); const { transform } = require("@babel/core"); @@ -104,28 +104,28 @@ module.exports = { x.replace(/\r/g, "→").replace(/\n/g, "↵\n") ); if (before !== after) { - const diff = Diff.diffChars(before, after); - console.log( - diff - .slice( - diff.findIndex((d) => d.added || d.removed), - -diff.reverse().findIndex((d) => d.added || d.removed) - ) - .reduce( - (p, { added, removed, value }) => - `${p}${ - added || removed - ? `\n==================== ${ - added ? "ADD" : "REM" - } ==============================================================================================================\n|\n${value.replace( - /^/gm, - "| " - )}\n|\n=======================================================================================================================================\n` - : value - }`, - "" - ) - ); + // const diff = Diff.diffChars(before, after); + // console.log( + // diff + // .slice( + // diff.findIndex((d) => d.added || d.removed), + // -diff.reverse().findIndex((d) => d.added || d.removed) + // ) + // .reduce( + // (p, { added, removed, value }) => + // `${p}${ + // added || removed + // ? `\n==================== ${ + // added ? "ADD" : "REM" + // } ==============================================================================================================\n|\n${value.replace( + // /^/gm, + // "| " + // )}\n|\n=======================================================================================================================================\n` + // : value + // }`, + // "" + // ) + // ); return true; } return false;