Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql-formatter

Package Overview
Dependencies
Maintainers
2
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-formatter - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

4

dist/sql-formatter.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sqlFormatter=t():e.sqlFormatter=t()}(this,function(){return function(e){function t(n){if(E[n])return E[n].exports;var r=E[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var E={};return t.m=e,t.c=E,t.p="",t(0)}([function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(18),o=n(r),T=E(19),R=n(T),i=E(20),N=n(i);t["default"]={format:function(e,t){switch(t=t||{},t.language){case"db2":return new o["default"](t).format(e);case"n1ql":return new R["default"](t).format(e);case"sql":case void 0:return new N["default"](t).format(e);default:throw Error("Unsupported SQL dialect: "+t.language)}}},e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0,t["default"]=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,E){var n=E(38),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();e.exports=o},function(e,t,E){function n(e,t){var E=o(e,t);return r(E)?E:void 0}var r=E(32),o=E(40);e.exports=n},function(e,t){function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=E},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(65),R=n(T),i=E(7),N=n(i),u=E(15),I=n(u),O=E(16),A=n(O),S=E(17),s=n(S),a=function(){function e(t,E){(0,o["default"])(this,e),this.cfg=t||{},this.indentation=new I["default"](this.cfg.indent),this.inlineBlock=new A["default"],this.params=new s["default"](this.cfg.params),this.tokenizer=E,this.previousReservedWord={}}return e.prototype.format=function(e){var t=this.tokenizer.tokenize(e),E=this.getFormattedQueryFromTokens(t);return E.trim()},e.prototype.getFormattedQueryFromTokens=function(e){var t=this,E="";return e.forEach(function(n,r){n.type!==N["default"].WHITESPACE&&(n.type===N["default"].LINE_COMMENT?E=t.formatLineComment(n,E):n.type===N["default"].BLOCK_COMMENT?E=t.formatBlockComment(n,E):n.type===N["default"].RESERVED_TOPLEVEL?(E=t.formatToplevelReservedWord(n,E),t.previousReservedWord=n):n.type===N["default"].RESERVED_NEWLINE?(E=t.formatNewlineReservedWord(n,E),t.previousReservedWord=n):n.type===N["default"].RESERVED?(E=t.formatWithSpaces(n,E),t.previousReservedWord=n):E=n.type===N["default"].OPEN_PAREN?t.formatOpeningParentheses(e,r,E):n.type===N["default"].CLOSE_PAREN?t.formatClosingParentheses(n,E):n.type===N["default"].PLACEHOLDER?t.formatPlaceholder(n,E):","===n.value?t.formatComma(n,E):":"===n.value?t.formatWithSpaceAfter(n,E):"."===n.value||";"===n.value?t.formatWithoutSpaces(n,E):t.formatWithSpaces(n,E))}),E},e.prototype.formatLineComment=function(e,t){return this.addNewline(t+e.value)},e.prototype.formatBlockComment=function(e,t){return this.addNewline(this.addNewline(t)+this.indentComment(e.value))},e.prototype.indentComment=function(e){return e.replace(/\n/g,"\n"+this.indentation.getIndent())},e.prototype.formatToplevelReservedWord=function(e,t){return this.indentation.decreaseTopLevel(),t=this.addNewline(t),this.indentation.increaseToplevel(),t+=this.equalizeWhitespace(e.value),this.addNewline(t)},e.prototype.formatNewlineReservedWord=function(e,t){return this.addNewline(t)+this.equalizeWhitespace(e.value)+" "},e.prototype.equalizeWhitespace=function(e){return e.replace(/\s+/g," ")},e.prototype.formatOpeningParentheses=function(e,t,E){var n=e[t-1];return n&&n.type!==N["default"].WHITESPACE&&n.type!==N["default"].OPEN_PAREN&&(E=(0,R["default"])(E)),E+=e[t].value,this.inlineBlock.beginIfPossible(e,t),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E},e.prototype.formatClosingParentheses=function(e,t){return this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,t)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(t)))},e.prototype.formatPlaceholder=function(e,t){return t+this.params.get(e)+" "},e.prototype.formatComma=function(e,t){return t=(0,R["default"])(t)+e.value+" ",this.inlineBlock.isActive()?t:/^LIMIT$/i.test(this.previousReservedWord.value)?t:this.addNewline(t)},e.prototype.formatWithSpaceAfter=function(e,t){return(0,R["default"])(t)+e.value+" "},e.prototype.formatWithoutSpaces=function(e,t){return(0,R["default"])(t)+e.value},e.prototype.formatWithSpaces=function(e,t){return t+e.value+" "},e.prototype.addNewline=function(e){return(0,R["default"])(e)+"\n"+this.indentation.getIndent()},e}();t["default"]=a,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(57),R=n(T),i=E(52),N=n(i),u=E(7),I=n(u),O=function(){function e(t){(0,o["default"])(this,e),this.WHITESPACE_REGEX=/^(\s+)/,this.NUMBER_REGEX=/^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/,this.OPERATOR_REGEX=/^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|.)/,this.BLOCK_COMMENT_REGEX=/^(\/\*[^]*?(?:\*\/|$))/,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(t.lineCommentTypes),this.RESERVED_TOPLEVEL_REGEX=this.createReservedWordRegex(t.reservedToplevelWords),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(t.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(t.reservedWords),this.WORD_REGEX=this.createWordRegex(t.specialWordChars),this.STRING_REGEX=this.createStringRegex(t.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(t.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(t.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.namedPlaceholderTypes,this.createStringPattern(t.stringTypes))}return e.prototype.createLineCommentRegex=function(e){return RegExp("^((?:"+e.map(function(e){return(0,N["default"])(e)}).join("|")+").*?(?:\n|$))")},e.prototype.createReservedWordRegex=function(e){var t=e.join("|").replace(/ /g,"\\s+");return RegExp("^("+t+")\\b","i")},e.prototype.createWordRegex=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return RegExp("^([\\w"+e.join("")+"]+)")},e.prototype.createStringRegex=function(e){return RegExp("^("+this.createStringPattern(e)+")")},e.prototype.createStringPattern=function(e){var t={"``":"((`[^`]*($|`))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map(function(e){return t[e]}).join("|")},e.prototype.createParenRegex=function(e){return RegExp("^("+e.map(function(e){return(0,N["default"])(e)}).join("|")+")")},e.prototype.createPlaceholderRegex=function(e,t){if((0,R["default"])(e))return!1;var E=e.map(N["default"]).join("|");return RegExp("^((?:"+E+")(?:"+t+"))")},e.prototype.tokenize=function(e){for(var t=[],E=void 0;e.length;)E=this.getNextToken(e,E),e=e.substring(E.value.length),t.push(E);return t},e.prototype.getNextToken=function(e,t){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,t)||this.getWordToken(e)||this.getOperatorToken(e)},e.prototype.getWhitespaceToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].WHITESPACE,regex:this.WHITESPACE_REGEX})},e.prototype.getCommentToken=function(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)},e.prototype.getLineCommentToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})},e.prototype.getBlockCommentToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})},e.prototype.getStringToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].STRING,regex:this.STRING_REGEX})},e.prototype.getOpenParenToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})},e.prototype.getCloseParenToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})},e.prototype.getPlaceholderToken=function(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)},e.prototype.getIdentNamedPlaceholderToken=function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})},e.prototype.getStringNamedPlaceholderToken=function(e){var t=this;return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return t.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})}})},e.prototype.getIndexedPlaceholderToken=function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})},e.prototype.getPlaceholderTokenWithKey=function(e){var t=e.input,E=e.regex,n=e.parseKey,r=this.getTokenOnFirstMatch({input:t,regex:E,type:I["default"].PLACEHOLDER});return r&&(r.key=n(r.value)),r},e.prototype.getEscapedPlaceholderKey=function(e){var t=e.key,E=e.quoteChar;return t.replace(RegExp((0,N["default"])("\\")+E,"g"),E)},e.prototype.getNumberToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].NUMBER,regex:this.NUMBER_REGEX})},e.prototype.getOperatorToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].OPERATOR,regex:this.OPERATOR_REGEX})},e.prototype.getReservedWordToken=function(e,t){if(!t||!t.value||"."!==t.value)return this.getToplevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getPlainReservedToken(e)},e.prototype.getToplevelReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED_TOPLEVEL,regex:this.RESERVED_TOPLEVEL_REGEX})},e.prototype.getNewlineReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})},e.prototype.getPlainReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED,regex:this.RESERVED_PLAIN_REGEX})},e.prototype.getWordToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].WORD,regex:this.WORD_REGEX})},e.prototype.getTokenOnFirstMatch=function(e){var t=e.input,E=e.type,n=e.regex,r=t.match(n);if(r)return{type:E,value:r[1]}},e}();t["default"]=O,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0,t["default"]={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOPLEVEL:"reserved-toplevel",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"},e.exports=t["default"]},function(e,t,E){function n(e){return null!=e&&o(e.length)&&!r(e)}var r=E(12),o=E(58);e.exports=n},function(e,t,E){function n(e){return null==e?"":r(e)}var r=E(10);e.exports=n},function(e,t,E){function n(e){if("string"==typeof e)return e;if(o(e))return i?i.call(e):"";var t=e+"";return"0"==t&&1/e==-T?"-0":t}var r=E(25),o=E(14),T=1/0,R=r?r.prototype:void 0,i=R?R.toString:void 0;e.exports=n},function(e,t){function E(e){if(null!=e){try{return r.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var n=Function.prototype,r=n.toString;e.exports=E},function(e,t,E){function n(e){var t=r(e)?i.call(e):"";return t==o||t==T}var r=E(4),o="[object Function]",T="[object GeneratorFunction]",R=Object.prototype,i=R.toString;e.exports=n},function(e,t){function E(e){return null!=e&&"object"==typeof e}e.exports=E},function(e,t,E){function n(e){return"symbol"==typeof e||r(e)&&R.call(e)==o}var r=E(13),o="[object Symbol]",T=Object.prototype,R=T.toString;e.exports=n},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(60),R=n(T),i=E(59),N=n(i),u="top-level",I="block-level",O=function(){function e(t){(0,o["default"])(this,e),this.indent=t||" ",this.indentTypes=[]}return e.prototype.getIndent=function(){return(0,R["default"])(this.indent,this.indentTypes.length)},e.prototype.increaseToplevel=function(){this.indentTypes.push(u)},e.prototype.increaseBlockLevel=function(){this.indentTypes.push(I)},e.prototype.decreaseTopLevel=function(){(0,N["default"])(this.indentTypes)===u&&this.indentTypes.pop()},e.prototype.decreaseBlockLevel=function(){for(;this.indentTypes.length>0;){var e=this.indentTypes.pop();if(e!==u)break}},e}();t["default"]=O,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(7),R=n(T),i=50,N=function(){function e(){(0,o["default"])(this,e),this.level=0}return e.prototype.beginIfPossible=function(e,t){0===this.level&&this.isInlineBlock(e,t)?this.level=1:this.level>0?this.level++:this.level=0},e.prototype.end=function(){this.level--},e.prototype.isActive=function(){return this.level>0},e.prototype.isInlineBlock=function(e,t){for(var E=0,n=0,r=t;e.length>r;r++){var o=e[r];if(E+=o.value.length,E>i)return!1;if(o.type===R["default"].OPEN_PAREN)n++;else if(o.type===R["default"].CLOSE_PAREN&&(n--,0===n))return!0;if(this.isForbiddenToken(o))return!1}return!1},e.prototype.isForbiddenToken=function(e){var t=e.type,E=e.value;return t===R["default"].RESERVED_TOPLEVEL||t===R["default"].RESERVED_NEWLINE||t===R["default"].COMMENT||t===R["default"].BLOCK_COMMENT||";"===E},e}();t["default"]=N,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=function(){function e(t){(0,o["default"])(this,e),this.params=t,this.index=0}return e.prototype.get=function(e){var t=e.key,E=e.value;return this.params?t?this.params[t]:this.params[this.index++]:E},e}();t["default"]=T,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],I=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UPDATE","VALUES","WHERE"],O=["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],I=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],O=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],I=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],O=["AND","CROSS APPLY","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"N''","''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){var n=E(3),r=E(2),o=n(r,"DataView");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Map");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Promise");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Set");e.exports=o},function(e,t,E){var n=E(2),r=n.Symbol;e.exports=r},function(e,t,E){var n=E(3),r=E(2),o=n(r,"WeakMap");e.exports=o},function(e,t){function E(e){return e.split("")}e.exports=E},function(e,t){function E(e,t,E,n){for(var r=e.length,o=E+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}e.exports=E},function(e,t){function E(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=E},function(e,t,E){function n(e,t,E){return t===t?T(e,t,E):r(e,o,E)}var r=E(28),o=E(31),T=E(48);e.exports=n},function(e,t){function E(e){return e!==e}e.exports=E},function(e,t,E){function n(e){if(!T(e)||o(e))return!1;var t=r(e)?S:N;return t.test(R(e))}var r=E(12),o=E(44),T=E(4),R=E(11),i=/[\\^$.*+?()[\]{}|]/g,N=/^\[object .+?Constructor\]$/,u=Function.prototype,I=Object.prototype,O=u.toString,A=I.hasOwnProperty,S=RegExp("^"+O.call(A).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t){function E(e,t){var E="";if(!e||1>t||t>n)return E;do t%2&&(E+=e),t=r(t/2),t&&(e+=e);while(t);return E}var n=9007199254740991,r=Math.floor;e.exports=E},function(e,t){function E(e,t,E){var n=-1,r=e.length;0>t&&(t=-t>r?0:r+t),E=E>r?r:E,0>E&&(E+=r),r=t>E?0:E-t>>>0,t>>>=0;for(var o=Array(r);++n<r;)o[n]=e[n+t];return o}e.exports=E},function(e,t,E){function n(e,t,E){var n=e.length;return E=void 0===E?n:E,t||n>E?r(e,t,E):e}var r=E(34);e.exports=n},function(e,t,E){function n(e,t){for(var E=e.length;E--&&r(t,e[E],0)>-1;);return E}var r=E(30);e.exports=n},function(e,t,E){var n=E(2),r=n["__core-js_shared__"];e.exports=r},function(e,t){(function(t){var E="object"==typeof t&&t&&t.Object===Object&&t;e.exports=E}).call(t,function(){return this}())},function(e,t,E){var n=E(21),r=E(22),o=E(23),T=E(24),R=E(26),i=E(29),N=E(11),u="[object Map]",I="[object Object]",O="[object Promise]",A="[object Set]",S="[object WeakMap]",s="[object DataView]",a=Object.prototype,f=a.toString,L=N(n),c=N(r),p=N(o),C=N(T),l=N(R),d=i;(n&&d(new n(new ArrayBuffer(1)))!=s||r&&d(new r)!=u||o&&d(o.resolve())!=O||T&&d(new T)!=A||R&&d(new R)!=S)&&(d=function(e){var t=f.call(e),E=t==I?e.constructor:void 0,n=E?N(E):void 0;if(n)switch(n){case L:return s;case c:return u;case p:return O;case C:return A;case l:return S}return t}),e.exports=d},function(e,t){function E(e,t){return null==e?void 0:e[t]}e.exports=E},function(e,t){function E(e){return i.test(e)}var n="\\ud800-\\udfff",r="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",T="\\ufe0e\\ufe0f",R="\\u200d",i=RegExp("["+R+n+r+o+T+"]");e.exports=E},function(e,t){function E(e,t){return t=null==t?n:t,!!t&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&t>e}var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=E},function(e,t,E){function n(e,t,E){if(!R(E))return!1;var n=typeof t;return!!("number"==n?o(E)&&T(t,E.length):"string"==n&&t in E)&&r(E[t],e)}var r=E(51),o=E(8),T=E(42),R=E(4);e.exports=n},function(e,t,E){function n(e){return!!o&&o in e}var r=E(37),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){function E(e){var t=e&&e.constructor,E="function"==typeof t&&t.prototype||n;return e===E}var n=Object.prototype;e.exports=E},function(e,t,E){var n=E(47),r=n(Object.keys,Object);e.exports=r},function(e,t){function E(e,t){return function(E){return e(t(E))}}e.exports=E},function(e,t){function E(e,t,E){for(var n=E-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}e.exports=E},function(e,t,E){function n(e){return o(e)?T(e):r(e)}var r=E(27),o=E(41),T=E(50);e.exports=n},function(e,t){function E(e){return e.match(p)||[]}var n="\\ud800-\\udfff",r="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",T="\\ufe0e\\ufe0f",R="["+n+"]",i="["+r+o+"]",N="\\ud83c[\\udffb-\\udfff]",u="(?:"+i+"|"+N+")",I="[^"+n+"]",O="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",S="\\u200d",s=u+"?",a="["+T+"]?",f="(?:"+S+"(?:"+[I,O,A].join("|")+")"+a+s+")*",L=a+s+f,c="(?:"+[I+i+"?",i,O,A,R].join("|")+")",p=RegExp(N+"(?="+N+")|"+c+L,"g");e.exports=E},function(e,t){function E(e,t){return e===t||e!==e&&t!==t}e.exports=E},function(e,t,E){function n(e){return e=r(e),e&&T.test(e)?e.replace(o,"\\$&"):e}var r=E(9),o=/[\\^$.*+?()[\]{}|]/g,T=RegExp(o.source);e.exports=n},function(e,t,E){function n(e){return r(e)&&R.call(e,"callee")&&(!N.call(e,"callee")||i.call(e)==o)}var r=E(55),o="[object Arguments]",T=Object.prototype,R=T.hasOwnProperty,i=T.toString,N=T.propertyIsEnumerable;e.exports=n},function(e,t){var E=Array.isArray;e.exports=E},function(e,t,E){function n(e){return o(e)&&r(e)}var r=E(8),o=E(13);e.exports=n},function(e,t,E){(function(e){var n=E(2),r=E(61),o="object"==typeof t&&t&&!t.nodeType&&t,T=o&&"object"==typeof e&&e&&!e.nodeType&&e,R=T&&T.exports===o,i=R?n.Buffer:void 0,N=i?i.isBuffer:void 0,u=N||r;e.exports=u}).call(t,E(66)(e))},function(e,t,E){function n(e){if(R(e)&&(T(e)||"string"==typeof e||"function"==typeof e.splice||i(e)||o(e)))return!e.length;var t=r(e);
if(t==I||t==O)return!e.size;if(N(e))return!u(e).length;for(var E in e)if(S.call(e,E))return!1;return!0}var r=E(39),o=E(53),T=E(54),R=E(8),i=E(56),N=E(45),u=E(46),I="[object Map]",O="[object Set]",A=Object.prototype,S=A.hasOwnProperty;e.exports=n},function(e,t){function E(e){return"number"==typeof e&&e>-1&&e%1==0&&n>=e}var n=9007199254740991;e.exports=E},function(e,t){function E(e){var t=e?e.length:0;return t?e[t-1]:void 0}e.exports=E},function(e,t,E){function n(e,t,E){return t=(E?o(e,t,E):void 0===t)?1:T(t),r(R(e),t)}var r=E(33),o=E(43),T=E(63),R=E(9);e.exports=n},function(e,t){function E(){return!1}e.exports=E},function(e,t,E){function n(e){if(!e)return 0===e?e:0;if(e=r(e),e===o||e===-o){var t=0>e?-1:1;return t*T}return e===e?e:0}var r=E(64),o=1/0,T=1.7976931348623157e308;e.exports=n},function(e,t,E){function n(e){var t=r(e),E=t%1;return t===t?E?t-E:t:0}var r=E(62);e.exports=n},function(e,t,E){function n(e){if("number"==typeof e)return e;if(o(e))return T;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(R,"");var E=N.test(e);return E||u.test(e)?I(e.slice(2),E?2:8):i.test(e)?T:+e}var r=E(4),o=E(14),T=NaN,R=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,u=/^0o[0-7]+$/i,I=parseInt;e.exports=n},function(e,t,E){function n(e,t,E){if(e=i(e),e&&(E||void 0===t))return e.replace(N,"");if(!e||!(t=r(t)))return e;var n=R(e),u=T(n,R(t))+1;return o(n,0,u).join("")}var r=E(10),o=E(35),T=E(36),R=E(49),i=E(9),N=/\s+$/;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sqlFormatter=t():e.sqlFormatter=t()}(this,function(){return function(e){function t(n){if(E[n])return E[n].exports;var r=E[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var E={};return t.m=e,t.c=E,t.p="",t(0)}([function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(18),o=n(r),T=E(19),R=n(T),i=E(20),N=n(i);t["default"]={format:function(e,t){switch(t=t||{},t.language){case"db2":return new o["default"](t).format(e);case"n1ql":return new R["default"](t).format(e);case"sql":case void 0:return new N["default"](t).format(e);default:throw Error("Unsupported SQL dialect: "+t.language)}}},e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0,t["default"]=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,E){var n=E(38),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();e.exports=o},function(e,t,E){function n(e,t){var E=o(e,t);return r(E)?E:void 0}var r=E(32),o=E(40);e.exports=n},function(e,t){function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=E},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(65),R=n(T),i=E(7),N=n(i),u=E(15),I=n(u),O=E(16),A=n(O),S=E(17),s=n(S),a=function(){function e(t,E){(0,o["default"])(this,e),this.cfg=t||{},this.indentation=new I["default"](this.cfg.indent),this.inlineBlock=new A["default"],this.params=new s["default"](this.cfg.params),this.tokenizer=E,this.previousReservedWord={}}return e.prototype.format=function(e){var t=this.tokenizer.tokenize(e),E=this.getFormattedQueryFromTokens(t);return E.trim()},e.prototype.getFormattedQueryFromTokens=function(e){var t=this,E="";return e.forEach(function(n,r){n.type!==N["default"].WHITESPACE&&(n.type===N["default"].LINE_COMMENT?E=t.formatLineComment(n,E):n.type===N["default"].BLOCK_COMMENT?E=t.formatBlockComment(n,E):n.type===N["default"].RESERVED_TOPLEVEL?(E=t.formatToplevelReservedWord(n,E),t.previousReservedWord=n):n.type===N["default"].RESERVED_NEWLINE?(E=t.formatNewlineReservedWord(n,E),t.previousReservedWord=n):n.type===N["default"].RESERVED?(E=t.formatWithSpaces(n,E),t.previousReservedWord=n):E=n.type===N["default"].OPEN_PAREN?t.formatOpeningParentheses(e,r,E):n.type===N["default"].CLOSE_PAREN?t.formatClosingParentheses(n,E):n.type===N["default"].PLACEHOLDER?t.formatPlaceholder(n,E):","===n.value?t.formatComma(n,E):":"===n.value?t.formatWithSpaceAfter(n,E):"."===n.value||";"===n.value?t.formatWithoutSpaces(n,E):t.formatWithSpaces(n,E))}),E},e.prototype.formatLineComment=function(e,t){return this.addNewline(t+e.value)},e.prototype.formatBlockComment=function(e,t){return this.addNewline(this.addNewline(t)+this.indentComment(e.value))},e.prototype.indentComment=function(e){return e.replace(/\n/g,"\n"+this.indentation.getIndent())},e.prototype.formatToplevelReservedWord=function(e,t){return this.indentation.decreaseTopLevel(),t=this.addNewline(t),this.indentation.increaseToplevel(),t+=this.equalizeWhitespace(e.value),this.addNewline(t)},e.prototype.formatNewlineReservedWord=function(e,t){return this.addNewline(t)+this.equalizeWhitespace(e.value)+" "},e.prototype.equalizeWhitespace=function(e){return e.replace(/\s+/g," ")},e.prototype.formatOpeningParentheses=function(e,t,E){var n=e[t-1];return n&&n.type!==N["default"].WHITESPACE&&n.type!==N["default"].OPEN_PAREN&&(E=(0,R["default"])(E)),E+=e[t].value,this.inlineBlock.beginIfPossible(e,t),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E},e.prototype.formatClosingParentheses=function(e,t){return this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,t)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(t)))},e.prototype.formatPlaceholder=function(e,t){return t+this.params.get(e)+" "},e.prototype.formatComma=function(e,t){return t=(0,R["default"])(t)+e.value+" ",this.inlineBlock.isActive()?t:/^LIMIT$/i.test(this.previousReservedWord.value)?t:this.addNewline(t)},e.prototype.formatWithSpaceAfter=function(e,t){return(0,R["default"])(t)+e.value+" "},e.prototype.formatWithoutSpaces=function(e,t){return(0,R["default"])(t)+e.value},e.prototype.formatWithSpaces=function(e,t){return t+e.value+" "},e.prototype.addNewline=function(e){return(0,R["default"])(e)+"\n"+this.indentation.getIndent()},e}();t["default"]=a,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(57),R=n(T),i=E(52),N=n(i),u=E(7),I=n(u),O=function(){function e(t){(0,o["default"])(this,e),this.WHITESPACE_REGEX=/^(\s+)/,this.NUMBER_REGEX=/^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/,this.OPERATOR_REGEX=/^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/,this.BLOCK_COMMENT_REGEX=/^(\/\*[^]*?(?:\*\/|$))/,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(t.lineCommentTypes),this.RESERVED_TOPLEVEL_REGEX=this.createReservedWordRegex(t.reservedToplevelWords),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(t.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(t.reservedWords),this.WORD_REGEX=this.createWordRegex(t.specialWordChars),this.STRING_REGEX=this.createStringRegex(t.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(t.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(t.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(t.namedPlaceholderTypes,this.createStringPattern(t.stringTypes))}return e.prototype.createLineCommentRegex=function(e){return RegExp("^((?:"+e.map(function(e){return(0,N["default"])(e)}).join("|")+").*?(?:\n|$))")},e.prototype.createReservedWordRegex=function(e){var t=e.join("|").replace(/ /g,"\\s+");return RegExp("^("+t+")\\b","i")},e.prototype.createWordRegex=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return RegExp("^([\\w"+e.join("")+"]+)")},e.prototype.createStringRegex=function(e){return RegExp("^("+this.createStringPattern(e)+")")},e.prototype.createStringPattern=function(e){var t={"``":"((`[^`]*($|`))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map(function(e){return t[e]}).join("|")},e.prototype.createParenRegex=function(e){return RegExp("^("+e.map(function(e){return(0,N["default"])(e)}).join("|")+")")},e.prototype.createPlaceholderRegex=function(e,t){if((0,R["default"])(e))return!1;var E=e.map(N["default"]).join("|");return RegExp("^((?:"+E+")(?:"+t+"))")},e.prototype.tokenize=function(e){for(var t=[],E=void 0;e.length;)E=this.getNextToken(e,E),e=e.substring(E.value.length),t.push(E);return t},e.prototype.getNextToken=function(e,t){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,t)||this.getWordToken(e)||this.getOperatorToken(e)},e.prototype.getWhitespaceToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].WHITESPACE,regex:this.WHITESPACE_REGEX})},e.prototype.getCommentToken=function(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)},e.prototype.getLineCommentToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})},e.prototype.getBlockCommentToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})},e.prototype.getStringToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].STRING,regex:this.STRING_REGEX})},e.prototype.getOpenParenToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})},e.prototype.getCloseParenToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})},e.prototype.getPlaceholderToken=function(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)},e.prototype.getIdentNamedPlaceholderToken=function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})},e.prototype.getStringNamedPlaceholderToken=function(e){var t=this;return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return t.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})}})},e.prototype.getIndexedPlaceholderToken=function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})},e.prototype.getPlaceholderTokenWithKey=function(e){var t=e.input,E=e.regex,n=e.parseKey,r=this.getTokenOnFirstMatch({input:t,regex:E,type:I["default"].PLACEHOLDER});return r&&(r.key=n(r.value)),r},e.prototype.getEscapedPlaceholderKey=function(e){var t=e.key,E=e.quoteChar;return t.replace(RegExp((0,N["default"])("\\")+E,"g"),E)},e.prototype.getNumberToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].NUMBER,regex:this.NUMBER_REGEX})},e.prototype.getOperatorToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].OPERATOR,regex:this.OPERATOR_REGEX})},e.prototype.getReservedWordToken=function(e,t){if(!t||!t.value||"."!==t.value)return this.getToplevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getPlainReservedToken(e)},e.prototype.getToplevelReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED_TOPLEVEL,regex:this.RESERVED_TOPLEVEL_REGEX})},e.prototype.getNewlineReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})},e.prototype.getPlainReservedToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].RESERVED,regex:this.RESERVED_PLAIN_REGEX})},e.prototype.getWordToken=function(e){return this.getTokenOnFirstMatch({input:e,type:I["default"].WORD,regex:this.WORD_REGEX})},e.prototype.getTokenOnFirstMatch=function(e){var t=e.input,E=e.type,n=e.regex,r=t.match(n);if(r)return{type:E,value:r[1]}},e}();t["default"]=O,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0,t["default"]={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOPLEVEL:"reserved-toplevel",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"},e.exports=t["default"]},function(e,t,E){function n(e){return null!=e&&o(e.length)&&!r(e)}var r=E(12),o=E(58);e.exports=n},function(e,t,E){function n(e){return null==e?"":r(e)}var r=E(10);e.exports=n},function(e,t,E){function n(e){if("string"==typeof e)return e;if(o(e))return i?i.call(e):"";var t=e+"";return"0"==t&&1/e==-T?"-0":t}var r=E(25),o=E(14),T=1/0,R=r?r.prototype:void 0,i=R?R.toString:void 0;e.exports=n},function(e,t){function E(e){if(null!=e){try{return r.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var n=Function.prototype,r=n.toString;e.exports=E},function(e,t,E){function n(e){var t=r(e)?i.call(e):"";return t==o||t==T}var r=E(4),o="[object Function]",T="[object GeneratorFunction]",R=Object.prototype,i=R.toString;e.exports=n},function(e,t){function E(e){return null!=e&&"object"==typeof e}e.exports=E},function(e,t,E){function n(e){return"symbol"==typeof e||r(e)&&R.call(e)==o}var r=E(13),o="[object Symbol]",T=Object.prototype,R=T.toString;e.exports=n},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(60),R=n(T),i=E(59),N=n(i),u="top-level",I="block-level",O=function(){function e(t){(0,o["default"])(this,e),this.indent=t||" ",this.indentTypes=[]}return e.prototype.getIndent=function(){return(0,R["default"])(this.indent,this.indentTypes.length)},e.prototype.increaseToplevel=function(){this.indentTypes.push(u)},e.prototype.increaseBlockLevel=function(){this.indentTypes.push(I)},e.prototype.decreaseTopLevel=function(){(0,N["default"])(this.indentTypes)===u&&this.indentTypes.pop()},e.prototype.decreaseBlockLevel=function(){for(;this.indentTypes.length>0;){var e=this.indentTypes.pop();if(e!==u)break}},e}();t["default"]=O,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(7),R=n(T),i=50,N=function(){function e(){(0,o["default"])(this,e),this.level=0}return e.prototype.beginIfPossible=function(e,t){0===this.level&&this.isInlineBlock(e,t)?this.level=1:this.level>0?this.level++:this.level=0},e.prototype.end=function(){this.level--},e.prototype.isActive=function(){return this.level>0},e.prototype.isInlineBlock=function(e,t){for(var E=0,n=0,r=t;e.length>r;r++){var o=e[r];if(E+=o.value.length,E>i)return!1;if(o.type===R["default"].OPEN_PAREN)n++;else if(o.type===R["default"].CLOSE_PAREN&&(n--,0===n))return!0;if(this.isForbiddenToken(o))return!1}return!1},e.prototype.isForbiddenToken=function(e){var t=e.type,E=e.value;return t===R["default"].RESERVED_TOPLEVEL||t===R["default"].RESERVED_NEWLINE||t===R["default"].COMMENT||t===R["default"].BLOCK_COMMENT||";"===E},e}();t["default"]=N,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=function(){function e(t){(0,o["default"])(this,e),this.params=t,this.index=0}return e.prototype.get=function(e){var t=e.key,E=e.value;return this.params?t?this.params[t]:this.params[this.index++]:E},e}();t["default"]=T,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],I=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UPDATE","VALUES","WHERE"],O=["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],I=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],O=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=E(1),o=n(r),T=E(5),R=n(T),i=E(6),N=n(i),u=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],I=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],O=["AND","CROSS APPLY","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],A=void 0,S=function(){function e(t){(0,o["default"])(this,e),this.cfg=t}return e.prototype.format=function(e){return A||(A=new N["default"]({reservedWords:u,reservedToplevelWords:I,reservedNewlineWords:O,stringTypes:['""',"N''","''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new R["default"](this.cfg,A).format(e)},e}();t["default"]=S,e.exports=t["default"]},function(e,t,E){var n=E(3),r=E(2),o=n(r,"DataView");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Map");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Promise");e.exports=o},function(e,t,E){var n=E(3),r=E(2),o=n(r,"Set");e.exports=o},function(e,t,E){var n=E(2),r=n.Symbol;e.exports=r},function(e,t,E){var n=E(3),r=E(2),o=n(r,"WeakMap");e.exports=o},function(e,t){function E(e){return e.split("")}e.exports=E},function(e,t){function E(e,t,E,n){for(var r=e.length,o=E+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}e.exports=E},function(e,t){function E(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=E},function(e,t,E){function n(e,t,E){return t===t?T(e,t,E):r(e,o,E)}var r=E(28),o=E(31),T=E(48);e.exports=n},function(e,t){function E(e){return e!==e}e.exports=E},function(e,t,E){function n(e){if(!T(e)||o(e))return!1;var t=r(e)?S:N;return t.test(R(e))}var r=E(12),o=E(44),T=E(4),R=E(11),i=/[\\^$.*+?()[\]{}|]/g,N=/^\[object .+?Constructor\]$/,u=Function.prototype,I=Object.prototype,O=u.toString,A=I.hasOwnProperty,S=RegExp("^"+O.call(A).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t){function E(e,t){var E="";if(!e||1>t||t>n)return E;do t%2&&(E+=e),t=r(t/2),t&&(e+=e);while(t);return E}var n=9007199254740991,r=Math.floor;e.exports=E},function(e,t){function E(e,t,E){var n=-1,r=e.length;0>t&&(t=-t>r?0:r+t),E=E>r?r:E,0>E&&(E+=r),r=t>E?0:E-t>>>0,t>>>=0;for(var o=Array(r);++n<r;)o[n]=e[n+t];return o}e.exports=E},function(e,t,E){function n(e,t,E){var n=e.length;return E=void 0===E?n:E,t||n>E?r(e,t,E):e}var r=E(34);e.exports=n},function(e,t,E){function n(e,t){for(var E=e.length;E--&&r(t,e[E],0)>-1;);return E}var r=E(30);e.exports=n},function(e,t,E){var n=E(2),r=n["__core-js_shared__"];e.exports=r},function(e,t){(function(t){var E="object"==typeof t&&t&&t.Object===Object&&t;e.exports=E}).call(t,function(){return this}())},function(e,t,E){var n=E(21),r=E(22),o=E(23),T=E(24),R=E(26),i=E(29),N=E(11),u="[object Map]",I="[object Object]",O="[object Promise]",A="[object Set]",S="[object WeakMap]",s="[object DataView]",a=Object.prototype,f=a.toString,L=N(n),c=N(r),p=N(o),C=N(T),l=N(R),d=i;(n&&d(new n(new ArrayBuffer(1)))!=s||r&&d(new r)!=u||o&&d(o.resolve())!=O||T&&d(new T)!=A||R&&d(new R)!=S)&&(d=function(e){var t=f.call(e),E=t==I?e.constructor:void 0,n=E?N(E):void 0;if(n)switch(n){case L:return s;case c:return u;case p:return O;case C:return A;case l:return S}return t}),e.exports=d},function(e,t){function E(e,t){return null==e?void 0:e[t]}e.exports=E},function(e,t){function E(e){return i.test(e)}var n="\\ud800-\\udfff",r="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",T="\\ufe0e\\ufe0f",R="\\u200d",i=RegExp("["+R+n+r+o+T+"]");e.exports=E},function(e,t){function E(e,t){return t=null==t?n:t,!!t&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&t>e}var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=E},function(e,t,E){function n(e,t,E){if(!R(E))return!1;var n=typeof t;return!!("number"==n?o(E)&&T(t,E.length):"string"==n&&t in E)&&r(E[t],e)}var r=E(51),o=E(8),T=E(42),R=E(4);e.exports=n},function(e,t,E){function n(e){return!!o&&o in e}var r=E(37),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){function E(e){var t=e&&e.constructor,E="function"==typeof t&&t.prototype||n;return e===E}var n=Object.prototype;e.exports=E},function(e,t,E){var n=E(47),r=n(Object.keys,Object);e.exports=r},function(e,t){function E(e,t){return function(E){return e(t(E))}}e.exports=E},function(e,t){function E(e,t,E){for(var n=E-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}e.exports=E},function(e,t,E){function n(e){return o(e)?T(e):r(e)}var r=E(27),o=E(41),T=E(50);e.exports=n},function(e,t){function E(e){return e.match(p)||[]}var n="\\ud800-\\udfff",r="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",T="\\ufe0e\\ufe0f",R="["+n+"]",i="["+r+o+"]",N="\\ud83c[\\udffb-\\udfff]",u="(?:"+i+"|"+N+")",I="[^"+n+"]",O="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",S="\\u200d",s=u+"?",a="["+T+"]?",f="(?:"+S+"(?:"+[I,O,A].join("|")+")"+a+s+")*",L=a+s+f,c="(?:"+[I+i+"?",i,O,A,R].join("|")+")",p=RegExp(N+"(?="+N+")|"+c+L,"g");e.exports=E},function(e,t){function E(e,t){return e===t||e!==e&&t!==t}e.exports=E},function(e,t,E){function n(e){return e=r(e),e&&T.test(e)?e.replace(o,"\\$&"):e}var r=E(9),o=/[\\^$.*+?()[\]{}|]/g,T=RegExp(o.source);e.exports=n},function(e,t,E){function n(e){return r(e)&&R.call(e,"callee")&&(!N.call(e,"callee")||i.call(e)==o)}var r=E(55),o="[object Arguments]",T=Object.prototype,R=T.hasOwnProperty,i=T.toString,N=T.propertyIsEnumerable;e.exports=n},function(e,t){var E=Array.isArray;e.exports=E},function(e,t,E){function n(e){return o(e)&&r(e)}var r=E(8),o=E(13);e.exports=n},function(e,t,E){(function(e){var n=E(2),r=E(61),o="object"==typeof t&&t&&!t.nodeType&&t,T=o&&"object"==typeof e&&e&&!e.nodeType&&e,R=T&&T.exports===o,i=R?n.Buffer:void 0,N=i?i.isBuffer:void 0,u=N||r;e.exports=u}).call(t,E(66)(e))},function(e,t,E){function n(e){if(R(e)&&(T(e)||"string"==typeof e||"function"==typeof e.splice||i(e)||o(e)))return!e.length;
var t=r(e);if(t==I||t==O)return!e.size;if(N(e))return!u(e).length;for(var E in e)if(S.call(e,E))return!1;return!0}var r=E(39),o=E(53),T=E(54),R=E(8),i=E(56),N=E(45),u=E(46),I="[object Map]",O="[object Set]",A=Object.prototype,S=A.hasOwnProperty;e.exports=n},function(e,t){function E(e){return"number"==typeof e&&e>-1&&e%1==0&&n>=e}var n=9007199254740991;e.exports=E},function(e,t){function E(e){var t=e?e.length:0;return t?e[t-1]:void 0}e.exports=E},function(e,t,E){function n(e,t,E){return t=(E?o(e,t,E):void 0===t)?1:T(t),r(R(e),t)}var r=E(33),o=E(43),T=E(63),R=E(9);e.exports=n},function(e,t){function E(){return!1}e.exports=E},function(e,t,E){function n(e){if(!e)return 0===e?e:0;if(e=r(e),e===o||e===-o){var t=0>e?-1:1;return t*T}return e===e?e:0}var r=E(64),o=1/0,T=1.7976931348623157e308;e.exports=n},function(e,t,E){function n(e){var t=r(e),E=t%1;return t===t?E?t-E:t:0}var r=E(62);e.exports=n},function(e,t,E){function n(e){if("number"==typeof e)return e;if(o(e))return T;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(R,"");var E=N.test(e);return E||u.test(e)?I(e.slice(2),E?2:8):i.test(e)?T:+e}var r=E(4),o=E(14),T=NaN,R=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,u=/^0o[0-7]+$/i,I=parseInt;e.exports=n},function(e,t,E){function n(e,t,E){if(e=i(e),e&&(E||void 0===t))return e.replace(N,"");if(!e||!(t=r(t)))return e;var n=R(e),u=T(n,R(t))+1;return o(n,0,u).join("")}var r=E(10),o=E(35),T=E(36),R=E(49),i=E(9),N=/\s+$/;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])});

@@ -42,3 +42,3 @@ "use strict";

this.NUMBER_REGEX = /^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/;
this.OPERATOR_REGEX = /^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|.)/;
this.OPERATOR_REGEX = /^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/;

@@ -45,0 +45,0 @@ this.BLOCK_COMMENT_REGEX = /^(\/\*[^]*?(?:\*\/|$))/;

{
"name": "sql-formatter",
"version": "2.1.1",
"version": "2.1.2",
"description": "Formats whitespaces in a SQL query to make it more readable",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -22,3 +22,3 @@ import isEmpty from "lodash/isEmpty";

this.NUMBER_REGEX = /^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/;
this.OPERATOR_REGEX = /^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|.)/;
this.OPERATOR_REGEX = /^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/;

@@ -25,0 +25,0 @@ this.BLOCK_COMMENT_REGEX = /^(\/\*[^]*?(?:\*\/|$))/;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc