UNPKG

@unibeautify/beautifier-prettydiff

Version:
80 lines 2.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const commonOptions = { comments: [ ["indent_comments"], (options) => { if (options.indent_comments === false) { return "noindent"; } else { return "indent"; } }, ], inchar: [ ["indent_style"], (options) => { if (options.indent_style === "tab") { return "\t"; } else if (options.indent_style === "space") { return " "; } }, ], insize: "indent_size", preserve: "max_preserve_newlines", quoteConvert: "quotes", wrap: "wrap_line_length", }; const styleOptions = Object.assign({}, commonOptions, { noleadzero: "no_leading_zero", cssinsertlines: "newline_between_rules" }); delete styleOptions.comments; const markupOptions = Object.assign({}, commonOptions, { force_indent: "force_indentation" }); const scriptOptions = Object.assign({}, commonOptions, { endcomma: "end_with_comma", space: "space_after_anon_function", methodchain: [ ["break_chained_methods"], (options) => { return !(options.break_chained_methods === true); }, ], ternaryline: [ ["multiline_ternary"], (options) => { switch (options.multiline_ternary) { case "always": return false; case "never": return true; default: return undefined; } }, ], vertical: [ ["align_assignments"], (options) => { if (options.align_assignments === true) { return "all"; } else { return "none"; } }, ] }); const scriptBasicOptions = Object.assign({}, scriptOptions); delete scriptBasicOptions.space; delete scriptBasicOptions.endcomma; const json5Options = Object.assign({}, commonOptions); delete json5Options.wrap; const jsonOptions = Object.assign({}, json5Options); delete jsonOptions.comments; const options = { Markup: markupOptions, Markdown: commonOptions, Script: scriptOptions, Style: styleOptions, JSON: jsonOptions, JSON5: json5Options, Common: commonOptions, BasicScript: scriptBasicOptions, }; exports.default = options; //# sourceMappingURL=options.js.map