├── .gitignore ├── index.f2c9818b.js ├── index.f2c9818b.js.map ├── index.f6a1cbc5.css ├── index.f6a1cbc5.css.map ├── index.fa8f28b8.js ├── index.fa8f28b8.js.map └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # production 5 | build 6 | 7 | # misc 8 | .DS_Store 9 | 10 | npm-debug.log 11 | yarn-error.log 12 | yarn.lock 13 | .yarnclean 14 | .vscode 15 | .idea 16 | -------------------------------------------------------------------------------- /index.f2c9818b.js: -------------------------------------------------------------------------------- 1 | !function(){function t(t){return t&&t.__esModule?t.default:t}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},r={},n={},i=e.parcelRequire9f9b;null==i&&((i=function(t){if(t in r)return r[t].exports;if(t in n){var e=n[t];delete n[t];var i={id:t,exports:{}};return r[t]=i,e.call(i.exports,i,i.exports),i.exports}var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(t,e){n[t]=e},e.parcelRequire9f9b=i),i.register("6qbIH",(function(t,e){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===n.call(t)},a=function(t){if(!t||"[object Object]"!==n.call(t))return!1;var e,i=r.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!o)return!1;for(e in t);return void 0===e||r.call(t,e)},p=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},l=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(o)return o(t,e).value}return t[e]};t.exports=function t(){var e,r,n,i,o,u,c=arguments[0],f=1,h=arguments.length,d=!1;for("boolean"==typeof c&&(d=c,c=arguments[1]||{},f=2),(null==c||"object"!=typeof c&&"function"!=typeof c)&&(c={});f{"use strict";var t=i("6qbIH");String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var r=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return-1!==n&&n===e}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),String.prototype.repeat||(String.prototype.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==e.length||0==t)return"";if(e.length*t>=268435456)throw new RangeError("repeat count must not overflow maximum string size");for(var r="";1==(1&t)&&(r+=e),0!=(t>>>=1);)e+=e;return r}),Array.prototype.remove||(Array.prototype.remove=function(t,e){this.splice(t,1)}),String.prototype.contains||(String.prototype.contains=String.prototype.includes),Array.prototype.insert||(Array.prototype.insert=function(t,e){this.splice(t,0,e)}),o=class{parse(t){let e=t;var r=this.clean_lines(e);return this.options.dontJoinCurlyBracet||(r=this.join_opening_bracket(r)),(r=this.perform_indentation(r)).join("\n")}extractTextBySeperator(t,e,r){null==r&&(r=e);var n=new RegExp(e),i=new RegExp(r),o=new RegExp(e+"(.*?)"+r);return n.test(t)&&i.test(t)?t.match(o)[1]:""}extractAllPossibleText(t,e,r){null==r&&(r=e);for(var n={},i="",o=0;""!=(i=this.extractTextBySeperator(t,e,r));){var s="#$#%#$#placeholder"+o+"#$#%#$#";n[s]=e+i+r,t=t.replace(n[s],s),o++}return{inputHidden:t,extracted:n,getRestored:function(){var t=this.inputHidden;for(var e in n)t=t.replace(e,n[e]);return t}}}strip_line(t){var e=t.trim(),r=this.extractAllPossibleText(e,'"','"');return r.inputHidden=r.inputHidden.replace(/\s\s+/g," "),r.getRestored()}clean_lines(t){for(var e=t.split(/\r\n|\r|\n/g),r=0,n=0;r=2&&(e.splice(r,1),r--);else{n=0;var i=e[r]=this.strip_line(e[r]);if("}"!=i&&"{"!=i){var o,s;if((o=i.indexOf("}"))>=0)e[r]=this.strip_line(i.slice(0,o-1)),e.insert(r+1,"}"),""!=(s=this.strip_line(i.slice(o+1)))&&e.insert(r+2,s),i=e[r];if((o=i.indexOf("{"))>=0)e[r]=this.strip_line(i.slice(0,o)),e.insert(r+1,"{"),""!=(s=this.strip_line(i.slice(o+1)))&&e.insert(r+2,s)}}return e}join_opening_bracket(t){for(var e=0;e=1&&(t[e]=t[e-1]+" {",this.NEWLINEAFTERBRACET&&t.length>e+1&&t[e+1].length>0&&t.insert(e+1,""),t.remove(e-1))}return t}perform_indentation(t){var e,r,n;e=[],r=0;for(var i=t,o=0;o0&&(r-=1),""!==n?e.push(this.INDENTATION.repeat(r)+n):e.push(""),!n.startsWith("#")&&n.endsWith("{")&&(r+=1);return e}constructor(e){this.INDENTATION="\t",this.NEWLINEAFTERBRACET=!0,this.options={spaces:0,tabs:0,dontJoinCurlyBracet:!0},t(this.options,e),this.options.tabs>0&&(this.INDENTATION="\t".repeat(this.options.tabs)),this.options.spaces>0&&(this.INDENTATION=" ".repeat(this.options.spaces))}}})();const s=document.getElementById("textarea");document.getElementById("form").addEventListener("submit",(function(e){e.preventDefault();const r=parseInt(document.getElementById("tabs").value),n=parseInt(document.getElementById("spaces").value),i=document.getElementById("dontJoinCurlyBracet").checked,a=new(t(o))({spaces:n,tabs:r,dontJoinCurlyBracet:i});return s.value=a.parse(s.value),!1}))}(); 2 | //# sourceMappingURL=index.f2c9818b.js.map 3 | -------------------------------------------------------------------------------- /index.f2c9818b.js.map: -------------------------------------------------------------------------------- 1 | {"mappings":"mk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C,CAtLXhG,YAAYsG,GACR7E,KAAK4E,YAAc,KACnB5E,KAAKsE,oBAAqB,EAC1BtE,KAAKtB,QAAU,CACXoG,OAAQ,EACRC,KAAM,EACN5C,qBAAqB,GAEzB/C,EAAOY,KAAKtB,QAASmG,GACjB7E,KAAKtB,QAAQqG,KAAO,IACpB/E,KAAK4E,YAAc,KAAK5D,OAAOhB,KAAKtB,QAAQqG,OAE5C/E,KAAKtB,QAAQoG,OAAS,IACtB9E,KAAK4E,YAAc,IAAI5D,OAAOhB,KAAKtB,QAAQoG,Q,EAqR1D,EAvSD,GCPA,MAAME,EAAWC,SAASC,eAAe,YAC5BD,SAASC,eAAe,QAEhCC,iBAAiB,UAAU,SAAUC,GACxCA,EAAEC,iBACF,MAAMN,EAAOO,SAASL,SAASC,eAAe,QAAQpG,OAChDgG,EAASQ,SAASL,SAASC,eAAe,UAAUpG,OACpDqD,EAAsB8C,SAASC,eAAe,uBAAuBK,QAErEC,EAAa,IAAIC,EAAA5D,GAAJ,CAAa,C,OAAEiD,E,KAAQC,E,oBAAM5C,IAEhD,OADA6C,EAASlG,MAAQ0G,EAAW1D,MAAMkD,EAASlG,QACpC,C","sources":["node_modules/extend/index.js","node_modules/nginxbeautify/nginxbeautify/main.js","src/scripts/index.js"],"sourcesContent":["'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","/*\n NGINX Beautify\n\n Originally written in Python by Michał Słomkowski\n (https://github.com/1connect/nginx-config-formatter , nginxfmt.py)\n\n Ported by Yosef (https://github.com/vasilevich/nginxbeautifier/)\n NPM Package by @denvit : https://github.com/denysvitali/\n*/\n(() => {\n 'use strict'\n var extend = require('extend');\n class Beautifier {\n\n constructor(customOptions) {\n this.INDENTATION = '\\t';\n this.NEWLINEAFTERBRACET = true;\n this.options = {\n spaces: 0,\n tabs: 0,\n dontJoinCurlyBracet: true\n };\n extend(this.options, customOptions);\n if (this.options.tabs > 0) {\n this.INDENTATION = \"\\t\".repeat(this.options.tabs);\n }\n if (this.options.spaces > 0) {\n this.INDENTATION = \" \".repeat(this.options.spaces);\n }\n }\n\n parse(string) {\n let fileContents = string\n var cleanLines = this.clean_lines(fileContents);\n if (!this.options.dontJoinCurlyBracet) {\n cleanLines = this.join_opening_bracket(cleanLines);\n }\n cleanLines = this.perform_indentation(cleanLines);\n return cleanLines.join(\"\\n\");\n }\n\n /**\n * Grabs text in between two seperators seperator1 thetextIwant seperator2\n * @param {string} input String to seperate\n * @param {string} seperator1 The first seperator to use\n * @param {string} seperator2 The second seperator to use\n * @return {string}\n */\n extractTextBySeperator(input, seperator1, seperator2) {\n if (seperator2 == undefined)\n seperator2 = seperator1;\n var ret = \"\";\n var seperator1Regex = new RegExp(seperator1);\n var seperator2Regex = new RegExp(seperator2);\n var catchRegex = new RegExp(seperator1 + \"(.*?)\" + seperator2);\n if (seperator1Regex.test(input) && seperator2Regex.test(input)) {\n return input.match(catchRegex)[1];\n } else {\n return \"\";\n }\n }\n\n /**\n * Grabs text in between two seperators seperator1 thetextIwant seperator2\n * @param {string} input String to seperate\n * @param {string} seperator1 The first seperator to use\n * @param {string} seperator2 The second seperator to use\n * @return {object}\n */\n extractAllPossibleText(input, seperator1, seperator2) {\n if (seperator2 == undefined)\n seperator2 = seperator1;\n var extracted = {};\n var textInBetween = \"\";\n var cnt = 0;\n while ((textInBetween = this.extractTextBySeperator(input, seperator1, seperator2)) != \"\") {\n var placeHolder = \"#$#%#$#placeholder\" + cnt + \"#$#%#$#\";\n extracted[placeHolder] = seperator1 + textInBetween + seperator2;\n input = input.replace(extracted[placeHolder], placeHolder);\n cnt++;\n }\n return {\n inputHidden: input,\n extracted: extracted,\n getRestored: function() {\n var textToFix = this.inputHidden;\n for (var key in extracted) {\n textToFix = textToFix.replace(key, extracted[key]);\n }\n return textToFix;\n }\n };\n }\n\n /**\n * @param {string} single_line the whole nginx config\n * @return {string} stripped out string without multi spaces\n */\n strip_line(single_line) {\n //\"\"\"Strips the line and replaces neighbouring whitespaces with single space (except when within quotation marks).\"\"\"\n //trim the line before and after\n var trimmed = single_line.trim();\n //get text without any quatation marks(text foudn with quatation marks is replaced with a placeholder)\n var removedQuatations = this.extractAllPossibleText(trimmed, '\"', '\"');\n //replace multi spaces with single spaces\n removedQuatations.inputHidden = removedQuatations.inputHidden.replace(/\\s\\s+/g, ' ');\n //restore anything of quatation marks\n return removedQuatations.getRestored();\n }\n\n /**\n * @param {string} configContents the whole nginx config\n */\n clean_lines(configContents) {\n var splittedByLines = configContents.split(/\\r\\n|\\r|\\n/g);\n //put { } on their own seperate lines\n //trim the spaces before and after each line\n //trim multi spaces into single spaces\n //trim multi lines into two\n\n for (var index = 0, newline = 0; index < splittedByLines.length; index++) {\n splittedByLines[index] = splittedByLines[index].trim();\n if (!splittedByLines[index].startsWith(\"#\") && !splittedByLines[index].startsWith(\"sub_filter\") && splittedByLines[index] != \"\") {\n newline = 0;\n var line = splittedByLines[index] = this.strip_line(splittedByLines[index]);\n if (line != \"}\" && line != \"{\") {\n var i = line.indexOf(\"}\")\n if (i >= 0) {\n splittedByLines[index] = this.strip_line(line.slice(0, i - 1));\n splittedByLines.insert(index + 1, \"}\");\n var l2 = this.strip_line(line.slice(i + 1));\n if (l2 != \"\")\n splittedByLines.insert(index + 2, l2);\n line = splittedByLines[index];\n }\n var i = line.indexOf(\"{\")\n if (i >= 0) {\n splittedByLines[index] = this.strip_line(line.slice(0, i));\n splittedByLines.insert(index + 1, \"{\");\n var l2 = this.strip_line(line.slice(i + 1));\n if (l2 != \"\")\n splittedByLines.insert(index + 2, l2);\n\n }\n }\n }\n //remove more than two newlines\n else if (splittedByLines[index] == \"\") {\n if (newline++ >= 2) {\n //while(splittedByLines[index]==\"\")\n splittedByLines.splice(index, 1);\n index--;\n\n }\n }\n\n }\n return splittedByLines;\n }\n\n join_opening_bracket(lines) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (line == \"{\") {\n //just make sure we don't put anything before 0\n if (i >= 1) {\n lines[i] = lines[i - 1] + \" {\";\n if (this.NEWLINEAFTERBRACET && lines.length > (i + 1) && lines[i + 1].length > 0)\n lines.insert(i + 1, \"\");\n lines.remove(i - 1);\n }\n }\n }\n return lines;\n }\n\n perform_indentation(lines) {\n var indented_lines, current_indent, line;\n \"Indents the lines according to their nesting level determined by curly brackets.\";\n indented_lines = [];\n current_indent = 0;\n var iterator1 = lines;\n for (var index1 = 0; index1 < iterator1.length; index1++) {\n line = iterator1[index1];\n if (!line.startsWith(\"#\") && line.endsWith(\"}\") && current_indent > 0) {\n current_indent -= 1;\n }\n if (line !== \"\") {\n indented_lines.push(this.INDENTATION.repeat(current_indent) + line);\n } else {\n indented_lines.push(\"\");\n }\n if (!line.startsWith(\"#\") && line.endsWith(\"{\")) {\n current_indent += 1;\n }\n }\n return indented_lines;\n }\n }\n\n\n //////// POLYFILLS /////////\n if (!String.prototype.trim) {\n String.prototype.trim = function() {\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n };\n }\n\n if (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n }\n if (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n }\n if (!String.prototype.includes) {\n String.prototype.includes = function(search, start) {\n 'use strict';\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > this.length) {\n return false;\n } else {\n return this.indexOf(search, start) !== -1;\n }\n };\n }\n\n if (!String.prototype.repeat) {\n String.prototype.repeat = function(count) {\n 'use strict';\n if (this == null) {\n throw new TypeError('can\\'t convert ' + this + ' to object');\n }\n var str = '' + this;\n count = +count;\n if (count != count) {\n count = 0;\n }\n if (count < 0) {\n throw new RangeError('repeat count must be non-negative');\n }\n if (count == Infinity) {\n throw new RangeError('repeat count must be less than infinity');\n }\n count = Math.floor(count);\n if (str.length == 0 || count == 0) {\n return '';\n }\n // Ensuring count is a 31-bit integer allows us to heavily optimize the\n // main part. But anyway, most current (August 2014) browsers can't handle\n // strings 1 << 28 chars or longer, so:\n if (str.length * count >= 1 << 28) {\n throw new RangeError('repeat count must not overflow maximum string size');\n }\n var rpt = '';\n for (;;) {\n if ((count & 1) == 1) {\n rpt += str;\n }\n count >>>= 1;\n if (count == 0) {\n break;\n }\n str += str;\n }\n // Could we try:\n // return Array(count + 1).join(this);\n return rpt;\n }\n }\n\n\n if (!Array.prototype.remove) {\n Array.prototype.remove = function(index, item) {\n this.splice(index, 1);\n };\n\n }\n\n if (!String.prototype.contains) {\n String.prototype.contains = String.prototype.includes;\n }\n\n if (!Array.prototype.insert) {\n Array.prototype.insert = function(index, item) {\n this.splice(index, 0, item);\n };\n }\n ///////// END POLYFILLS //////////\n\n module.exports = Beautifier;\n})();\n","import Beautify from 'nginxbeautify';\n\nconst textarea = document.getElementById('textarea');\nconst form = document.getElementById('form');\n\nform.addEventListener('submit', function (e) {\n e.preventDefault();\n const tabs = parseInt(document.getElementById('tabs').value);\n const spaces = parseInt(document.getElementById('spaces').value);\n const dontJoinCurlyBracet = document.getElementById('dontJoinCurlyBracet').checked;\n\n const beautifier = new Beautify({ spaces, tabs, dontJoinCurlyBracet});\n textarea.value = beautifier.parse(textarea.value);\n return false;\n});\n"],"names":["$4ace431ac82cf066$var$hasOwn","Object","prototype","hasOwnProperty","$4ace431ac82cf066$var$toStr","toString","$4ace431ac82cf066$var$defineProperty","defineProperty","$4ace431ac82cf066$var$gOPD","getOwnPropertyDescriptor","$4ace431ac82cf066$var$isArray","arr","Array","isArray","call","$4ace431ac82cf066$var$isPlainObject","obj","key","hasOwnConstructor","hasIsPrototypeOf","constructor","$4ace431ac82cf066$var$setProperty","target","options","name","enumerable","configurable","value","newValue","writable","$4ace431ac82cf066$var$getProperty","module","exports","extend","src","copy","copyIsArray","clone","arguments","i","length","deep","parcelRequire","String","trim","this","replace","startsWith","searchString","position","substr","endsWith","subjectString","isFinite","Math","floor","lastIndex","indexOf","includes","search","start","repeat","count","TypeError","str","RangeError","Infinity","rpt","remove","index","item","splice","contains","insert","$ce74c6c3f37a2767$exports","parse","string","fileContents","cleanLines","clean_lines","dontJoinCurlyBracet","join_opening_bracket","perform_indentation","join","extractTextBySeperator","input","seperator1","seperator2","undefined","seperator1Regex","RegExp","seperator2Regex","catchRegex","test","match","extractAllPossibleText","extracted","textInBetween","cnt","placeHolder","inputHidden","getRestored","textToFix","strip_line","single_line","trimmed","removedQuatations","configContents","splittedByLines","split","newline","line","l2","slice","lines","NEWLINEAFTERBRACET","indented_lines","current_indent","iterator1","index1","push","INDENTATION","customOptions","spaces","tabs","$354e626a38a69ab1$var$textarea","document","getElementById","addEventListener","e","preventDefault","parseInt","checked","beautifier","$parcel$interopDefault"],"version":3,"file":"index.f2c9818b.js.map"} -------------------------------------------------------------------------------- /index.f6a1cbc5.css: -------------------------------------------------------------------------------- 1 | body{color:#222;width:-webkit-fit-content;width:-moz-fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background:#fff;margin:auto;font:100% system-ui}a{color:#03c}@media (prefers-color-scheme:dark){body,textarea{color:#eee;background:#121212}a{color:#809fff}}fieldset{flex-direction:column;display:flex}textarea{width:640px;min-height:640px;height:100%} 2 | /*# sourceMappingURL=index.f6a1cbc5.css.map */ 3 | -------------------------------------------------------------------------------- /index.f6a1cbc5.css.map: -------------------------------------------------------------------------------- 1 | {"mappings":"ACAA,oLAOA,aAIA,mCACE,4CAUA,iBAKF,4CAKA","sources":["index.f6a1cbc5.css","src/styles/index.scss"],"sourcesContent":["body {\n color: #222;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n background: #fff;\n margin: auto;\n font: 100% system-ui;\n}\n\na {\n color: #03c;\n}\n\n@media (prefers-color-scheme: dark) {\n body, textarea {\n color: #eee;\n background: #121212;\n }\n\n a {\n color: #809fff;\n }\n}\n\nfieldset {\n flex-direction: column;\n display: flex;\n}\n\ntextarea {\n width: 640px;\n min-height: 640px;\n height: 100%;\n}\n\n/*# sourceMappingURL=index.f6a1cbc5.css.map */\n","body {\n color: #222;\n background: #fff;\n font: 100% system-ui;\n width: fit-content;\n margin: auto;\n}\na {\n color: #0033cc;\n}\n\n@media (prefers-color-scheme: dark) {\n body {\n color: #eee;\n background: #121212;\n }\n\n textarea {\n color: #eee;\n background: #121212;\n }\n\n a {\n color: #809fff;\n }\n}\n\nfieldset {\n display: flex;\n flex-direction: column;\n}\n\ntextarea {\n width: 640px;\n min-height: 640px;\n height: 100%;\n}\n"],"names":[],"version":3,"file":"index.f6a1cbc5.css.map"} -------------------------------------------------------------------------------- /index.fa8f28b8.js: -------------------------------------------------------------------------------- 1 | function t(t){return t&&t.__esModule?t.default:t}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},r={},n={},i=e.parcelRequire9f9b;null==i&&((i=function(t){if(t in r)return r[t].exports;if(t in n){var e=n[t];delete n[t];var i={id:t,exports:{}};return r[t]=i,e.call(i.exports,i,i.exports),i.exports}var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(t,e){n[t]=e},e.parcelRequire9f9b=i),i.register("j2NXn",(function(t,e){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===n.call(t)},a=function(t){if(!t||"[object Object]"!==n.call(t))return!1;var e,i=r.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!o)return!1;for(e in t);return void 0===e||r.call(t,e)},p=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},l=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(o)return o(t,e).value}return t[e]};t.exports=function t(){var e,r,n,i,o,u,c=arguments[0],f=1,h=arguments.length,d=!1;for("boolean"==typeof c&&(d=c,c=arguments[1]||{},f=2),(null==c||"object"!=typeof c&&"function"!=typeof c)&&(c={});fr.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return-1!==n&&n===e}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),String.prototype.repeat||(String.prototype.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==e.length||0==t)return"";if(e.length*t>=268435456)throw new RangeError("repeat count must not overflow maximum string size");for(var r="";1==(1&t)&&(r+=e),0!=(t>>>=1);)e+=e;return r}),Array.prototype.remove||(Array.prototype.remove=function(t,e){this.splice(t,1)}),String.prototype.contains||(String.prototype.contains=String.prototype.includes),Array.prototype.insert||(Array.prototype.insert=function(t,e){this.splice(t,0,e)}),s=class{parse(t){let e=t;var r=this.clean_lines(e);return this.options.dontJoinCurlyBracet||(r=this.join_opening_bracket(r)),(r=this.perform_indentation(r)).join("\n")}extractTextBySeperator(t,e,r){null==r&&(r=e);var n=new RegExp(e),i=new RegExp(r),o=new RegExp(e+"(.*?)"+r);return n.test(t)&&i.test(t)?t.match(o)[1]:""}extractAllPossibleText(t,e,r){null==r&&(r=e);for(var n={},i="",o=0;""!=(i=this.extractTextBySeperator(t,e,r));){var s="#$#%#$#placeholder"+o+"#$#%#$#";n[s]=e+i+r,t=t.replace(n[s],s),o++}return{inputHidden:t,extracted:n,getRestored:function(){var t=this.inputHidden;for(var e in n)t=t.replace(e,n[e]);return t}}}strip_line(t){var e=t.trim(),r=this.extractAllPossibleText(e,'"','"');return r.inputHidden=r.inputHidden.replace(/\s\s+/g," "),r.getRestored()}clean_lines(t){for(var e=t.split(/\r\n|\r|\n/g),r=0,n=0;r=2&&(e.splice(r,1),r--);else{n=0;var i,o,s=e[r]=this.strip_line(e[r]);if("}"!=s&&"{"!=s)(i=s.indexOf("}"))>=0&&(e[r]=this.strip_line(s.slice(0,i-1)),e.insert(r+1,"}"),""!=(o=this.strip_line(s.slice(i+1)))&&e.insert(r+2,o),s=e[r]),(i=s.indexOf("{"))>=0&&(e[r]=this.strip_line(s.slice(0,i)),e.insert(r+1,"{"),""!=(o=this.strip_line(s.slice(i+1)))&&e.insert(r+2,o))}return e}join_opening_bracket(t){for(var e=0;e=1&&(t[e]=t[e-1]+" {",this.NEWLINEAFTERBRACET&&t.length>e+1&&t[e+1].length>0&&t.insert(e+1,""),t.remove(e-1));return t}perform_indentation(t){var e,r,n;e=[],r=0;for(var i=t,o=0;o0&&(r-=1),""!==n?e.push(this.INDENTATION.repeat(r)+n):e.push(""),!n.startsWith("#")&&n.endsWith("{")&&(r+=1);return e}constructor(t){this.INDENTATION="\t",this.NEWLINEAFTERBRACET=!0,this.options={spaces:0,tabs:0,dontJoinCurlyBracet:!0},o(this.options,t),this.options.tabs>0&&(this.INDENTATION="\t".repeat(this.options.tabs)),this.options.spaces>0&&(this.INDENTATION=" ".repeat(this.options.spaces))}};const a=document.getElementById("textarea");document.getElementById("form").addEventListener("submit",(function(e){e.preventDefault();const r=parseInt(document.getElementById("tabs").value),n=parseInt(document.getElementById("spaces").value),i=document.getElementById("dontJoinCurlyBracet").checked,o=new(t(s))({spaces:n,tabs:r,dontJoinCurlyBracet:i});return a.value=o.parse(a.value),!1})); 2 | //# sourceMappingURL=index.fa8f28b8.js.map 3 | -------------------------------------------------------------------------------- /index.fa8f28b8.js.map: -------------------------------------------------------------------------------- 1 | {"mappings":"ujBAEA,IAAIA,EAASC,OAAOC,UAAUC,eAC1BC,EAAQH,OAAOC,UAAUG,SACzBC,EAAiBL,OAAOM,eACxBC,EAAOP,OAAOQ,yBAEdC,EAAU,SAAiBC,GAC9B,MAA6B,mBAAlBC,MAAMC,QACTD,MAAMC,QAAQF,GAGK,mBAApBP,EAAMU,KAAKH,E,EAGfI,EAAgB,SAAuBC,GAC1C,IAAKA,GAA2B,oBAApBZ,EAAMU,KAAKE,GACtB,OAAO,EAGR,IASIC,EATAC,EAAoBlB,EAAOc,K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YAC5BD,SAASC,eAAe,QAEhCC,iBAAiB,UAAU,SAAUC,GACxCA,EAAEC,iBACF,MAAMN,EAAOO,SAASL,SAASC,eAAe,QAAQpG,OAChDgG,EAASQ,SAASL,SAASC,eAAe,UAAUpG,OACpDqD,EAAsB8C,SAASC,eAAe,uBAAuBK,QAErEC,EAAa,IAAIC,EAAA5D,GAAJ,CAAa,C,OAAEiD,E,KAAQC,E,oBAAM5C,IAEhD,OADA6C,EAASlG,MAAQ0G,EAAW1D,MAAMkD,EAASlG,QACpC,C","sources":["node_modules/extend/index.js","node_modules/nginxbeautify/nginxbeautify/main.js","src/scripts/index.js"],"sourcesContent":["'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","/*\n NGINX Beautify\n\n Originally written in Python by Michał Słomkowski\n (https://github.com/1connect/nginx-config-formatter , nginxfmt.py)\n\n Ported by Yosef (https://github.com/vasilevich/nginxbeautifier/)\n NPM Package by @denvit : https://github.com/denysvitali/\n*/\n(() => {\n 'use strict'\n var extend = require('extend');\n class Beautifier {\n\n constructor(customOptions) {\n this.INDENTATION = '\\t';\n this.NEWLINEAFTERBRACET = true;\n this.options = {\n spaces: 0,\n tabs: 0,\n dontJoinCurlyBracet: true\n };\n extend(this.options, customOptions);\n if (this.options.tabs > 0) {\n this.INDENTATION = \"\\t\".repeat(this.options.tabs);\n }\n if (this.options.spaces > 0) {\n this.INDENTATION = \" \".repeat(this.options.spaces);\n }\n }\n\n parse(string) {\n let fileContents = string\n var cleanLines = this.clean_lines(fileContents);\n if (!this.options.dontJoinCurlyBracet) {\n cleanLines = this.join_opening_bracket(cleanLines);\n }\n cleanLines = this.perform_indentation(cleanLines);\n return cleanLines.join(\"\\n\");\n }\n\n /**\n * Grabs text in between two seperators seperator1 thetextIwant seperator2\n * @param {string} input String to seperate\n * @param {string} seperator1 The first seperator to use\n * @param {string} seperator2 The second seperator to use\n * @return {string}\n */\n extractTextBySeperator(input, seperator1, seperator2) {\n if (seperator2 == undefined)\n seperator2 = seperator1;\n var ret = \"\";\n var seperator1Regex = new RegExp(seperator1);\n var seperator2Regex = new RegExp(seperator2);\n var catchRegex = new RegExp(seperator1 + \"(.*?)\" + seperator2);\n if (seperator1Regex.test(input) && seperator2Regex.test(input)) {\n return input.match(catchRegex)[1];\n } else {\n return \"\";\n }\n }\n\n /**\n * Grabs text in between two seperators seperator1 thetextIwant seperator2\n * @param {string} input String to seperate\n * @param {string} seperator1 The first seperator to use\n * @param {string} seperator2 The second seperator to use\n * @return {object}\n */\n extractAllPossibleText(input, seperator1, seperator2) {\n if (seperator2 == undefined)\n seperator2 = seperator1;\n var extracted = {};\n var textInBetween = \"\";\n var cnt = 0;\n while ((textInBetween = this.extractTextBySeperator(input, seperator1, seperator2)) != \"\") {\n var placeHolder = \"#$#%#$#placeholder\" + cnt + \"#$#%#$#\";\n extracted[placeHolder] = seperator1 + textInBetween + seperator2;\n input = input.replace(extracted[placeHolder], placeHolder);\n cnt++;\n }\n return {\n inputHidden: input,\n extracted: extracted,\n getRestored: function() {\n var textToFix = this.inputHidden;\n for (var key in extracted) {\n textToFix = textToFix.replace(key, extracted[key]);\n }\n return textToFix;\n }\n };\n }\n\n /**\n * @param {string} single_line the whole nginx config\n * @return {string} stripped out string without multi spaces\n */\n strip_line(single_line) {\n //\"\"\"Strips the line and replaces neighbouring whitespaces with single space (except when within quotation marks).\"\"\"\n //trim the line before and after\n var trimmed = single_line.trim();\n //get text without any quatation marks(text foudn with quatation marks is replaced with a placeholder)\n var removedQuatations = this.extractAllPossibleText(trimmed, '\"', '\"');\n //replace multi spaces with single spaces\n removedQuatations.inputHidden = removedQuatations.inputHidden.replace(/\\s\\s+/g, ' ');\n //restore anything of quatation marks\n return removedQuatations.getRestored();\n }\n\n /**\n * @param {string} configContents the whole nginx config\n */\n clean_lines(configContents) {\n var splittedByLines = configContents.split(/\\r\\n|\\r|\\n/g);\n //put { } on their own seperate lines\n //trim the spaces before and after each line\n //trim multi spaces into single spaces\n //trim multi lines into two\n\n for (var index = 0, newline = 0; index < splittedByLines.length; index++) {\n splittedByLines[index] = splittedByLines[index].trim();\n if (!splittedByLines[index].startsWith(\"#\") && !splittedByLines[index].startsWith(\"sub_filter\") && splittedByLines[index] != \"\") {\n newline = 0;\n var line = splittedByLines[index] = this.strip_line(splittedByLines[index]);\n if (line != \"}\" && line != \"{\") {\n var i = line.indexOf(\"}\")\n if (i >= 0) {\n splittedByLines[index] = this.strip_line(line.slice(0, i - 1));\n splittedByLines.insert(index + 1, \"}\");\n var l2 = this.strip_line(line.slice(i + 1));\n if (l2 != \"\")\n splittedByLines.insert(index + 2, l2);\n line = splittedByLines[index];\n }\n var i = line.indexOf(\"{\")\n if (i >= 0) {\n splittedByLines[index] = this.strip_line(line.slice(0, i));\n splittedByLines.insert(index + 1, \"{\");\n var l2 = this.strip_line(line.slice(i + 1));\n if (l2 != \"\")\n splittedByLines.insert(index + 2, l2);\n\n }\n }\n }\n //remove more than two newlines\n else if (splittedByLines[index] == \"\") {\n if (newline++ >= 2) {\n //while(splittedByLines[index]==\"\")\n splittedByLines.splice(index, 1);\n index--;\n\n }\n }\n\n }\n return splittedByLines;\n }\n\n join_opening_bracket(lines) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (line == \"{\") {\n //just make sure we don't put anything before 0\n if (i >= 1) {\n lines[i] = lines[i - 1] + \" {\";\n if (this.NEWLINEAFTERBRACET && lines.length > (i + 1) && lines[i + 1].length > 0)\n lines.insert(i + 1, \"\");\n lines.remove(i - 1);\n }\n }\n }\n return lines;\n }\n\n perform_indentation(lines) {\n var indented_lines, current_indent, line;\n \"Indents the lines according to their nesting level determined by curly brackets.\";\n indented_lines = [];\n current_indent = 0;\n var iterator1 = lines;\n for (var index1 = 0; index1 < iterator1.length; index1++) {\n line = iterator1[index1];\n if (!line.startsWith(\"#\") && line.endsWith(\"}\") && current_indent > 0) {\n current_indent -= 1;\n }\n if (line !== \"\") {\n indented_lines.push(this.INDENTATION.repeat(current_indent) + line);\n } else {\n indented_lines.push(\"\");\n }\n if (!line.startsWith(\"#\") && line.endsWith(\"{\")) {\n current_indent += 1;\n }\n }\n return indented_lines;\n }\n }\n\n\n //////// POLYFILLS /////////\n if (!String.prototype.trim) {\n String.prototype.trim = function() {\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n };\n }\n\n if (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n }\n if (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n }\n if (!String.prototype.includes) {\n String.prototype.includes = function(search, start) {\n 'use strict';\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > this.length) {\n return false;\n } else {\n return this.indexOf(search, start) !== -1;\n }\n };\n }\n\n if (!String.prototype.repeat) {\n String.prototype.repeat = function(count) {\n 'use strict';\n if (this == null) {\n throw new TypeError('can\\'t convert ' + this + ' to object');\n }\n var str = '' + this;\n count = +count;\n if (count != count) {\n count = 0;\n }\n if (count < 0) {\n throw new RangeError('repeat count must be non-negative');\n }\n if (count == Infinity) {\n throw new RangeError('repeat count must be less than infinity');\n }\n count = Math.floor(count);\n if (str.length == 0 || count == 0) {\n return '';\n }\n // Ensuring count is a 31-bit integer allows us to heavily optimize the\n // main part. But anyway, most current (August 2014) browsers can't handle\n // strings 1 << 28 chars or longer, so:\n if (str.length * count >= 1 << 28) {\n throw new RangeError('repeat count must not overflow maximum string size');\n }\n var rpt = '';\n for (;;) {\n if ((count & 1) == 1) {\n rpt += str;\n }\n count >>>= 1;\n if (count == 0) {\n break;\n }\n str += str;\n }\n // Could we try:\n // return Array(count + 1).join(this);\n return rpt;\n }\n }\n\n\n if (!Array.prototype.remove) {\n Array.prototype.remove = function(index, item) {\n this.splice(index, 1);\n };\n\n }\n\n if (!String.prototype.contains) {\n String.prototype.contains = String.prototype.includes;\n }\n\n if (!Array.prototype.insert) {\n Array.prototype.insert = function(index, item) {\n this.splice(index, 0, item);\n };\n }\n ///////// END POLYFILLS //////////\n\n module.exports = Beautifier;\n})();\n","import Beautify from 'nginxbeautify';\n\nconst textarea = document.getElementById('textarea');\nconst form = document.getElementById('form');\n\nform.addEventListener('submit', function (e) {\n e.preventDefault();\n const tabs = parseInt(document.getElementById('tabs').value);\n const spaces = parseInt(document.getElementById('spaces').value);\n const dontJoinCurlyBracet = document.getElementById('dontJoinCurlyBracet').checked;\n\n const beautifier = new Beautify({ spaces, tabs, dontJoinCurlyBracet});\n textarea.value = beautifier.parse(textarea.value);\n return false;\n});\n"],"names":["$ddd4f49689801e15$var$hasOwn","Object","prototype","hasOwnProperty","$ddd4f49689801e15$var$toStr","toString","$ddd4f49689801e15$var$defineProperty","defineProperty","$ddd4f49689801e15$var$gOPD","getOwnPropertyDescriptor","$ddd4f49689801e15$var$isArray","arr","Array","isArray","call","$ddd4f49689801e15$var$isPlainObject","obj","key","hasOwnConstructor","hasIsPrototypeOf","constructor","$ddd4f49689801e15$var$setProperty","target","options","name","enumerable","configurable","value","newValue","writable","$ddd4f49689801e15$var$getProperty","module","exports","extend","src","copy","copyIsArray","clone","arguments","i","length","deep","parcelRequire","String","trim","this","replace","startsWith","searchString","position","substr","endsWith","subjectString","isFinite","Math","floor","lastIndex","indexOf","includes","search","start","repeat","count","TypeError","str","RangeError","Infinity","rpt","remove","index","item","splice","contains","insert","$53fb5b2fba16a44e$exports","parse","string","fileContents","cleanLines","clean_lines","dontJoinCurlyBracet","join_opening_bracket","perform_indentation","join","extractTextBySeperator","input","seperator1","seperator2","undefined","seperator1Regex","RegExp","seperator2Regex","catchRegex","test","match","extractAllPossibleText","extracted","textInBetween","cnt","placeHolder","inputHidden","getRestored","textToFix","strip_line","single_line","trimmed","removedQuatations","configContents","splittedByLines","split","newline","l2","line","slice","lines","NEWLINEAFTERBRACET","indented_lines","current_indent","iterator1","index1","push","INDENTATION","customOptions","spaces","tabs","$5ea9d3ddee2c9b94$var$textarea","document","getElementById","addEventListener","e","preventDefault","parseInt","checked","beautifier","$parcel$interopDefault"],"version":3,"file":"index.fa8f28b8.js.map"} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | NGINX Beautifier
Options


NGINX config content
--------------------------------------------------------------------------------