From d57c90c2e3115de7187a6ec0b51d417d7345bba3 Mon Sep 17 00:00:00 2001 From: Austin Cheney Date: Fri, 30 Jun 2017 11:31:34 -0500 Subject: [PATCH] converting prettydiff to prettydiff2 --- package.json | 6 +++--- src/beautifiers/prettydiff.coffee | 5 ++--- src/beautifiers/vue-beautifier.coffee | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bea906a..8fc170c 100644 --- a/package.json +++ b/package.json @@ -175,7 +175,7 @@ "node-dir": "0.1.17", "node-uuid": "1.4.8", "open": "0.0.5", - "prettydiff": "1.16.37", + "prettydiff2": "2.2.3", "pug-beautify": "^0.1.1", "remark": "6.0.1", "season": "6.0.0", @@ -422,7 +422,7 @@ "typescript-formatter", "tidy-markdown", "underscore-plus", - "prettydiff" + "prettydiff2" ] } }, @@ -434,7 +434,7 @@ "typescript-formatter", "tidy-markdown", "underscore-plus", - "prettydiff" + "prettydiffi2" ] } } diff --git a/src/beautifiers/prettydiff.coffee b/src/beautifiers/prettydiff.coffee index ace7be2..7917d77 100644 --- a/src/beautifiers/prettydiff.coffee +++ b/src/beautifiers/prettydiff.coffee @@ -73,7 +73,7 @@ module.exports = class PrettyDiff extends Beautifier beautify: (text, language, options) -> options.crlf = @getDefaultLineEnding(true,false,options.end_of_line) return new @Promise((resolve, reject) => - prettydiff = require("prettydiff") + prettydiff = require("prettydiff2") _ = require('lodash') # Select Prettydiff language @@ -127,8 +127,7 @@ module.exports = class PrettyDiff extends Beautifier # Beautify @verbose('prettydiff', options) - output = prettydiff.api(options) - result = output[0] + result = prettydiff(options) # Return beautified text resolve(result) diff --git a/src/beautifiers/vue-beautifier.coffee b/src/beautifiers/vue-beautifier.coffee index bf03307..d4290d9 100644 --- a/src/beautifiers/vue-beautifier.coffee +++ b/src/beautifiers/vue-beautifier.coffee @@ -10,7 +10,7 @@ module.exports = class VueBeautifier extends Beautifier beautify: (text, language, options) -> return new @Promise((resolve, reject) => - prettydiff = require("prettydiff") + prettydiff = require("prettydiff2") _ = require('lodash') regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*?)^<\/\2>/gim @@ -37,14 +37,14 @@ module.exports = class VueBeautifier extends Beautifier lang: "scss" mode: "beautify" ) - prettydiff.api(options)[0] + prettydiff(options) when "less" options = _.merge(options, source: text lang: "less" mode: "beautify" ) - prettydiff.api(options)[0] + prettydiffoptions) when undefined require("js-beautify").css(text, options) else