From bcb8af78d60c5c856bee3bb9ec247f774976d46d Mon Sep 17 00:00:00 2001 From: baiy Date: Fri, 26 Feb 2021 10:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/library/serializeConversion.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/tool/library/serializeConversion.js b/src/views/tool/library/serializeConversion.js index ef4b6ea..df1c066 100644 --- a/src/views/tool/library/serializeConversion.js +++ b/src/views/tool/library/serializeConversion.js @@ -4,7 +4,7 @@ import phpSerialize from "serialize-php" import propertiesToJSON from "properties-to-json" import jsonToPropertiesParser from "json-to-properties/src/scripts/parser" import yaml from "js-yaml" -import xmlFormatter from "xml-formatter" +import formatter from "./formatter" import X2JS from "x2js" export const TYPE = ["json", "xml", "yaml", "phpArray", "phpSerialize", "properties"]; @@ -75,11 +75,7 @@ class serializeConversion { getXml() { let x2js = new X2JS(); this.input = Object.keys(this.input).length > 1 ? {default_root:this.input} : this.input; - return xmlFormatter(x2js.json2xml_str(this.input), { - indentation: ' ', - collapseContent: true, - lineSeparator: '\n' - }); + return formatter(x2js.json2xml_str(this.input),'xml'); } getYaml() { -- GitLab