UNPKG

109 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["sqlFormatter"] = factory();
8 else
9 root["sqlFormatter"] = factory();
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId])
20/******/ return installedModules[moduleId].exports;
21
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ exports: {},
25/******/ id: moduleId,
26/******/ loaded: false
27/******/ };
28
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32/******/ // Flag the module as loaded
33/******/ module.loaded = true;
34
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38
39
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45
46/******/ // __webpack_public_path__
47/******/ __webpack_require__.p = "";
48
49/******/ // Load entry module and return exports
50/******/ return __webpack_require__(0);
51/******/ })
52/************************************************************************/
53/******/ ([
54/* 0 */
55/***/ (function(module, exports, __webpack_require__) {
56
57 "use strict";
58
59 exports.__esModule = true;
60
61 var _Db2Formatter = __webpack_require__(25);
62
63 var _Db2Formatter2 = _interopRequireDefault(_Db2Formatter);
64
65 var _N1qlFormatter = __webpack_require__(26);
66
67 var _N1qlFormatter2 = _interopRequireDefault(_N1qlFormatter);
68
69 var _PlSqlFormatter = __webpack_require__(27);
70
71 var _PlSqlFormatter2 = _interopRequireDefault(_PlSqlFormatter);
72
73 var _StandardSqlFormatter = __webpack_require__(28);
74
75 var _StandardSqlFormatter2 = _interopRequireDefault(_StandardSqlFormatter);
76
77 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
78
79 exports["default"] = {
80 /**
81 * Format whitespaces in a query to make it easier to read.
82 *
83 * @param {String} query
84 * @param {Object} cfg
85 * @param {String} cfg.language Query language, default is Standard SQL
86 * @param {String} cfg.indent Characters used for indentation, default is " " (2 spaces)
87 * @param {Object} cfg.params Collection of params for placeholder replacement
88 * @return {String}
89 */
90 format: function format(query, cfg) {
91 cfg = cfg || {};
92
93 switch (cfg.language) {
94 case "db2":
95 return new _Db2Formatter2["default"](cfg).format(query);
96 case "n1ql":
97 return new _N1qlFormatter2["default"](cfg).format(query);
98 case "pl/sql":
99 return new _PlSqlFormatter2["default"](cfg).format(query);
100 case "sql":
101 case undefined:
102 return new _StandardSqlFormatter2["default"](cfg).format(query);
103 default:
104 throw Error("Unsupported SQL dialect: " + cfg.language);
105 }
106 }
107 };
108 module.exports = exports["default"];
109
110/***/ }),
111/* 1 */
112/***/ (function(module, exports) {
113
114 "use strict";
115
116 exports.__esModule = true;
117
118 exports.default = function (instance, Constructor) {
119 if (!(instance instanceof Constructor)) {
120 throw new TypeError("Cannot call a class as a function");
121 }
122 };
123
124/***/ }),
125/* 2 */
126/***/ (function(module, exports, __webpack_require__) {
127
128 var freeGlobal = __webpack_require__(13);
129
130 /** Detect free variable `self`. */
131 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
132
133 /** Used as a reference to the global object. */
134 var root = freeGlobal || freeSelf || Function('return this')();
135
136 module.exports = root;
137
138
139/***/ }),
140/* 3 */
141/***/ (function(module, exports, __webpack_require__) {
142
143 var Symbol = __webpack_require__(10),
144 getRawTag = __webpack_require__(49),
145 objectToString = __webpack_require__(58);
146
147 /** `Object#toString` result references. */
148 var nullTag = '[object Null]',
149 undefinedTag = '[object Undefined]';
150
151 /** Built-in value references. */
152 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
153
154 /**
155 * The base implementation of `getTag` without fallbacks for buggy environments.
156 *
157 * @private
158 * @param {*} value The value to query.
159 * @returns {string} Returns the `toStringTag`.
160 */
161 function baseGetTag(value) {
162 if (value == null) {
163 return value === undefined ? undefinedTag : nullTag;
164 }
165 return (symToStringTag && symToStringTag in Object(value))
166 ? getRawTag(value)
167 : objectToString(value);
168 }
169
170 module.exports = baseGetTag;
171
172
173/***/ }),
174/* 4 */
175/***/ (function(module, exports, __webpack_require__) {
176
177 var baseIsNative = __webpack_require__(40),
178 getValue = __webpack_require__(51);
179
180 /**
181 * Gets the native function at `key` of `object`.
182 *
183 * @private
184 * @param {Object} object The object to query.
185 * @param {string} key The key of the method to get.
186 * @returns {*} Returns the function if it's native, else `undefined`.
187 */
188 function getNative(object, key) {
189 var value = getValue(object, key);
190 return baseIsNative(value) ? value : undefined;
191 }
192
193 module.exports = getNative;
194
195
196/***/ }),
197/* 5 */
198/***/ (function(module, exports, __webpack_require__) {
199
200 "use strict";
201
202 exports.__esModule = true;
203
204 var _classCallCheck2 = __webpack_require__(1);
205
206 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
207
208 var _trimEnd = __webpack_require__(75);
209
210 var _trimEnd2 = _interopRequireDefault(_trimEnd);
211
212 var _tokenTypes = __webpack_require__(9);
213
214 var _tokenTypes2 = _interopRequireDefault(_tokenTypes);
215
216 var _Indentation = __webpack_require__(22);
217
218 var _Indentation2 = _interopRequireDefault(_Indentation);
219
220 var _InlineBlock = __webpack_require__(23);
221
222 var _InlineBlock2 = _interopRequireDefault(_InlineBlock);
223
224 var _Params = __webpack_require__(24);
225
226 var _Params2 = _interopRequireDefault(_Params);
227
228 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
229
230 var Formatter = function () {
231 /**
232 * @param {Object} cfg
233 * @param {Object} cfg.indent
234 * @param {Object} cfg.params
235 * @param {Tokenizer} tokenizer
236 */
237 function Formatter(cfg, tokenizer) {
238 (0, _classCallCheck3["default"])(this, Formatter);
239
240 this.cfg = cfg || {};
241 this.indentation = new _Indentation2["default"](this.cfg.indent);
242 this.inlineBlock = new _InlineBlock2["default"]();
243 this.params = new _Params2["default"](this.cfg.params);
244 this.tokenizer = tokenizer;
245 this.previousReservedWord = {};
246 }
247
248 /**
249 * Formats whitespaces in a SQL string to make it easier to read.
250 *
251 * @param {String} query The SQL query string
252 * @return {String} formatted query
253 */
254
255
256 Formatter.prototype.format = function format(query) {
257 var tokens = this.tokenizer.tokenize(query);
258 var formattedQuery = this.getFormattedQueryFromTokens(tokens);
259
260 return formattedQuery.trim();
261 };
262
263 Formatter.prototype.getFormattedQueryFromTokens = function getFormattedQueryFromTokens(tokens) {
264 var _this = this;
265
266 var formattedQuery = "";
267
268 tokens.forEach(function (token, index) {
269 if (token.type === _tokenTypes2["default"].WHITESPACE) {
270 return;
271 } else if (token.type === _tokenTypes2["default"].LINE_COMMENT) {
272 formattedQuery = _this.formatLineComment(token, formattedQuery);
273 } else if (token.type === _tokenTypes2["default"].BLOCK_COMMENT) {
274 formattedQuery = _this.formatBlockComment(token, formattedQuery);
275 } else if (token.type === _tokenTypes2["default"].RESERVED_TOPLEVEL) {
276 formattedQuery = _this.formatToplevelReservedWord(token, formattedQuery);
277 _this.previousReservedWord = token;
278 } else if (token.type === _tokenTypes2["default"].RESERVED_NEWLINE) {
279 formattedQuery = _this.formatNewlineReservedWord(token, formattedQuery);
280 _this.previousReservedWord = token;
281 } else if (token.type === _tokenTypes2["default"].RESERVED) {
282 formattedQuery = _this.formatWithSpaces(token, formattedQuery);
283 _this.previousReservedWord = token;
284 } else if (token.type === _tokenTypes2["default"].OPEN_PAREN) {
285 formattedQuery = _this.formatOpeningParentheses(tokens, index, formattedQuery);
286 } else if (token.type === _tokenTypes2["default"].CLOSE_PAREN) {
287 formattedQuery = _this.formatClosingParentheses(token, formattedQuery);
288 } else if (token.type === _tokenTypes2["default"].PLACEHOLDER) {
289 formattedQuery = _this.formatPlaceholder(token, formattedQuery);
290 } else if (token.value === ",") {
291 formattedQuery = _this.formatComma(token, formattedQuery);
292 } else if (token.value === ":") {
293 formattedQuery = _this.formatWithSpaceAfter(token, formattedQuery);
294 } else if (token.value === "." || token.value === ";") {
295 formattedQuery = _this.formatWithoutSpaces(token, formattedQuery);
296 } else {
297 formattedQuery = _this.formatWithSpaces(token, formattedQuery);
298 }
299 });
300 return formattedQuery;
301 };
302
303 Formatter.prototype.formatLineComment = function formatLineComment(token, query) {
304 return this.addNewline(query + token.value);
305 };
306
307 Formatter.prototype.formatBlockComment = function formatBlockComment(token, query) {
308 return this.addNewline(this.addNewline(query) + this.indentComment(token.value));
309 };
310
311 Formatter.prototype.indentComment = function indentComment(comment) {
312 return comment.replace(/\n/g, "\n" + this.indentation.getIndent());
313 };
314
315 Formatter.prototype.formatToplevelReservedWord = function formatToplevelReservedWord(token, query) {
316 this.indentation.decreaseTopLevel();
317
318 query = this.addNewline(query);
319
320 this.indentation.increaseToplevel();
321
322 query += this.equalizeWhitespace(token.value);
323 return this.addNewline(query);
324 };
325
326 Formatter.prototype.formatNewlineReservedWord = function formatNewlineReservedWord(token, query) {
327 return this.addNewline(query) + this.equalizeWhitespace(token.value) + " ";
328 };
329
330 // Replace any sequence of whitespace characters with single space
331
332
333 Formatter.prototype.equalizeWhitespace = function equalizeWhitespace(string) {
334 return string.replace(/\s+/g, " ");
335 };
336
337 // Opening parentheses increase the block indent level and start a new line
338
339
340 Formatter.prototype.formatOpeningParentheses = function formatOpeningParentheses(tokens, index, query) {
341 // Take out the preceding space unless there was whitespace there in the original query or another opening parens
342 var previousToken = tokens[index - 1];
343 if (previousToken && previousToken.type !== _tokenTypes2["default"].WHITESPACE && previousToken.type !== _tokenTypes2["default"].OPEN_PAREN) {
344 query = (0, _trimEnd2["default"])(query);
345 }
346 query += tokens[index].value;
347
348 this.inlineBlock.beginIfPossible(tokens, index);
349
350 if (!this.inlineBlock.isActive()) {
351 this.indentation.increaseBlockLevel();
352 query = this.addNewline(query);
353 }
354 return query;
355 };
356
357 // Closing parentheses decrease the block indent level
358
359
360 Formatter.prototype.formatClosingParentheses = function formatClosingParentheses(token, query) {
361 if (this.inlineBlock.isActive()) {
362 this.inlineBlock.end();
363 return this.formatWithSpaceAfter(token, query);
364 } else {
365 this.indentation.decreaseBlockLevel();
366 return this.formatWithSpaces(token, this.addNewline(query));
367 }
368 };
369
370 Formatter.prototype.formatPlaceholder = function formatPlaceholder(token, query) {
371 return query + this.params.get(token) + " ";
372 };
373
374 // Commas start a new line (unless within inline parentheses or SQL "LIMIT" clause)
375
376
377 Formatter.prototype.formatComma = function formatComma(token, query) {
378 query = (0, _trimEnd2["default"])(query) + token.value + " ";
379
380 if (this.inlineBlock.isActive()) {
381 return query;
382 } else if (/^LIMIT$/i.test(this.previousReservedWord.value)) {
383 return query;
384 } else {
385 return this.addNewline(query);
386 }
387 };
388
389 Formatter.prototype.formatWithSpaceAfter = function formatWithSpaceAfter(token, query) {
390 return (0, _trimEnd2["default"])(query) + token.value + " ";
391 };
392
393 Formatter.prototype.formatWithoutSpaces = function formatWithoutSpaces(token, query) {
394 return (0, _trimEnd2["default"])(query) + token.value;
395 };
396
397 Formatter.prototype.formatWithSpaces = function formatWithSpaces(token, query) {
398 return query + token.value + " ";
399 };
400
401 Formatter.prototype.addNewline = function addNewline(query) {
402 return (0, _trimEnd2["default"])(query) + "\n" + this.indentation.getIndent();
403 };
404
405 return Formatter;
406 }();
407
408 exports["default"] = Formatter;
409 module.exports = exports["default"];
410
411/***/ }),
412/* 6 */
413/***/ (function(module, exports, __webpack_require__) {
414
415 "use strict";
416
417 exports.__esModule = true;
418
419 var _classCallCheck2 = __webpack_require__(1);
420
421 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
422
423 var _isEmpty = __webpack_require__(67);
424
425 var _isEmpty2 = _interopRequireDefault(_isEmpty);
426
427 var _escapeRegExp = __webpack_require__(64);
428
429 var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
430
431 var _tokenTypes = __webpack_require__(9);
432
433 var _tokenTypes2 = _interopRequireDefault(_tokenTypes);
434
435 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
436
437 var Tokenizer = function () {
438 /**
439 * @param {Object} cfg
440 * @param {String[]} cfg.reservedWords Reserved words in SQL
441 * @param {String[]} cfg.reservedToplevelWords Words that are set to new line separately
442 * @param {String[]} cfg.reservedNewlineWords Words that are set to newline
443 * @param {String[]} cfg.stringTypes String types to enable: "", '', ``, [], N''
444 * @param {String[]} cfg.openParens Opening parentheses to enable, like (, [
445 * @param {String[]} cfg.closeParens Closing parentheses to enable, like ), ]
446 * @param {String[]} cfg.indexedPlaceholderTypes Prefixes for indexed placeholders, like ?
447 * @param {String[]} cfg.namedPlaceholderTypes Prefixes for named placeholders, like @ and :
448 * @param {String[]} cfg.lineCommentTypes Line comments to enable, like # and --
449 * @param {String[]} cfg.specialWordChars Special chars that can be found inside of words, like @ and #
450 */
451 function Tokenizer(cfg) {
452 (0, _classCallCheck3["default"])(this, Tokenizer);
453
454 this.WHITESPACE_REGEX = /^(\s+)/;
455 this.NUMBER_REGEX = /^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/;
456 this.OPERATOR_REGEX = /^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/;
457
458 this.BLOCK_COMMENT_REGEX = /^(\/\*[^]*?(?:\*\/|$))/;
459 this.LINE_COMMENT_REGEX = this.createLineCommentRegex(cfg.lineCommentTypes);
460
461 this.RESERVED_TOPLEVEL_REGEX = this.createReservedWordRegex(cfg.reservedToplevelWords);
462 this.RESERVED_NEWLINE_REGEX = this.createReservedWordRegex(cfg.reservedNewlineWords);
463 this.RESERVED_PLAIN_REGEX = this.createReservedWordRegex(cfg.reservedWords);
464
465 this.WORD_REGEX = this.createWordRegex(cfg.specialWordChars);
466 this.STRING_REGEX = this.createStringRegex(cfg.stringTypes);
467
468 this.OPEN_PAREN_REGEX = this.createParenRegex(cfg.openParens);
469 this.CLOSE_PAREN_REGEX = this.createParenRegex(cfg.closeParens);
470
471 this.INDEXED_PLACEHOLDER_REGEX = this.createPlaceholderRegex(cfg.indexedPlaceholderTypes, "[0-9]*");
472 this.IDENT_NAMED_PLACEHOLDER_REGEX = this.createPlaceholderRegex(cfg.namedPlaceholderTypes, "[a-zA-Z0-9._$]+");
473 this.STRING_NAMED_PLACEHOLDER_REGEX = this.createPlaceholderRegex(cfg.namedPlaceholderTypes, this.createStringPattern(cfg.stringTypes));
474 }
475
476 Tokenizer.prototype.createLineCommentRegex = function createLineCommentRegex(lineCommentTypes) {
477 return new RegExp("^((?:" + lineCommentTypes.map(function (c) {
478 return (0, _escapeRegExp2["default"])(c);
479 }).join("|") + ").*?(?:\n|$))");
480 };
481
482 Tokenizer.prototype.createReservedWordRegex = function createReservedWordRegex(reservedWords) {
483 var reservedWordsPattern = reservedWords.join("|").replace(/ /g, "\\s+");
484 return new RegExp("^(" + reservedWordsPattern + ")\\b", "i");
485 };
486
487 Tokenizer.prototype.createWordRegex = function createWordRegex() {
488 var specialChars = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
489
490 return new RegExp("^([\\w" + specialChars.join("") + "]+)");
491 };
492
493 Tokenizer.prototype.createStringRegex = function createStringRegex(stringTypes) {
494 return new RegExp("^(" + this.createStringPattern(stringTypes) + ")");
495 };
496
497 // This enables the following string patterns:
498 // 1. backtick quoted string using `` to escape
499 // 2. square bracket quoted string (SQL Server) using ]] to escape
500 // 3. double quoted string using "" or \" to escape
501 // 4. single quoted string using '' or \' to escape
502 // 5. national character quoted string using N'' or N\' to escape
503
504
505 Tokenizer.prototype.createStringPattern = function createStringPattern(stringTypes) {
506 var patterns = {
507 "``": "((`[^`]*($|`))+)",
508 "[]": "((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",
509 "\"\"": "((\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*(\"|$))+)",
510 "''": "(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)",
511 "N''": "((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"
512 };
513
514 return stringTypes.map(function (t) {
515 return patterns[t];
516 }).join("|");
517 };
518
519 Tokenizer.prototype.createParenRegex = function createParenRegex(parens) {
520 return new RegExp("^(" + parens.map(function (p) {
521 return (0, _escapeRegExp2["default"])(p);
522 }).join("|") + ")");
523 };
524
525 Tokenizer.prototype.createPlaceholderRegex = function createPlaceholderRegex(types, pattern) {
526 if ((0, _isEmpty2["default"])(types)) {
527 return false;
528 }
529 var typesRegex = types.map(_escapeRegExp2["default"]).join("|");
530
531 return new RegExp("^((?:" + typesRegex + ")(?:" + pattern + "))");
532 };
533
534 /**
535 * Takes a SQL string and breaks it into tokens.
536 * Each token is an object with type and value.
537 *
538 * @param {String} input The SQL string
539 * @return {Object[]} tokens An array of tokens.
540 * @return {String} token.type
541 * @return {String} token.value
542 */
543
544
545 Tokenizer.prototype.tokenize = function tokenize(input) {
546 var tokens = [];
547 var token = void 0;
548
549 // Keep processing the string until it is empty
550 while (input.length) {
551 // Get the next token and the token type
552 token = this.getNextToken(input, token);
553 // Advance the string
554 input = input.substring(token.value.length);
555
556 tokens.push(token);
557 }
558 return tokens;
559 };
560
561 Tokenizer.prototype.getNextToken = function getNextToken(input, previousToken) {
562 return this.getWhitespaceToken(input) || this.getCommentToken(input) || this.getStringToken(input) || this.getOpenParenToken(input) || this.getCloseParenToken(input) || this.getPlaceholderToken(input) || this.getNumberToken(input) || this.getReservedWordToken(input, previousToken) || this.getWordToken(input) || this.getOperatorToken(input);
563 };
564
565 Tokenizer.prototype.getWhitespaceToken = function getWhitespaceToken(input) {
566 return this.getTokenOnFirstMatch({
567 input: input,
568 type: _tokenTypes2["default"].WHITESPACE,
569 regex: this.WHITESPACE_REGEX
570 });
571 };
572
573 Tokenizer.prototype.getCommentToken = function getCommentToken(input) {
574 return this.getLineCommentToken(input) || this.getBlockCommentToken(input);
575 };
576
577 Tokenizer.prototype.getLineCommentToken = function getLineCommentToken(input) {
578 return this.getTokenOnFirstMatch({
579 input: input,
580 type: _tokenTypes2["default"].LINE_COMMENT,
581 regex: this.LINE_COMMENT_REGEX
582 });
583 };
584
585 Tokenizer.prototype.getBlockCommentToken = function getBlockCommentToken(input) {
586 return this.getTokenOnFirstMatch({
587 input: input,
588 type: _tokenTypes2["default"].BLOCK_COMMENT,
589 regex: this.BLOCK_COMMENT_REGEX
590 });
591 };
592
593 Tokenizer.prototype.getStringToken = function getStringToken(input) {
594 return this.getTokenOnFirstMatch({
595 input: input,
596 type: _tokenTypes2["default"].STRING,
597 regex: this.STRING_REGEX
598 });
599 };
600
601 Tokenizer.prototype.getOpenParenToken = function getOpenParenToken(input) {
602 return this.getTokenOnFirstMatch({
603 input: input,
604 type: _tokenTypes2["default"].OPEN_PAREN,
605 regex: this.OPEN_PAREN_REGEX
606 });
607 };
608
609 Tokenizer.prototype.getCloseParenToken = function getCloseParenToken(input) {
610 return this.getTokenOnFirstMatch({
611 input: input,
612 type: _tokenTypes2["default"].CLOSE_PAREN,
613 regex: this.CLOSE_PAREN_REGEX
614 });
615 };
616
617 Tokenizer.prototype.getPlaceholderToken = function getPlaceholderToken(input) {
618 return this.getIdentNamedPlaceholderToken(input) || this.getStringNamedPlaceholderToken(input) || this.getIndexedPlaceholderToken(input);
619 };
620
621 Tokenizer.prototype.getIdentNamedPlaceholderToken = function getIdentNamedPlaceholderToken(input) {
622 return this.getPlaceholderTokenWithKey({
623 input: input,
624 regex: this.IDENT_NAMED_PLACEHOLDER_REGEX,
625 parseKey: function parseKey(v) {
626 return v.slice(1);
627 }
628 });
629 };
630
631 Tokenizer.prototype.getStringNamedPlaceholderToken = function getStringNamedPlaceholderToken(input) {
632 var _this = this;
633
634 return this.getPlaceholderTokenWithKey({
635 input: input,
636 regex: this.STRING_NAMED_PLACEHOLDER_REGEX,
637 parseKey: function parseKey(v) {
638 return _this.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) });
639 }
640 });
641 };
642
643 Tokenizer.prototype.getIndexedPlaceholderToken = function getIndexedPlaceholderToken(input) {
644 return this.getPlaceholderTokenWithKey({
645 input: input,
646 regex: this.INDEXED_PLACEHOLDER_REGEX,
647 parseKey: function parseKey(v) {
648 return v.slice(1);
649 }
650 });
651 };
652
653 Tokenizer.prototype.getPlaceholderTokenWithKey = function getPlaceholderTokenWithKey(_ref) {
654 var input = _ref.input,
655 regex = _ref.regex,
656 parseKey = _ref.parseKey;
657
658 var token = this.getTokenOnFirstMatch({ input: input, regex: regex, type: _tokenTypes2["default"].PLACEHOLDER });
659 if (token) {
660 token.key = parseKey(token.value);
661 }
662 return token;
663 };
664
665 Tokenizer.prototype.getEscapedPlaceholderKey = function getEscapedPlaceholderKey(_ref2) {
666 var key = _ref2.key,
667 quoteChar = _ref2.quoteChar;
668
669 return key.replace(new RegExp((0, _escapeRegExp2["default"])("\\") + quoteChar, "g"), quoteChar);
670 };
671
672 // Decimal, binary, or hex numbers
673
674
675 Tokenizer.prototype.getNumberToken = function getNumberToken(input) {
676 return this.getTokenOnFirstMatch({
677 input: input,
678 type: _tokenTypes2["default"].NUMBER,
679 regex: this.NUMBER_REGEX
680 });
681 };
682
683 // Punctuation and symbols
684
685
686 Tokenizer.prototype.getOperatorToken = function getOperatorToken(input) {
687 return this.getTokenOnFirstMatch({
688 input: input,
689 type: _tokenTypes2["default"].OPERATOR,
690 regex: this.OPERATOR_REGEX
691 });
692 };
693
694 Tokenizer.prototype.getReservedWordToken = function getReservedWordToken(input, previousToken) {
695 // A reserved word cannot be preceded by a "."
696 // this makes it so in "mytable.from", "from" is not considered a reserved word
697 if (previousToken && previousToken.value && previousToken.value === ".") {
698 return;
699 }
700 return this.getToplevelReservedToken(input) || this.getNewlineReservedToken(input) || this.getPlainReservedToken(input);
701 };
702
703 Tokenizer.prototype.getToplevelReservedToken = function getToplevelReservedToken(input) {
704 return this.getTokenOnFirstMatch({
705 input: input,
706 type: _tokenTypes2["default"].RESERVED_TOPLEVEL,
707 regex: this.RESERVED_TOPLEVEL_REGEX
708 });
709 };
710
711 Tokenizer.prototype.getNewlineReservedToken = function getNewlineReservedToken(input) {
712 return this.getTokenOnFirstMatch({
713 input: input,
714 type: _tokenTypes2["default"].RESERVED_NEWLINE,
715 regex: this.RESERVED_NEWLINE_REGEX
716 });
717 };
718
719 Tokenizer.prototype.getPlainReservedToken = function getPlainReservedToken(input) {
720 return this.getTokenOnFirstMatch({
721 input: input,
722 type: _tokenTypes2["default"].RESERVED,
723 regex: this.RESERVED_PLAIN_REGEX
724 });
725 };
726
727 Tokenizer.prototype.getWordToken = function getWordToken(input) {
728 return this.getTokenOnFirstMatch({
729 input: input,
730 type: _tokenTypes2["default"].WORD,
731 regex: this.WORD_REGEX
732 });
733 };
734
735 Tokenizer.prototype.getTokenOnFirstMatch = function getTokenOnFirstMatch(_ref3) {
736 var input = _ref3.input,
737 type = _ref3.type,
738 regex = _ref3.regex;
739
740 var matches = input.match(regex);
741
742 if (matches) {
743 return { type: type, value: matches[1] };
744 }
745 };
746
747 return Tokenizer;
748 }();
749
750 exports["default"] = Tokenizer;
751 module.exports = exports["default"];
752
753/***/ }),
754/* 7 */
755/***/ (function(module, exports) {
756
757 /**
758 * Checks if `value` is the
759 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
760 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
761 *
762 * @static
763 * @memberOf _
764 * @since 0.1.0
765 * @category Lang
766 * @param {*} value The value to check.
767 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
768 * @example
769 *
770 * _.isObject({});
771 * // => true
772 *
773 * _.isObject([1, 2, 3]);
774 * // => true
775 *
776 * _.isObject(_.noop);
777 * // => true
778 *
779 * _.isObject(null);
780 * // => false
781 */
782 function isObject(value) {
783 var type = typeof value;
784 return value != null && (type == 'object' || type == 'function');
785 }
786
787 module.exports = isObject;
788
789
790/***/ }),
791/* 8 */
792/***/ (function(module, exports) {
793
794 /**
795 * Checks if `value` is object-like. A value is object-like if it's not `null`
796 * and has a `typeof` result of "object".
797 *
798 * @static
799 * @memberOf _
800 * @since 4.0.0
801 * @category Lang
802 * @param {*} value The value to check.
803 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
804 * @example
805 *
806 * _.isObjectLike({});
807 * // => true
808 *
809 * _.isObjectLike([1, 2, 3]);
810 * // => true
811 *
812 * _.isObjectLike(_.noop);
813 * // => false
814 *
815 * _.isObjectLike(null);
816 * // => false
817 */
818 function isObjectLike(value) {
819 return value != null && typeof value == 'object';
820 }
821
822 module.exports = isObjectLike;
823
824
825/***/ }),
826/* 9 */
827/***/ (function(module, exports) {
828
829 "use strict";
830
831 exports.__esModule = true;
832 /**
833 * Constants for token types
834 */
835 exports["default"] = {
836 WHITESPACE: "whitespace",
837 WORD: "word",
838 STRING: "string",
839 RESERVED: "reserved",
840 RESERVED_TOPLEVEL: "reserved-toplevel",
841 RESERVED_NEWLINE: "reserved-newline",
842 OPERATOR: "operator",
843 OPEN_PAREN: "open-paren",
844 CLOSE_PAREN: "close-paren",
845 LINE_COMMENT: "line-comment",
846 BLOCK_COMMENT: "block-comment",
847 NUMBER: "number",
848 PLACEHOLDER: "placeholder"
849 };
850 module.exports = exports["default"];
851
852/***/ }),
853/* 10 */
854/***/ (function(module, exports, __webpack_require__) {
855
856 var root = __webpack_require__(2);
857
858 /** Built-in value references. */
859 var Symbol = root.Symbol;
860
861 module.exports = Symbol;
862
863
864/***/ }),
865/* 11 */
866/***/ (function(module, exports, __webpack_require__) {
867
868 var baseToString = __webpack_require__(12);
869
870 /**
871 * Converts `value` to a string. An empty string is returned for `null`
872 * and `undefined` values. The sign of `-0` is preserved.
873 *
874 * @static
875 * @memberOf _
876 * @since 4.0.0
877 * @category Lang
878 * @param {*} value The value to convert.
879 * @returns {string} Returns the converted string.
880 * @example
881 *
882 * _.toString(null);
883 * // => ''
884 *
885 * _.toString(-0);
886 * // => '-0'
887 *
888 * _.toString([1, 2, 3]);
889 * // => '1,2,3'
890 */
891 function toString(value) {
892 return value == null ? '' : baseToString(value);
893 }
894
895 module.exports = toString;
896
897
898/***/ }),
899/* 12 */
900/***/ (function(module, exports, __webpack_require__) {
901
902 var Symbol = __webpack_require__(10),
903 arrayMap = __webpack_require__(34),
904 isArray = __webpack_require__(16),
905 isSymbol = __webpack_require__(20);
906
907 /** Used as references for various `Number` constants. */
908 var INFINITY = 1 / 0;
909
910 /** Used to convert symbols to primitives and strings. */
911 var symbolProto = Symbol ? Symbol.prototype : undefined,
912 symbolToString = symbolProto ? symbolProto.toString : undefined;
913
914 /**
915 * The base implementation of `_.toString` which doesn't convert nullish
916 * values to empty strings.
917 *
918 * @private
919 * @param {*} value The value to process.
920 * @returns {string} Returns the string.
921 */
922 function baseToString(value) {
923 // Exit early for strings to avoid a performance hit in some environments.
924 if (typeof value == 'string') {
925 return value;
926 }
927 if (isArray(value)) {
928 // Recursively convert values (susceptible to call stack limits).
929 return arrayMap(value, baseToString) + '';
930 }
931 if (isSymbol(value)) {
932 return symbolToString ? symbolToString.call(value) : '';
933 }
934 var result = (value + '');
935 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
936 }
937
938 module.exports = baseToString;
939
940
941/***/ }),
942/* 13 */
943/***/ (function(module, exports) {
944
945 /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
946 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
947
948 module.exports = freeGlobal;
949
950 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
951
952/***/ }),
953/* 14 */
954/***/ (function(module, exports) {
955
956 /** Used for built-in method references. */
957 var objectProto = Object.prototype;
958
959 /**
960 * Checks if `value` is likely a prototype object.
961 *
962 * @private
963 * @param {*} value The value to check.
964 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
965 */
966 function isPrototype(value) {
967 var Ctor = value && value.constructor,
968 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
969
970 return value === proto;
971 }
972
973 module.exports = isPrototype;
974
975
976/***/ }),
977/* 15 */
978/***/ (function(module, exports) {
979
980 /** Used for built-in method references. */
981 var funcProto = Function.prototype;
982
983 /** Used to resolve the decompiled source of functions. */
984 var funcToString = funcProto.toString;
985
986 /**
987 * Converts `func` to its source code.
988 *
989 * @private
990 * @param {Function} func The function to convert.
991 * @returns {string} Returns the source code.
992 */
993 function toSource(func) {
994 if (func != null) {
995 try {
996 return funcToString.call(func);
997 } catch (e) {}
998 try {
999 return (func + '');
1000 } catch (e) {}
1001 }
1002 return '';
1003 }
1004
1005 module.exports = toSource;
1006
1007
1008/***/ }),
1009/* 16 */
1010/***/ (function(module, exports) {
1011
1012 /**
1013 * Checks if `value` is classified as an `Array` object.
1014 *
1015 * @static
1016 * @memberOf _
1017 * @since 0.1.0
1018 * @category Lang
1019 * @param {*} value The value to check.
1020 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1021 * @example
1022 *
1023 * _.isArray([1, 2, 3]);
1024 * // => true
1025 *
1026 * _.isArray(document.body.children);
1027 * // => false
1028 *
1029 * _.isArray('abc');
1030 * // => false
1031 *
1032 * _.isArray(_.noop);
1033 * // => false
1034 */
1035 var isArray = Array.isArray;
1036
1037 module.exports = isArray;
1038
1039
1040/***/ }),
1041/* 17 */
1042/***/ (function(module, exports, __webpack_require__) {
1043
1044 var isFunction = __webpack_require__(18),
1045 isLength = __webpack_require__(19);
1046
1047 /**
1048 * Checks if `value` is array-like. A value is considered array-like if it's
1049 * not a function and has a `value.length` that's an integer greater than or
1050 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1051 *
1052 * @static
1053 * @memberOf _
1054 * @since 4.0.0
1055 * @category Lang
1056 * @param {*} value The value to check.
1057 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1058 * @example
1059 *
1060 * _.isArrayLike([1, 2, 3]);
1061 * // => true
1062 *
1063 * _.isArrayLike(document.body.children);
1064 * // => true
1065 *
1066 * _.isArrayLike('abc');
1067 * // => true
1068 *
1069 * _.isArrayLike(_.noop);
1070 * // => false
1071 */
1072 function isArrayLike(value) {
1073 return value != null && isLength(value.length) && !isFunction(value);
1074 }
1075
1076 module.exports = isArrayLike;
1077
1078
1079/***/ }),
1080/* 18 */
1081/***/ (function(module, exports, __webpack_require__) {
1082
1083 var baseGetTag = __webpack_require__(3),
1084 isObject = __webpack_require__(7);
1085
1086 /** `Object#toString` result references. */
1087 var asyncTag = '[object AsyncFunction]',
1088 funcTag = '[object Function]',
1089 genTag = '[object GeneratorFunction]',
1090 proxyTag = '[object Proxy]';
1091
1092 /**
1093 * Checks if `value` is classified as a `Function` object.
1094 *
1095 * @static
1096 * @memberOf _
1097 * @since 0.1.0
1098 * @category Lang
1099 * @param {*} value The value to check.
1100 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1101 * @example
1102 *
1103 * _.isFunction(_);
1104 * // => true
1105 *
1106 * _.isFunction(/abc/);
1107 * // => false
1108 */
1109 function isFunction(value) {
1110 if (!isObject(value)) {
1111 return false;
1112 }
1113 // The use of `Object#toString` avoids issues with the `typeof` operator
1114 // in Safari 9 which returns 'object' for typed arrays and other constructors.
1115 var tag = baseGetTag(value);
1116 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1117 }
1118
1119 module.exports = isFunction;
1120
1121
1122/***/ }),
1123/* 19 */
1124/***/ (function(module, exports) {
1125
1126 /** Used as references for various `Number` constants. */
1127 var MAX_SAFE_INTEGER = 9007199254740991;
1128
1129 /**
1130 * Checks if `value` is a valid array-like length.
1131 *
1132 * **Note:** This method is loosely based on
1133 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1134 *
1135 * @static
1136 * @memberOf _
1137 * @since 4.0.0
1138 * @category Lang
1139 * @param {*} value The value to check.
1140 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1141 * @example
1142 *
1143 * _.isLength(3);
1144 * // => true
1145 *
1146 * _.isLength(Number.MIN_VALUE);
1147 * // => false
1148 *
1149 * _.isLength(Infinity);
1150 * // => false
1151 *
1152 * _.isLength('3');
1153 * // => false
1154 */
1155 function isLength(value) {
1156 return typeof value == 'number' &&
1157 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1158 }
1159
1160 module.exports = isLength;
1161
1162
1163/***/ }),
1164/* 20 */
1165/***/ (function(module, exports, __webpack_require__) {
1166
1167 var baseGetTag = __webpack_require__(3),
1168 isObjectLike = __webpack_require__(8);
1169
1170 /** `Object#toString` result references. */
1171 var symbolTag = '[object Symbol]';
1172
1173 /**
1174 * Checks if `value` is classified as a `Symbol` primitive or object.
1175 *
1176 * @static
1177 * @memberOf _
1178 * @since 4.0.0
1179 * @category Lang
1180 * @param {*} value The value to check.
1181 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1182 * @example
1183 *
1184 * _.isSymbol(Symbol.iterator);
1185 * // => true
1186 *
1187 * _.isSymbol('abc');
1188 * // => false
1189 */
1190 function isSymbol(value) {
1191 return typeof value == 'symbol' ||
1192 (isObjectLike(value) && baseGetTag(value) == symbolTag);
1193 }
1194
1195 module.exports = isSymbol;
1196
1197
1198/***/ }),
1199/* 21 */
1200/***/ (function(module, exports) {
1201
1202 module.exports = function(module) {
1203 if(!module.webpackPolyfill) {
1204 module.deprecate = function() {};
1205 module.paths = [];
1206 // module.parent = undefined by default
1207 module.children = [];
1208 module.webpackPolyfill = 1;
1209 }
1210 return module;
1211 }
1212
1213
1214/***/ }),
1215/* 22 */
1216/***/ (function(module, exports, __webpack_require__) {
1217
1218 "use strict";
1219
1220 exports.__esModule = true;
1221
1222 var _classCallCheck2 = __webpack_require__(1);
1223
1224 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1225
1226 var _repeat = __webpack_require__(70);
1227
1228 var _repeat2 = _interopRequireDefault(_repeat);
1229
1230 var _last = __webpack_require__(69);
1231
1232 var _last2 = _interopRequireDefault(_last);
1233
1234 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1235
1236 var INDENT_TYPE_TOP_LEVEL = "top-level";
1237 var INDENT_TYPE_BLOCK_LEVEL = "block-level";
1238
1239 /**
1240 * Manages indentation levels.
1241 *
1242 * There are two types of indentation levels:
1243 *
1244 * - BLOCK_LEVEL : increased by open-parenthesis
1245 * - TOP_LEVEL : increased by RESERVED_TOPLEVEL words
1246 */
1247
1248 var Indentation = function () {
1249 /**
1250 * @param {String} indent Indent value, default is " " (2 spaces)
1251 */
1252 function Indentation(indent) {
1253 (0, _classCallCheck3["default"])(this, Indentation);
1254
1255 this.indent = indent || " ";
1256 this.indentTypes = [];
1257 }
1258
1259 /**
1260 * Returns current indentation string.
1261 * @return {String}
1262 */
1263
1264
1265 Indentation.prototype.getIndent = function getIndent() {
1266 return (0, _repeat2["default"])(this.indent, this.indentTypes.length);
1267 };
1268
1269 /**
1270 * Increases indentation by one top-level indent.
1271 */
1272
1273
1274 Indentation.prototype.increaseToplevel = function increaseToplevel() {
1275 this.indentTypes.push(INDENT_TYPE_TOP_LEVEL);
1276 };
1277
1278 /**
1279 * Increases indentation by one block-level indent.
1280 */
1281
1282
1283 Indentation.prototype.increaseBlockLevel = function increaseBlockLevel() {
1284 this.indentTypes.push(INDENT_TYPE_BLOCK_LEVEL);
1285 };
1286
1287 /**
1288 * Decreases indentation by one top-level indent.
1289 * Does nothing when the previous indent is not top-level.
1290 */
1291
1292
1293 Indentation.prototype.decreaseTopLevel = function decreaseTopLevel() {
1294 if ((0, _last2["default"])(this.indentTypes) === INDENT_TYPE_TOP_LEVEL) {
1295 this.indentTypes.pop();
1296 }
1297 };
1298
1299 /**
1300 * Decreases indentation by one block-level indent.
1301 * If there are top-level indents within the block-level indent,
1302 * throws away these as well.
1303 */
1304
1305
1306 Indentation.prototype.decreaseBlockLevel = function decreaseBlockLevel() {
1307 while (this.indentTypes.length > 0) {
1308 var type = this.indentTypes.pop();
1309 if (type !== INDENT_TYPE_TOP_LEVEL) {
1310 break;
1311 }
1312 }
1313 };
1314
1315 return Indentation;
1316 }();
1317
1318 exports["default"] = Indentation;
1319 module.exports = exports["default"];
1320
1321/***/ }),
1322/* 23 */
1323/***/ (function(module, exports, __webpack_require__) {
1324
1325 "use strict";
1326
1327 exports.__esModule = true;
1328
1329 var _classCallCheck2 = __webpack_require__(1);
1330
1331 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1332
1333 var _tokenTypes = __webpack_require__(9);
1334
1335 var _tokenTypes2 = _interopRequireDefault(_tokenTypes);
1336
1337 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1338
1339 var INLINE_MAX_LENGTH = 50;
1340
1341 /**
1342 * Bookkeeper for inline blocks.
1343 *
1344 * Inline blocks are parenthized expressions that are shorter than INLINE_MAX_LENGTH.
1345 * These blocks are formatted on a single line, unlike longer parenthized
1346 * expressions where open-parenthesis causes newline and increase of indentation.
1347 */
1348
1349 var InlineBlock = function () {
1350 function InlineBlock() {
1351 (0, _classCallCheck3["default"])(this, InlineBlock);
1352
1353 this.level = 0;
1354 }
1355
1356 /**
1357 * Begins inline block when lookahead through upcoming tokens determines
1358 * that the block would be smaller than INLINE_MAX_LENGTH.
1359 * @param {Object[]} tokens Array of all tokens
1360 * @param {Number} index Current token position
1361 */
1362
1363
1364 InlineBlock.prototype.beginIfPossible = function beginIfPossible(tokens, index) {
1365 if (this.level === 0 && this.isInlineBlock(tokens, index)) {
1366 this.level = 1;
1367 } else if (this.level > 0) {
1368 this.level++;
1369 } else {
1370 this.level = 0;
1371 }
1372 };
1373
1374 /**
1375 * Finishes current inline block.
1376 * There might be several nested ones.
1377 */
1378
1379
1380 InlineBlock.prototype.end = function end() {
1381 this.level--;
1382 };
1383
1384 /**
1385 * True when inside an inline block
1386 * @return {Boolean}
1387 */
1388
1389
1390 InlineBlock.prototype.isActive = function isActive() {
1391 return this.level > 0;
1392 };
1393
1394 // Check if this should be an inline parentheses block
1395 // Examples are "NOW()", "COUNT(*)", "int(10)", key(`somecolumn`), DECIMAL(7,2)
1396
1397
1398 InlineBlock.prototype.isInlineBlock = function isInlineBlock(tokens, index) {
1399 var length = 0;
1400 var level = 0;
1401
1402 for (var i = index; i < tokens.length; i++) {
1403 var token = tokens[i];
1404 length += token.value.length;
1405
1406 // Overran max length
1407 if (length > INLINE_MAX_LENGTH) {
1408 return false;
1409 }
1410
1411 if (token.type === _tokenTypes2["default"].OPEN_PAREN) {
1412 level++;
1413 } else if (token.type === _tokenTypes2["default"].CLOSE_PAREN) {
1414 level--;
1415 if (level === 0) {
1416 return true;
1417 }
1418 }
1419
1420 if (this.isForbiddenToken(token)) {
1421 return false;
1422 }
1423 }
1424 return false;
1425 };
1426
1427 // Reserved words that cause newlines, comments and semicolons
1428 // are not allowed inside inline parentheses block
1429
1430
1431 InlineBlock.prototype.isForbiddenToken = function isForbiddenToken(_ref) {
1432 var type = _ref.type,
1433 value = _ref.value;
1434
1435 return type === _tokenTypes2["default"].RESERVED_TOPLEVEL || type === _tokenTypes2["default"].RESERVED_NEWLINE || type === _tokenTypes2["default"].COMMENT || type === _tokenTypes2["default"].BLOCK_COMMENT || value === ";";
1436 };
1437
1438 return InlineBlock;
1439 }();
1440
1441 exports["default"] = InlineBlock;
1442 module.exports = exports["default"];
1443
1444/***/ }),
1445/* 24 */
1446/***/ (function(module, exports, __webpack_require__) {
1447
1448 "use strict";
1449
1450 exports.__esModule = true;
1451
1452 var _classCallCheck2 = __webpack_require__(1);
1453
1454 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1455
1456 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1457
1458 /**
1459 * Handles placeholder replacement with given params.
1460 */
1461 var Params = function () {
1462 /**
1463 * @param {Object} params
1464 */
1465 function Params(params) {
1466 (0, _classCallCheck3["default"])(this, Params);
1467
1468 this.params = params;
1469 this.index = 0;
1470 }
1471
1472 /**
1473 * Returns param value that matches given placeholder with param key.
1474 * @param {Object} token
1475 * @param {String} token.key Placeholder key
1476 * @param {String} token.value Placeholder value
1477 * @return {String} param or token.value when params are missing
1478 */
1479
1480
1481 Params.prototype.get = function get(_ref) {
1482 var key = _ref.key,
1483 value = _ref.value;
1484
1485 if (!this.params) {
1486 return value;
1487 }
1488 if (key) {
1489 return this.params[key];
1490 }
1491 return this.params[this.index++];
1492 };
1493
1494 return Params;
1495 }();
1496
1497 exports["default"] = Params;
1498 module.exports = exports["default"];
1499
1500/***/ }),
1501/* 25 */
1502/***/ (function(module, exports, __webpack_require__) {
1503
1504 "use strict";
1505
1506 exports.__esModule = true;
1507
1508 var _classCallCheck2 = __webpack_require__(1);
1509
1510 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1511
1512 var _Formatter = __webpack_require__(5);
1513
1514 var _Formatter2 = _interopRequireDefault(_Formatter);
1515
1516 var _Tokenizer = __webpack_require__(6);
1517
1518 var _Tokenizer2 = _interopRequireDefault(_Tokenizer);
1519
1520 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1521
1522 var reservedWords = ["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"];
1523
1524 var reservedToplevelWords = ["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"];
1525
1526 var reservedNewlineWords = ["AND", "CROSS JOIN", "INNER JOIN", "JOIN", "LEFT JOIN", "LEFT OUTER JOIN", "OR", "OUTER JOIN", "RIGHT JOIN", "RIGHT OUTER JOIN"];
1527
1528 var tokenizer = void 0;
1529
1530 var Db2Formatter = function () {
1531 /**
1532 * @param {Object} cfg Different set of configurations
1533 */
1534 function Db2Formatter(cfg) {
1535 (0, _classCallCheck3["default"])(this, Db2Formatter);
1536
1537 this.cfg = cfg;
1538 }
1539
1540 /**
1541 * Formats DB2 query to make it easier to read
1542 *
1543 * @param {String} query The DB2 query string
1544 * @return {String} formatted string
1545 */
1546
1547
1548 Db2Formatter.prototype.format = function format(query) {
1549 if (!tokenizer) {
1550 tokenizer = new _Tokenizer2["default"]({
1551 reservedWords: reservedWords,
1552 reservedToplevelWords: reservedToplevelWords,
1553 reservedNewlineWords: reservedNewlineWords,
1554 stringTypes: ["\"\"", "''", "``", "[]"],
1555 openParens: ["("],
1556 closeParens: [")"],
1557 indexedPlaceholderTypes: ["?"],
1558 namedPlaceholderTypes: [":"],
1559 lineCommentTypes: ["--"],
1560 specialWordChars: ["#", "@"]
1561 });
1562 }
1563 return new _Formatter2["default"](this.cfg, tokenizer).format(query);
1564 };
1565
1566 return Db2Formatter;
1567 }();
1568
1569 exports["default"] = Db2Formatter;
1570 module.exports = exports["default"];
1571
1572/***/ }),
1573/* 26 */
1574/***/ (function(module, exports, __webpack_require__) {
1575
1576 "use strict";
1577
1578 exports.__esModule = true;
1579
1580 var _classCallCheck2 = __webpack_require__(1);
1581
1582 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1583
1584 var _Formatter = __webpack_require__(5);
1585
1586 var _Formatter2 = _interopRequireDefault(_Formatter);
1587
1588 var _Tokenizer = __webpack_require__(6);
1589
1590 var _Tokenizer2 = _interopRequireDefault(_Tokenizer);
1591
1592 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1593
1594 var reservedWords = ["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"];
1595
1596 var reservedToplevelWords = ["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"];
1597
1598 var reservedNewlineWords = ["AND", "INNER JOIN", "JOIN", "LEFT JOIN", "LEFT OUTER JOIN", "OR", "OUTER JOIN", "RIGHT JOIN", "RIGHT OUTER JOIN", "XOR"];
1599
1600 var tokenizer = void 0;
1601
1602 var N1qlFormatter = function () {
1603 /**
1604 * @param {Object} cfg Different set of configurations
1605 */
1606 function N1qlFormatter(cfg) {
1607 (0, _classCallCheck3["default"])(this, N1qlFormatter);
1608
1609 this.cfg = cfg;
1610 }
1611
1612 /**
1613 * Format the whitespace in a N1QL string to make it easier to read
1614 *
1615 * @param {String} query The N1QL string
1616 * @return {String} formatted string
1617 */
1618
1619
1620 N1qlFormatter.prototype.format = function format(query) {
1621 if (!tokenizer) {
1622 tokenizer = new _Tokenizer2["default"]({
1623 reservedWords: reservedWords,
1624 reservedToplevelWords: reservedToplevelWords,
1625 reservedNewlineWords: reservedNewlineWords,
1626 stringTypes: ["\"\"", "''", "``"],
1627 openParens: ["(", "[", "{"],
1628 closeParens: [")", "]", "}"],
1629 namedPlaceholderTypes: ["$"],
1630 lineCommentTypes: ["#", "--"]
1631 });
1632 }
1633 return new _Formatter2["default"](this.cfg, tokenizer).format(query);
1634 };
1635
1636 return N1qlFormatter;
1637 }();
1638
1639 exports["default"] = N1qlFormatter;
1640 module.exports = exports["default"];
1641
1642/***/ }),
1643/* 27 */
1644/***/ (function(module, exports, __webpack_require__) {
1645
1646 "use strict";
1647
1648 exports.__esModule = true;
1649
1650 var _classCallCheck2 = __webpack_require__(1);
1651
1652 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1653
1654 var _Formatter = __webpack_require__(5);
1655
1656 var _Formatter2 = _interopRequireDefault(_Formatter);
1657
1658 var _Tokenizer = __webpack_require__(6);
1659
1660 var _Tokenizer2 = _interopRequireDefault(_Tokenizer);
1661
1662 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1663
1664 var reservedWords = ["A", "ACCESSIBLE", "AGENT", "AGGREGATE", "ALL", "ALTER", "ANY", "ARRAY", "AS", "ASC", "AT", "ATTRIBUTE", "AUTHID", "AVG", "BETWEEN", "BFILE_BASE", "BINARY_INTEGER", "BINARY", "BLOB_BASE", "BLOCK", "BODY", "BOOLEAN", "BOTH", "BOUND", "BULK", "BY", "BYTE", "C", "CALL", "CALLING", "CASCADE", "CASE", "CHAR_BASE", "CHAR", "CHARACTER", "CHARSET", "CHARSETFORM", "CHARSETID", "CHECK", "CLOB_BASE", "CLONE", "CLOSE", "CLUSTER", "CLUSTERS", "COALESCE", "COLAUTH", "COLLECT", "COLUMNS", "COMMENT", "COMMIT", "COMMITTED", "COMPILED", "COMPRESS", "CONNECT", "CONSTANT", "CONSTRUCTOR", "CONTEXT", "CONTINUE", "CONVERT", "COUNT", "CRASH", "CREATE", "CREDENTIAL", "CURRENT", "CURRVAL", "CURSOR", "CUSTOMDATUM", "DANGLING", "DATA", "DATE_BASE", "DATE", "DAY", "DECIMAL", "DEFAULT", "DEFINE", "DELETE", "DESC", "DETERMINISTIC", "DIRECTORY", "DISTINCT", "DO", "DOUBLE", "DROP", "DURATION", "ELEMENT", "ELSIF", "EMPTY", "ESCAPE", "EXCEPTIONS", "EXCLUSIVE", "EXECUTE", "EXISTS", "EXIT", "EXTENDS", "EXTERNAL", "EXTRACT", "FALSE", "FETCH", "FINAL", "FIRST", "FIXED", "FLOAT", "FOR", "FORALL", "FORCE", "FROM", "FUNCTION", "GENERAL", "GOTO", "GRANT", "GROUP", "HASH", "HEAP", "HIDDEN", "HOUR", "IDENTIFIED", "IF", "IMMEDIATE", "IN", "INCLUDING", "INDEX", "INDEXES", "INDICATOR", "INDICES", "INFINITE", "INSTANTIABLE", "INT", "INTEGER", "INTERFACE", "INTERVAL", "INTO", "INVALIDATE", "IS", "ISOLATION", "JAVA", "LANGUAGE", "LARGE", "LEADING", "LENGTH", "LEVEL", "LIBRARY", "LIKE", "LIKE2", "LIKE4", "LIKEC", "LIMITED", "LOCAL", "LOCK", "LONG", "MAP", "MAX", "MAXLEN", "MEMBER", "MERGE", "MIN", "MINUS", "MINUTE", "MLSLABEL", "MOD", "MODE", "MONTH", "MULTISET", "NAME", "NAN", "NATIONAL", "NATIVE", "NATURAL", "NATURALN", "NCHAR", "NEW", "NEXTVAL", "NOCOMPRESS", "NOCOPY", "NOT", "NOWAIT", "NULL", "NULLIF", "NUMBER_BASE", "NUMBER", "OBJECT", "OCICOLL", "OCIDATE", "OCIDATETIME", "OCIDURATION", "OCIINTERVAL", "OCILOBLOCATOR", "OCINUMBER", "OCIRAW", "OCIREF", "OCIREFCURSOR", "OCIROWID", "OCISTRING", "OCITYPE", "OF", "OLD", "ON", "ONLY", "OPAQUE", "OPEN", "OPERATOR", "OPTION", "ORACLE", "ORADATA", "ORDER", "ORGANIZATION", "ORLANY", "ORLVARY", "OTHERS", "OUT", "OVERLAPS", "OVERRIDING", "PACKAGE", "PARALLEL_ENABLE", "PARAMETER", "PARAMETERS", "PARENT", "PARTITION", "PASCAL", "PCTFREE", "PIPE", "PIPELINED", "PLS_INTEGER", "PLUGGABLE", "POSITIVE", "POSITIVEN", "PRAGMA", "PRECISION", "PRIOR", "PRIVATE", "PROCEDURE", "PUBLIC", "RAISE", "RANGE", "RAW", "READ", "REAL", "RECORD", "REF", "REFERENCE", "RELEASE", "RELIES_ON", "REM", "REMAINDER", "RENAME", "RESOURCE", "RESULT_CACHE", "RESULT", "RETURN", "RETURNING", "REVERSE", "REVOKE", "ROLLBACK", "ROW", "ROWID", "ROWNUM", "ROWTYPE", "SAMPLE", "SAVE", "SAVEPOINT", "SB1", "SB2", "SB4", "SECOND", "SEGMENT", "SELF", "SEPARATE", "SEQUENCE", "SERIALIZABLE", "SHARE", "SHORT", "SIZE_T", "SIZE", "SMALLINT", "SOME", "SPACE", "SPARSE", "SQL", "SQLCODE", "SQLDATA", "SQLERRM", "SQLNAME", "SQLSTATE", "STANDARD", "START", "STATIC", "STDDEV", "STORED", "STRING", "STRUCT", "STYLE", "SUBMULTISET", "SUBPARTITION", "SUBSTITUTABLE", "SUBTYPE", "SUCCESSFUL", "SUM", "SYNONYM", "SYSDATE", "TABAUTH", "TABLE", "TDO", "THE", "THEN", "TIME", "TIMESTAMP", "TIMEZONE_ABBR", "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TIMEZONE_REGION", "TO", "TRAILING", "TRANSACTION", "TRANSACTIONAL", "TRIGGER", "TRUE", "TRUSTED", "TYPE", "UB1", "UB2", "UB4", "UID", "UNDER", "UNIQUE", "UNPLUG", "UNSIGNED", "UNTRUSTED", "USE", "USER", "USING", "VALIDATE", "VALIST", "VALUE", "VARCHAR", "VARCHAR2", "VARIABLE", "VARIANCE", "VARRAY", "VARYING", "VIEW", "VIEWS", "VOID", "WHENEVER", "WHILE", "WITH", "WORK", "WRAPPED", "WRITE", "YEAR", "ZONE"];
1665
1666 var reservedToplevelWords = ["ADD", "ALTER COLUMN", "ALTER TABLE", "BEGIN", "CONNECT BY", "DECLARE", "DELETE FROM", "DELETE", "END", "EXCEPT", "EXCEPTION", "FETCH FIRST", "FROM", "GROUP BY", "HAVING", "INSERT INTO", "INSERT", "INTERSECT", "LIMIT", "LOOP", "MODIFY", "ORDER BY", "SELECT", "SET CURRENT SCHEMA", "SET SCHEMA", "SET", "START WITH", "UNION ALL", "UNION", "UPDATE", "VALUES", "WHERE"];
1667
1668 var reservedNewlineWords = ["AND", "CROSS APPLY", "CROSS JOIN", "ELSE", "END", "INNER JOIN", "JOIN", "LEFT JOIN", "LEFT OUTER JOIN", "OR", "OUTER APPLY", "OUTER JOIN", "RIGHT JOIN", "RIGHT OUTER JOIN", "WHEN", "XOR"];
1669
1670 var tokenizer = void 0;
1671
1672 var PlSqlFormatter = function () {
1673 /**
1674 * @param {Object} cfg Different set of configurations
1675 */
1676 function PlSqlFormatter(cfg) {
1677 (0, _classCallCheck3["default"])(this, PlSqlFormatter);
1678
1679 this.cfg = cfg;
1680 }
1681
1682 /**
1683 * Format the whitespace in a PL/SQL string to make it easier to read
1684 *
1685 * @param {String} query The PL/SQL string
1686 * @return {String} formatted string
1687 */
1688
1689
1690 PlSqlFormatter.prototype.format = function format(query) {
1691 if (!tokenizer) {
1692 tokenizer = new _Tokenizer2["default"]({
1693 reservedWords: reservedWords,
1694 reservedToplevelWords: reservedToplevelWords,
1695 reservedNewlineWords: reservedNewlineWords,
1696 stringTypes: ["\"\"", "N''", "''", "``"],
1697 openParens: ["(", "CASE"],
1698 closeParens: [")", "END"],
1699 indexedPlaceholderTypes: ["?"],
1700 namedPlaceholderTypes: [":"],
1701 lineCommentTypes: ["--"],
1702 specialWordChars: ["_", "$", "#", ".", "@"]
1703 });
1704 }
1705 return new _Formatter2["default"](this.cfg, tokenizer).format(query);
1706 };
1707
1708 return PlSqlFormatter;
1709 }();
1710
1711 exports["default"] = PlSqlFormatter;
1712 module.exports = exports["default"];
1713
1714/***/ }),
1715/* 28 */
1716/***/ (function(module, exports, __webpack_require__) {
1717
1718 "use strict";
1719
1720 exports.__esModule = true;
1721
1722 var _classCallCheck2 = __webpack_require__(1);
1723
1724 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1725
1726 var _Formatter = __webpack_require__(5);
1727
1728 var _Formatter2 = _interopRequireDefault(_Formatter);
1729
1730 var _Tokenizer = __webpack_require__(6);
1731
1732 var _Tokenizer2 = _interopRequireDefault(_Tokenizer);
1733
1734 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1735
1736 var reservedWords = ["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"];
1737
1738 var reservedToplevelWords = ["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"];
1739
1740 var reservedNewlineWords = ["AND", "CROSS APPLY", "CROSS JOIN", "ELSE", "INNER JOIN", "JOIN", "LEFT JOIN", "LEFT OUTER JOIN", "OR", "OUTER APPLY", "OUTER JOIN", "RIGHT JOIN", "RIGHT OUTER JOIN", "WHEN", "XOR"];
1741
1742 var tokenizer = void 0;
1743
1744 var StandardSqlFormatter = function () {
1745 /**
1746 * @param {Object} cfg Different set of configurations
1747 */
1748 function StandardSqlFormatter(cfg) {
1749 (0, _classCallCheck3["default"])(this, StandardSqlFormatter);
1750
1751 this.cfg = cfg;
1752 }
1753
1754 /**
1755 * Format the whitespace in a Standard SQL string to make it easier to read
1756 *
1757 * @param {String} query The Standard SQL string
1758 * @return {String} formatted string
1759 */
1760
1761
1762 StandardSqlFormatter.prototype.format = function format(query) {
1763 if (!tokenizer) {
1764 tokenizer = new _Tokenizer2["default"]({
1765 reservedWords: reservedWords,
1766 reservedToplevelWords: reservedToplevelWords,
1767 reservedNewlineWords: reservedNewlineWords,
1768 stringTypes: ["\"\"", "N''", "''", "``", "[]"],
1769 openParens: ["(", "CASE"],
1770 closeParens: [")", "END"],
1771 indexedPlaceholderTypes: ["?"],
1772 namedPlaceholderTypes: ["@", ":"],
1773 lineCommentTypes: ["#", "--"]
1774 });
1775 }
1776 return new _Formatter2["default"](this.cfg, tokenizer).format(query);
1777 };
1778
1779 return StandardSqlFormatter;
1780 }();
1781
1782 exports["default"] = StandardSqlFormatter;
1783 module.exports = exports["default"];
1784
1785/***/ }),
1786/* 29 */
1787/***/ (function(module, exports, __webpack_require__) {
1788
1789 var getNative = __webpack_require__(4),
1790 root = __webpack_require__(2);
1791
1792 /* Built-in method references that are verified to be native. */
1793 var DataView = getNative(root, 'DataView');
1794
1795 module.exports = DataView;
1796
1797
1798/***/ }),
1799/* 30 */
1800/***/ (function(module, exports, __webpack_require__) {
1801
1802 var getNative = __webpack_require__(4),
1803 root = __webpack_require__(2);
1804
1805 /* Built-in method references that are verified to be native. */
1806 var Map = getNative(root, 'Map');
1807
1808 module.exports = Map;
1809
1810
1811/***/ }),
1812/* 31 */
1813/***/ (function(module, exports, __webpack_require__) {
1814
1815 var getNative = __webpack_require__(4),
1816 root = __webpack_require__(2);
1817
1818 /* Built-in method references that are verified to be native. */
1819 var Promise = getNative(root, 'Promise');
1820
1821 module.exports = Promise;
1822
1823
1824/***/ }),
1825/* 32 */
1826/***/ (function(module, exports, __webpack_require__) {
1827
1828 var getNative = __webpack_require__(4),
1829 root = __webpack_require__(2);
1830
1831 /* Built-in method references that are verified to be native. */
1832 var Set = getNative(root, 'Set');
1833
1834 module.exports = Set;
1835
1836
1837/***/ }),
1838/* 33 */
1839/***/ (function(module, exports, __webpack_require__) {
1840
1841 var getNative = __webpack_require__(4),
1842 root = __webpack_require__(2);
1843
1844 /* Built-in method references that are verified to be native. */
1845 var WeakMap = getNative(root, 'WeakMap');
1846
1847 module.exports = WeakMap;
1848
1849
1850/***/ }),
1851/* 34 */
1852/***/ (function(module, exports) {
1853
1854 /**
1855 * A specialized version of `_.map` for arrays without support for iteratee
1856 * shorthands.
1857 *
1858 * @private
1859 * @param {Array} [array] The array to iterate over.
1860 * @param {Function} iteratee The function invoked per iteration.
1861 * @returns {Array} Returns the new mapped array.
1862 */
1863 function arrayMap(array, iteratee) {
1864 var index = -1,
1865 length = array == null ? 0 : array.length,
1866 result = Array(length);
1867
1868 while (++index < length) {
1869 result[index] = iteratee(array[index], index, array);
1870 }
1871 return result;
1872 }
1873
1874 module.exports = arrayMap;
1875
1876
1877/***/ }),
1878/* 35 */
1879/***/ (function(module, exports) {
1880
1881 /**
1882 * Converts an ASCII `string` to an array.
1883 *
1884 * @private
1885 * @param {string} string The string to convert.
1886 * @returns {Array} Returns the converted array.
1887 */
1888 function asciiToArray(string) {
1889 return string.split('');
1890 }
1891
1892 module.exports = asciiToArray;
1893
1894
1895/***/ }),
1896/* 36 */
1897/***/ (function(module, exports) {
1898
1899 /**
1900 * The base implementation of `_.findIndex` and `_.findLastIndex` without
1901 * support for iteratee shorthands.
1902 *
1903 * @private
1904 * @param {Array} array The array to inspect.
1905 * @param {Function} predicate The function invoked per iteration.
1906 * @param {number} fromIndex The index to search from.
1907 * @param {boolean} [fromRight] Specify iterating from right to left.
1908 * @returns {number} Returns the index of the matched value, else `-1`.
1909 */
1910 function baseFindIndex(array, predicate, fromIndex, fromRight) {
1911 var length = array.length,
1912 index = fromIndex + (fromRight ? 1 : -1);
1913
1914 while ((fromRight ? index-- : ++index < length)) {
1915 if (predicate(array[index], index, array)) {
1916 return index;
1917 }
1918 }
1919 return -1;
1920 }
1921
1922 module.exports = baseFindIndex;
1923
1924
1925/***/ }),
1926/* 37 */
1927/***/ (function(module, exports, __webpack_require__) {
1928
1929 var baseFindIndex = __webpack_require__(36),
1930 baseIsNaN = __webpack_require__(39),
1931 strictIndexOf = __webpack_require__(60);
1932
1933 /**
1934 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1935 *
1936 * @private
1937 * @param {Array} array The array to inspect.
1938 * @param {*} value The value to search for.
1939 * @param {number} fromIndex The index to search from.
1940 * @returns {number} Returns the index of the matched value, else `-1`.
1941 */
1942 function baseIndexOf(array, value, fromIndex) {
1943 return value === value
1944 ? strictIndexOf(array, value, fromIndex)
1945 : baseFindIndex(array, baseIsNaN, fromIndex);
1946 }
1947
1948 module.exports = baseIndexOf;
1949
1950
1951/***/ }),
1952/* 38 */
1953/***/ (function(module, exports, __webpack_require__) {
1954
1955 var baseGetTag = __webpack_require__(3),
1956 isObjectLike = __webpack_require__(8);
1957
1958 /** `Object#toString` result references. */
1959 var argsTag = '[object Arguments]';
1960
1961 /**
1962 * The base implementation of `_.isArguments`.
1963 *
1964 * @private
1965 * @param {*} value The value to check.
1966 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1967 */
1968 function baseIsArguments(value) {
1969 return isObjectLike(value) && baseGetTag(value) == argsTag;
1970 }
1971
1972 module.exports = baseIsArguments;
1973
1974
1975/***/ }),
1976/* 39 */
1977/***/ (function(module, exports) {
1978
1979 /**
1980 * The base implementation of `_.isNaN` without support for number objects.
1981 *
1982 * @private
1983 * @param {*} value The value to check.
1984 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1985 */
1986 function baseIsNaN(value) {
1987 return value !== value;
1988 }
1989
1990 module.exports = baseIsNaN;
1991
1992
1993/***/ }),
1994/* 40 */
1995/***/ (function(module, exports, __webpack_require__) {
1996
1997 var isFunction = __webpack_require__(18),
1998 isMasked = __webpack_require__(55),
1999 isObject = __webpack_require__(7),
2000 toSource = __webpack_require__(15);
2001
2002 /**
2003 * Used to match `RegExp`
2004 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
2005 */
2006 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
2007
2008 /** Used to detect host constructors (Safari). */
2009 var reIsHostCtor = /^\[object .+?Constructor\]$/;
2010
2011 /** Used for built-in method references. */
2012 var funcProto = Function.prototype,
2013 objectProto = Object.prototype;
2014
2015 /** Used to resolve the decompiled source of functions. */
2016 var funcToString = funcProto.toString;
2017
2018 /** Used to check objects for own properties. */
2019 var hasOwnProperty = objectProto.hasOwnProperty;
2020
2021 /** Used to detect if a method is native. */
2022 var reIsNative = RegExp('^' +
2023 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
2024 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
2025 );
2026
2027 /**
2028 * The base implementation of `_.isNative` without bad shim checks.
2029 *
2030 * @private
2031 * @param {*} value The value to check.
2032 * @returns {boolean} Returns `true` if `value` is a native function,
2033 * else `false`.
2034 */
2035 function baseIsNative(value) {
2036 if (!isObject(value) || isMasked(value)) {
2037 return false;
2038 }
2039 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
2040 return pattern.test(toSource(value));
2041 }
2042
2043 module.exports = baseIsNative;
2044
2045
2046/***/ }),
2047/* 41 */
2048/***/ (function(module, exports, __webpack_require__) {
2049
2050 var baseGetTag = __webpack_require__(3),
2051 isLength = __webpack_require__(19),
2052 isObjectLike = __webpack_require__(8);
2053
2054 /** `Object#toString` result references. */
2055 var argsTag = '[object Arguments]',
2056 arrayTag = '[object Array]',
2057 boolTag = '[object Boolean]',
2058 dateTag = '[object Date]',
2059 errorTag = '[object Error]',
2060 funcTag = '[object Function]',
2061 mapTag = '[object Map]',
2062 numberTag = '[object Number]',
2063 objectTag = '[object Object]',
2064 regexpTag = '[object RegExp]',
2065 setTag = '[object Set]',
2066 stringTag = '[object String]',
2067 weakMapTag = '[object WeakMap]';
2068
2069 var arrayBufferTag = '[object ArrayBuffer]',
2070 dataViewTag = '[object DataView]',
2071 float32Tag = '[object Float32Array]',
2072 float64Tag = '[object Float64Array]',
2073 int8Tag = '[object Int8Array]',
2074 int16Tag = '[object Int16Array]',
2075 int32Tag = '[object Int32Array]',
2076 uint8Tag = '[object Uint8Array]',
2077 uint8ClampedTag = '[object Uint8ClampedArray]',
2078 uint16Tag = '[object Uint16Array]',
2079 uint32Tag = '[object Uint32Array]';
2080
2081 /** Used to identify `toStringTag` values of typed arrays. */
2082 var typedArrayTags = {};
2083 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
2084 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
2085 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
2086 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
2087 typedArrayTags[uint32Tag] = true;
2088 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
2089 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
2090 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
2091 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
2092 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
2093 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
2094 typedArrayTags[setTag] = typedArrayTags[stringTag] =
2095 typedArrayTags[weakMapTag] = false;
2096
2097 /**
2098 * The base implementation of `_.isTypedArray` without Node.js optimizations.
2099 *
2100 * @private
2101 * @param {*} value The value to check.
2102 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2103 */
2104 function baseIsTypedArray(value) {
2105 return isObjectLike(value) &&
2106 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2107 }
2108
2109 module.exports = baseIsTypedArray;
2110
2111
2112/***/ }),
2113/* 42 */
2114/***/ (function(module, exports, __webpack_require__) {
2115
2116 var isPrototype = __webpack_require__(14),
2117 nativeKeys = __webpack_require__(56);
2118
2119 /** Used for built-in method references. */
2120 var objectProto = Object.prototype;
2121
2122 /** Used to check objects for own properties. */
2123 var hasOwnProperty = objectProto.hasOwnProperty;
2124
2125 /**
2126 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2127 *
2128 * @private
2129 * @param {Object} object The object to query.
2130 * @returns {Array} Returns the array of property names.
2131 */
2132 function baseKeys(object) {
2133 if (!isPrototype(object)) {
2134 return nativeKeys(object);
2135 }
2136 var result = [];
2137 for (var key in Object(object)) {
2138 if (hasOwnProperty.call(object, key) && key != 'constructor') {
2139 result.push(key);
2140 }
2141 }
2142 return result;
2143 }
2144
2145 module.exports = baseKeys;
2146
2147
2148/***/ }),
2149/* 43 */
2150/***/ (function(module, exports) {
2151
2152 /** Used as references for various `Number` constants. */
2153 var MAX_SAFE_INTEGER = 9007199254740991;
2154
2155 /* Built-in method references for those with the same name as other `lodash` methods. */
2156 var nativeFloor = Math.floor;
2157
2158 /**
2159 * The base implementation of `_.repeat` which doesn't coerce arguments.
2160 *
2161 * @private
2162 * @param {string} string The string to repeat.
2163 * @param {number} n The number of times to repeat the string.
2164 * @returns {string} Returns the repeated string.
2165 */
2166 function baseRepeat(string, n) {
2167 var result = '';
2168 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
2169 return result;
2170 }
2171 // Leverage the exponentiation by squaring algorithm for a faster repeat.
2172 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
2173 do {
2174 if (n % 2) {
2175 result += string;
2176 }
2177 n = nativeFloor(n / 2);
2178 if (n) {
2179 string += string;
2180 }
2181 } while (n);
2182
2183 return result;
2184 }
2185
2186 module.exports = baseRepeat;
2187
2188
2189/***/ }),
2190/* 44 */
2191/***/ (function(module, exports) {
2192
2193 /**
2194 * The base implementation of `_.slice` without an iteratee call guard.
2195 *
2196 * @private
2197 * @param {Array} array The array to slice.
2198 * @param {number} [start=0] The start position.
2199 * @param {number} [end=array.length] The end position.
2200 * @returns {Array} Returns the slice of `array`.
2201 */
2202 function baseSlice(array, start, end) {
2203 var index = -1,
2204 length = array.length;
2205
2206 if (start < 0) {
2207 start = -start > length ? 0 : (length + start);
2208 }
2209 end = end > length ? length : end;
2210 if (end < 0) {
2211 end += length;
2212 }
2213 length = start > end ? 0 : ((end - start) >>> 0);
2214 start >>>= 0;
2215
2216 var result = Array(length);
2217 while (++index < length) {
2218 result[index] = array[index + start];
2219 }
2220 return result;
2221 }
2222
2223 module.exports = baseSlice;
2224
2225
2226/***/ }),
2227/* 45 */
2228/***/ (function(module, exports) {
2229
2230 /**
2231 * The base implementation of `_.unary` without support for storing metadata.
2232 *
2233 * @private
2234 * @param {Function} func The function to cap arguments for.
2235 * @returns {Function} Returns the new capped function.
2236 */
2237 function baseUnary(func) {
2238 return function(value) {
2239 return func(value);
2240 };
2241 }
2242
2243 module.exports = baseUnary;
2244
2245
2246/***/ }),
2247/* 46 */
2248/***/ (function(module, exports, __webpack_require__) {
2249
2250 var baseSlice = __webpack_require__(44);
2251
2252 /**
2253 * Casts `array` to a slice if it's needed.
2254 *
2255 * @private
2256 * @param {Array} array The array to inspect.
2257 * @param {number} start The start position.
2258 * @param {number} [end=array.length] The end position.
2259 * @returns {Array} Returns the cast slice.
2260 */
2261 function castSlice(array, start, end) {
2262 var length = array.length;
2263 end = end === undefined ? length : end;
2264 return (!start && end >= length) ? array : baseSlice(array, start, end);
2265 }
2266
2267 module.exports = castSlice;
2268
2269
2270/***/ }),
2271/* 47 */
2272/***/ (function(module, exports, __webpack_require__) {
2273
2274 var baseIndexOf = __webpack_require__(37);
2275
2276 /**
2277 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
2278 * that is not found in the character symbols.
2279 *
2280 * @private
2281 * @param {Array} strSymbols The string symbols to inspect.
2282 * @param {Array} chrSymbols The character symbols to find.
2283 * @returns {number} Returns the index of the last unmatched string symbol.
2284 */
2285 function charsEndIndex(strSymbols, chrSymbols) {
2286 var index = strSymbols.length;
2287
2288 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
2289 return index;
2290 }
2291
2292 module.exports = charsEndIndex;
2293
2294
2295/***/ }),
2296/* 48 */
2297/***/ (function(module, exports, __webpack_require__) {
2298
2299 var root = __webpack_require__(2);
2300
2301 /** Used to detect overreaching core-js shims. */
2302 var coreJsData = root['__core-js_shared__'];
2303
2304 module.exports = coreJsData;
2305
2306
2307/***/ }),
2308/* 49 */
2309/***/ (function(module, exports, __webpack_require__) {
2310
2311 var Symbol = __webpack_require__(10);
2312
2313 /** Used for built-in method references. */
2314 var objectProto = Object.prototype;
2315
2316 /** Used to check objects for own properties. */
2317 var hasOwnProperty = objectProto.hasOwnProperty;
2318
2319 /**
2320 * Used to resolve the
2321 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2322 * of values.
2323 */
2324 var nativeObjectToString = objectProto.toString;
2325
2326 /** Built-in value references. */
2327 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
2328
2329 /**
2330 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
2331 *
2332 * @private
2333 * @param {*} value The value to query.
2334 * @returns {string} Returns the raw `toStringTag`.
2335 */
2336 function getRawTag(value) {
2337 var isOwn = hasOwnProperty.call(value, symToStringTag),
2338 tag = value[symToStringTag];
2339
2340 try {
2341 value[symToStringTag] = undefined;
2342 var unmasked = true;
2343 } catch (e) {}
2344
2345 var result = nativeObjectToString.call(value);
2346 if (unmasked) {
2347 if (isOwn) {
2348 value[symToStringTag] = tag;
2349 } else {
2350 delete value[symToStringTag];
2351 }
2352 }
2353 return result;
2354 }
2355
2356 module.exports = getRawTag;
2357
2358
2359/***/ }),
2360/* 50 */
2361/***/ (function(module, exports, __webpack_require__) {
2362
2363 var DataView = __webpack_require__(29),
2364 Map = __webpack_require__(30),
2365 Promise = __webpack_require__(31),
2366 Set = __webpack_require__(32),
2367 WeakMap = __webpack_require__(33),
2368 baseGetTag = __webpack_require__(3),
2369 toSource = __webpack_require__(15);
2370
2371 /** `Object#toString` result references. */
2372 var mapTag = '[object Map]',
2373 objectTag = '[object Object]',
2374 promiseTag = '[object Promise]',
2375 setTag = '[object Set]',
2376 weakMapTag = '[object WeakMap]';
2377
2378 var dataViewTag = '[object DataView]';
2379
2380 /** Used to detect maps, sets, and weakmaps. */
2381 var dataViewCtorString = toSource(DataView),
2382 mapCtorString = toSource(Map),
2383 promiseCtorString = toSource(Promise),
2384 setCtorString = toSource(Set),
2385 weakMapCtorString = toSource(WeakMap);
2386
2387 /**
2388 * Gets the `toStringTag` of `value`.
2389 *
2390 * @private
2391 * @param {*} value The value to query.
2392 * @returns {string} Returns the `toStringTag`.
2393 */
2394 var getTag = baseGetTag;
2395
2396 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2397 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
2398 (Map && getTag(new Map) != mapTag) ||
2399 (Promise && getTag(Promise.resolve()) != promiseTag) ||
2400 (Set && getTag(new Set) != setTag) ||
2401 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
2402 getTag = function(value) {
2403 var result = baseGetTag(value),
2404 Ctor = result == objectTag ? value.constructor : undefined,
2405 ctorString = Ctor ? toSource(Ctor) : '';
2406
2407 if (ctorString) {
2408 switch (ctorString) {
2409 case dataViewCtorString: return dataViewTag;
2410 case mapCtorString: return mapTag;
2411 case promiseCtorString: return promiseTag;
2412 case setCtorString: return setTag;
2413 case weakMapCtorString: return weakMapTag;
2414 }
2415 }
2416 return result;
2417 };
2418 }
2419
2420 module.exports = getTag;
2421
2422
2423/***/ }),
2424/* 51 */
2425/***/ (function(module, exports) {
2426
2427 /**
2428 * Gets the value at `key` of `object`.
2429 *
2430 * @private
2431 * @param {Object} [object] The object to query.
2432 * @param {string} key The key of the property to get.
2433 * @returns {*} Returns the property value.
2434 */
2435 function getValue(object, key) {
2436 return object == null ? undefined : object[key];
2437 }
2438
2439 module.exports = getValue;
2440
2441
2442/***/ }),
2443/* 52 */
2444/***/ (function(module, exports) {
2445
2446 /** Used to compose unicode character classes. */
2447 var rsAstralRange = '\\ud800-\\udfff',
2448 rsComboMarksRange = '\\u0300-\\u036f',
2449 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2450 rsComboSymbolsRange = '\\u20d0-\\u20ff',
2451 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
2452 rsVarRange = '\\ufe0e\\ufe0f';
2453
2454 /** Used to compose unicode capture groups. */
2455 var rsZWJ = '\\u200d';
2456
2457 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
2458 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
2459
2460 /**
2461 * Checks if `string` contains Unicode symbols.
2462 *
2463 * @private
2464 * @param {string} string The string to inspect.
2465 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
2466 */
2467 function hasUnicode(string) {
2468 return reHasUnicode.test(string);
2469 }
2470
2471 module.exports = hasUnicode;
2472
2473
2474/***/ }),
2475/* 53 */
2476/***/ (function(module, exports) {
2477
2478 /** Used as references for various `Number` constants. */
2479 var MAX_SAFE_INTEGER = 9007199254740991;
2480
2481 /** Used to detect unsigned integer values. */
2482 var reIsUint = /^(?:0|[1-9]\d*)$/;
2483
2484 /**
2485 * Checks if `value` is a valid array-like index.
2486 *
2487 * @private
2488 * @param {*} value The value to check.
2489 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2490 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2491 */
2492 function isIndex(value, length) {
2493 var type = typeof value;
2494 length = length == null ? MAX_SAFE_INTEGER : length;
2495
2496 return !!length &&
2497 (type == 'number' ||
2498 (type != 'symbol' && reIsUint.test(value))) &&
2499 (value > -1 && value % 1 == 0 && value < length);
2500 }
2501
2502 module.exports = isIndex;
2503
2504
2505/***/ }),
2506/* 54 */
2507/***/ (function(module, exports, __webpack_require__) {
2508
2509 var eq = __webpack_require__(63),
2510 isArrayLike = __webpack_require__(17),
2511 isIndex = __webpack_require__(53),
2512 isObject = __webpack_require__(7);
2513
2514 /**
2515 * Checks if the given arguments are from an iteratee call.
2516 *
2517 * @private
2518 * @param {*} value The potential iteratee value argument.
2519 * @param {*} index The potential iteratee index or key argument.
2520 * @param {*} object The potential iteratee object argument.
2521 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
2522 * else `false`.
2523 */
2524 function isIterateeCall(value, index, object) {
2525 if (!isObject(object)) {
2526 return false;
2527 }
2528 var type = typeof index;
2529 if (type == 'number'
2530 ? (isArrayLike(object) && isIndex(index, object.length))
2531 : (type == 'string' && index in object)
2532 ) {
2533 return eq(object[index], value);
2534 }
2535 return false;
2536 }
2537
2538 module.exports = isIterateeCall;
2539
2540
2541/***/ }),
2542/* 55 */
2543/***/ (function(module, exports, __webpack_require__) {
2544
2545 var coreJsData = __webpack_require__(48);
2546
2547 /** Used to detect methods masquerading as native. */
2548 var maskSrcKey = (function() {
2549 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
2550 return uid ? ('Symbol(src)_1.' + uid) : '';
2551 }());
2552
2553 /**
2554 * Checks if `func` has its source masked.
2555 *
2556 * @private
2557 * @param {Function} func The function to check.
2558 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
2559 */
2560 function isMasked(func) {
2561 return !!maskSrcKey && (maskSrcKey in func);
2562 }
2563
2564 module.exports = isMasked;
2565
2566
2567/***/ }),
2568/* 56 */
2569/***/ (function(module, exports, __webpack_require__) {
2570
2571 var overArg = __webpack_require__(59);
2572
2573 /* Built-in method references for those with the same name as other `lodash` methods. */
2574 var nativeKeys = overArg(Object.keys, Object);
2575
2576 module.exports = nativeKeys;
2577
2578
2579/***/ }),
2580/* 57 */
2581/***/ (function(module, exports, __webpack_require__) {
2582
2583 /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(13);
2584
2585 /** Detect free variable `exports`. */
2586 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
2587
2588 /** Detect free variable `module`. */
2589 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
2590
2591 /** Detect the popular CommonJS extension `module.exports`. */
2592 var moduleExports = freeModule && freeModule.exports === freeExports;
2593
2594 /** Detect free variable `process` from Node.js. */
2595 var freeProcess = moduleExports && freeGlobal.process;
2596
2597 /** Used to access faster Node.js helpers. */
2598 var nodeUtil = (function() {
2599 try {
2600 return freeProcess && freeProcess.binding && freeProcess.binding('util');
2601 } catch (e) {}
2602 }());
2603
2604 module.exports = nodeUtil;
2605
2606 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)(module)))
2607
2608/***/ }),
2609/* 58 */
2610/***/ (function(module, exports) {
2611
2612 /** Used for built-in method references. */
2613 var objectProto = Object.prototype;
2614
2615 /**
2616 * Used to resolve the
2617 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2618 * of values.
2619 */
2620 var nativeObjectToString = objectProto.toString;
2621
2622 /**
2623 * Converts `value` to a string using `Object.prototype.toString`.
2624 *
2625 * @private
2626 * @param {*} value The value to convert.
2627 * @returns {string} Returns the converted string.
2628 */
2629 function objectToString(value) {
2630 return nativeObjectToString.call(value);
2631 }
2632
2633 module.exports = objectToString;
2634
2635
2636/***/ }),
2637/* 59 */
2638/***/ (function(module, exports) {
2639
2640 /**
2641 * Creates a unary function that invokes `func` with its argument transformed.
2642 *
2643 * @private
2644 * @param {Function} func The function to wrap.
2645 * @param {Function} transform The argument transform.
2646 * @returns {Function} Returns the new function.
2647 */
2648 function overArg(func, transform) {
2649 return function(arg) {
2650 return func(transform(arg));
2651 };
2652 }
2653
2654 module.exports = overArg;
2655
2656
2657/***/ }),
2658/* 60 */
2659/***/ (function(module, exports) {
2660
2661 /**
2662 * A specialized version of `_.indexOf` which performs strict equality
2663 * comparisons of values, i.e. `===`.
2664 *
2665 * @private
2666 * @param {Array} array The array to inspect.
2667 * @param {*} value The value to search for.
2668 * @param {number} fromIndex The index to search from.
2669 * @returns {number} Returns the index of the matched value, else `-1`.
2670 */
2671 function strictIndexOf(array, value, fromIndex) {
2672 var index = fromIndex - 1,
2673 length = array.length;
2674
2675 while (++index < length) {
2676 if (array[index] === value) {
2677 return index;
2678 }
2679 }
2680 return -1;
2681 }
2682
2683 module.exports = strictIndexOf;
2684
2685
2686/***/ }),
2687/* 61 */
2688/***/ (function(module, exports, __webpack_require__) {
2689
2690 var asciiToArray = __webpack_require__(35),
2691 hasUnicode = __webpack_require__(52),
2692 unicodeToArray = __webpack_require__(62);
2693
2694 /**
2695 * Converts `string` to an array.
2696 *
2697 * @private
2698 * @param {string} string The string to convert.
2699 * @returns {Array} Returns the converted array.
2700 */
2701 function stringToArray(string) {
2702 return hasUnicode(string)
2703 ? unicodeToArray(string)
2704 : asciiToArray(string);
2705 }
2706
2707 module.exports = stringToArray;
2708
2709
2710/***/ }),
2711/* 62 */
2712/***/ (function(module, exports) {
2713
2714 /** Used to compose unicode character classes. */
2715 var rsAstralRange = '\\ud800-\\udfff',
2716 rsComboMarksRange = '\\u0300-\\u036f',
2717 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2718 rsComboSymbolsRange = '\\u20d0-\\u20ff',
2719 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
2720 rsVarRange = '\\ufe0e\\ufe0f';
2721
2722 /** Used to compose unicode capture groups. */
2723 var rsAstral = '[' + rsAstralRange + ']',
2724 rsCombo = '[' + rsComboRange + ']',
2725 rsFitz = '\\ud83c[\\udffb-\\udfff]',
2726 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
2727 rsNonAstral = '[^' + rsAstralRange + ']',
2728 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
2729 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
2730 rsZWJ = '\\u200d';
2731
2732 /** Used to compose unicode regexes. */
2733 var reOptMod = rsModifier + '?',
2734 rsOptVar = '[' + rsVarRange + ']?',
2735 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
2736 rsSeq = rsOptVar + reOptMod + rsOptJoin,
2737 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
2738
2739 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
2740 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
2741
2742 /**
2743 * Converts a Unicode `string` to an array.
2744 *
2745 * @private
2746 * @param {string} string The string to convert.
2747 * @returns {Array} Returns the converted array.
2748 */
2749 function unicodeToArray(string) {
2750 return string.match(reUnicode) || [];
2751 }
2752
2753 module.exports = unicodeToArray;
2754
2755
2756/***/ }),
2757/* 63 */
2758/***/ (function(module, exports) {
2759
2760 /**
2761 * Performs a
2762 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2763 * comparison between two values to determine if they are equivalent.
2764 *
2765 * @static
2766 * @memberOf _
2767 * @since 4.0.0
2768 * @category Lang
2769 * @param {*} value The value to compare.
2770 * @param {*} other The other value to compare.
2771 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2772 * @example
2773 *
2774 * var object = { 'a': 1 };
2775 * var other = { 'a': 1 };
2776 *
2777 * _.eq(object, object);
2778 * // => true
2779 *
2780 * _.eq(object, other);
2781 * // => false
2782 *
2783 * _.eq('a', 'a');
2784 * // => true
2785 *
2786 * _.eq('a', Object('a'));
2787 * // => false
2788 *
2789 * _.eq(NaN, NaN);
2790 * // => true
2791 */
2792 function eq(value, other) {
2793 return value === other || (value !== value && other !== other);
2794 }
2795
2796 module.exports = eq;
2797
2798
2799/***/ }),
2800/* 64 */
2801/***/ (function(module, exports, __webpack_require__) {
2802
2803 var toString = __webpack_require__(11);
2804
2805 /**
2806 * Used to match `RegExp`
2807 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
2808 */
2809 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
2810 reHasRegExpChar = RegExp(reRegExpChar.source);
2811
2812 /**
2813 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
2814 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
2815 *
2816 * @static
2817 * @memberOf _
2818 * @since 3.0.0
2819 * @category String
2820 * @param {string} [string=''] The string to escape.
2821 * @returns {string} Returns the escaped string.
2822 * @example
2823 *
2824 * _.escapeRegExp('[lodash](https://lodash.com/)');
2825 * // => '\[lodash\]\(https://lodash\.com/\)'
2826 */
2827 function escapeRegExp(string) {
2828 string = toString(string);
2829 return (string && reHasRegExpChar.test(string))
2830 ? string.replace(reRegExpChar, '\\$&')
2831 : string;
2832 }
2833
2834 module.exports = escapeRegExp;
2835
2836
2837/***/ }),
2838/* 65 */
2839/***/ (function(module, exports, __webpack_require__) {
2840
2841 var baseIsArguments = __webpack_require__(38),
2842 isObjectLike = __webpack_require__(8);
2843
2844 /** Used for built-in method references. */
2845 var objectProto = Object.prototype;
2846
2847 /** Used to check objects for own properties. */
2848 var hasOwnProperty = objectProto.hasOwnProperty;
2849
2850 /** Built-in value references. */
2851 var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2852
2853 /**
2854 * Checks if `value` is likely an `arguments` object.
2855 *
2856 * @static
2857 * @memberOf _
2858 * @since 0.1.0
2859 * @category Lang
2860 * @param {*} value The value to check.
2861 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2862 * else `false`.
2863 * @example
2864 *
2865 * _.isArguments(function() { return arguments; }());
2866 * // => true
2867 *
2868 * _.isArguments([1, 2, 3]);
2869 * // => false
2870 */
2871 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
2872 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
2873 !propertyIsEnumerable.call(value, 'callee');
2874 };
2875
2876 module.exports = isArguments;
2877
2878
2879/***/ }),
2880/* 66 */
2881/***/ (function(module, exports, __webpack_require__) {
2882
2883 /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(2),
2884 stubFalse = __webpack_require__(71);
2885
2886 /** Detect free variable `exports`. */
2887 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
2888
2889 /** Detect free variable `module`. */
2890 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
2891
2892 /** Detect the popular CommonJS extension `module.exports`. */
2893 var moduleExports = freeModule && freeModule.exports === freeExports;
2894
2895 /** Built-in value references. */
2896 var Buffer = moduleExports ? root.Buffer : undefined;
2897
2898 /* Built-in method references for those with the same name as other `lodash` methods. */
2899 var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2900
2901 /**
2902 * Checks if `value` is a buffer.
2903 *
2904 * @static
2905 * @memberOf _
2906 * @since 4.3.0
2907 * @category Lang
2908 * @param {*} value The value to check.
2909 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2910 * @example
2911 *
2912 * _.isBuffer(new Buffer(2));
2913 * // => true
2914 *
2915 * _.isBuffer(new Uint8Array(2));
2916 * // => false
2917 */
2918 var isBuffer = nativeIsBuffer || stubFalse;
2919
2920 module.exports = isBuffer;
2921
2922 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)(module)))
2923
2924/***/ }),
2925/* 67 */
2926/***/ (function(module, exports, __webpack_require__) {
2927
2928 var baseKeys = __webpack_require__(42),
2929 getTag = __webpack_require__(50),
2930 isArguments = __webpack_require__(65),
2931 isArray = __webpack_require__(16),
2932 isArrayLike = __webpack_require__(17),
2933 isBuffer = __webpack_require__(66),
2934 isPrototype = __webpack_require__(14),
2935 isTypedArray = __webpack_require__(68);
2936
2937 /** `Object#toString` result references. */
2938 var mapTag = '[object Map]',
2939 setTag = '[object Set]';
2940
2941 /** Used for built-in method references. */
2942 var objectProto = Object.prototype;
2943
2944 /** Used to check objects for own properties. */
2945 var hasOwnProperty = objectProto.hasOwnProperty;
2946
2947 /**
2948 * Checks if `value` is an empty object, collection, map, or set.
2949 *
2950 * Objects are considered empty if they have no own enumerable string keyed
2951 * properties.
2952 *
2953 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
2954 * jQuery-like collections are considered empty if they have a `length` of `0`.
2955 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
2956 *
2957 * @static
2958 * @memberOf _
2959 * @since 0.1.0
2960 * @category Lang
2961 * @param {*} value The value to check.
2962 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
2963 * @example
2964 *
2965 * _.isEmpty(null);
2966 * // => true
2967 *
2968 * _.isEmpty(true);
2969 * // => true
2970 *
2971 * _.isEmpty(1);
2972 * // => true
2973 *
2974 * _.isEmpty([1, 2, 3]);
2975 * // => false
2976 *
2977 * _.isEmpty({ 'a': 1 });
2978 * // => false
2979 */
2980 function isEmpty(value) {
2981 if (value == null) {
2982 return true;
2983 }
2984 if (isArrayLike(value) &&
2985 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
2986 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
2987 return !value.length;
2988 }
2989 var tag = getTag(value);
2990 if (tag == mapTag || tag == setTag) {
2991 return !value.size;
2992 }
2993 if (isPrototype(value)) {
2994 return !baseKeys(value).length;
2995 }
2996 for (var key in value) {
2997 if (hasOwnProperty.call(value, key)) {
2998 return false;
2999 }
3000 }
3001 return true;
3002 }
3003
3004 module.exports = isEmpty;
3005
3006
3007/***/ }),
3008/* 68 */
3009/***/ (function(module, exports, __webpack_require__) {
3010
3011 var baseIsTypedArray = __webpack_require__(41),
3012 baseUnary = __webpack_require__(45),
3013 nodeUtil = __webpack_require__(57);
3014
3015 /* Node.js helper references. */
3016 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
3017
3018 /**
3019 * Checks if `value` is classified as a typed array.
3020 *
3021 * @static
3022 * @memberOf _
3023 * @since 3.0.0
3024 * @category Lang
3025 * @param {*} value The value to check.
3026 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
3027 * @example
3028 *
3029 * _.isTypedArray(new Uint8Array);
3030 * // => true
3031 *
3032 * _.isTypedArray([]);
3033 * // => false
3034 */
3035 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
3036
3037 module.exports = isTypedArray;
3038
3039
3040/***/ }),
3041/* 69 */
3042/***/ (function(module, exports) {
3043
3044 /**
3045 * Gets the last element of `array`.
3046 *
3047 * @static
3048 * @memberOf _
3049 * @since 0.1.0
3050 * @category Array
3051 * @param {Array} array The array to query.
3052 * @returns {*} Returns the last element of `array`.
3053 * @example
3054 *
3055 * _.last([1, 2, 3]);
3056 * // => 3
3057 */
3058 function last(array) {
3059 var length = array == null ? 0 : array.length;
3060 return length ? array[length - 1] : undefined;
3061 }
3062
3063 module.exports = last;
3064
3065
3066/***/ }),
3067/* 70 */
3068/***/ (function(module, exports, __webpack_require__) {
3069
3070 var baseRepeat = __webpack_require__(43),
3071 isIterateeCall = __webpack_require__(54),
3072 toInteger = __webpack_require__(73),
3073 toString = __webpack_require__(11);
3074
3075 /**
3076 * Repeats the given string `n` times.
3077 *
3078 * @static
3079 * @memberOf _
3080 * @since 3.0.0
3081 * @category String
3082 * @param {string} [string=''] The string to repeat.
3083 * @param {number} [n=1] The number of times to repeat the string.
3084 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
3085 * @returns {string} Returns the repeated string.
3086 * @example
3087 *
3088 * _.repeat('*', 3);
3089 * // => '***'
3090 *
3091 * _.repeat('abc', 2);
3092 * // => 'abcabc'
3093 *
3094 * _.repeat('abc', 0);
3095 * // => ''
3096 */
3097 function repeat(string, n, guard) {
3098 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
3099 n = 1;
3100 } else {
3101 n = toInteger(n);
3102 }
3103 return baseRepeat(toString(string), n);
3104 }
3105
3106 module.exports = repeat;
3107
3108
3109/***/ }),
3110/* 71 */
3111/***/ (function(module, exports) {
3112
3113 /**
3114 * This method returns `false`.
3115 *
3116 * @static
3117 * @memberOf _
3118 * @since 4.13.0
3119 * @category Util
3120 * @returns {boolean} Returns `false`.
3121 * @example
3122 *
3123 * _.times(2, _.stubFalse);
3124 * // => [false, false]
3125 */
3126 function stubFalse() {
3127 return false;
3128 }
3129
3130 module.exports = stubFalse;
3131
3132
3133/***/ }),
3134/* 72 */
3135/***/ (function(module, exports, __webpack_require__) {
3136
3137 var toNumber = __webpack_require__(74);
3138
3139 /** Used as references for various `Number` constants. */
3140 var INFINITY = 1 / 0,
3141 MAX_INTEGER = 1.7976931348623157e+308;
3142
3143 /**
3144 * Converts `value` to a finite number.
3145 *
3146 * @static
3147 * @memberOf _
3148 * @since 4.12.0
3149 * @category Lang
3150 * @param {*} value The value to convert.
3151 * @returns {number} Returns the converted number.
3152 * @example
3153 *
3154 * _.toFinite(3.2);
3155 * // => 3.2
3156 *
3157 * _.toFinite(Number.MIN_VALUE);
3158 * // => 5e-324
3159 *
3160 * _.toFinite(Infinity);
3161 * // => 1.7976931348623157e+308
3162 *
3163 * _.toFinite('3.2');
3164 * // => 3.2
3165 */
3166 function toFinite(value) {
3167 if (!value) {
3168 return value === 0 ? value : 0;
3169 }
3170 value = toNumber(value);
3171 if (value === INFINITY || value === -INFINITY) {
3172 var sign = (value < 0 ? -1 : 1);
3173 return sign * MAX_INTEGER;
3174 }
3175 return value === value ? value : 0;
3176 }
3177
3178 module.exports = toFinite;
3179
3180
3181/***/ }),
3182/* 73 */
3183/***/ (function(module, exports, __webpack_require__) {
3184
3185 var toFinite = __webpack_require__(72);
3186
3187 /**
3188 * Converts `value` to an integer.
3189 *
3190 * **Note:** This method is loosely based on
3191 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
3192 *
3193 * @static
3194 * @memberOf _
3195 * @since 4.0.0
3196 * @category Lang
3197 * @param {*} value The value to convert.
3198 * @returns {number} Returns the converted integer.
3199 * @example
3200 *
3201 * _.toInteger(3.2);
3202 * // => 3
3203 *
3204 * _.toInteger(Number.MIN_VALUE);
3205 * // => 0
3206 *
3207 * _.toInteger(Infinity);
3208 * // => 1.7976931348623157e+308
3209 *
3210 * _.toInteger('3.2');
3211 * // => 3
3212 */
3213 function toInteger(value) {
3214 var result = toFinite(value),
3215 remainder = result % 1;
3216
3217 return result === result ? (remainder ? result - remainder : result) : 0;
3218 }
3219
3220 module.exports = toInteger;
3221
3222
3223/***/ }),
3224/* 74 */
3225/***/ (function(module, exports, __webpack_require__) {
3226
3227 var isObject = __webpack_require__(7),
3228 isSymbol = __webpack_require__(20);
3229
3230 /** Used as references for various `Number` constants. */
3231 var NAN = 0 / 0;
3232
3233 /** Used to match leading and trailing whitespace. */
3234 var reTrim = /^\s+|\s+$/g;
3235
3236 /** Used to detect bad signed hexadecimal string values. */
3237 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
3238
3239 /** Used to detect binary string values. */
3240 var reIsBinary = /^0b[01]+$/i;
3241
3242 /** Used to detect octal string values. */
3243 var reIsOctal = /^0o[0-7]+$/i;
3244
3245 /** Built-in method references without a dependency on `root`. */
3246 var freeParseInt = parseInt;
3247
3248 /**
3249 * Converts `value` to a number.
3250 *
3251 * @static
3252 * @memberOf _
3253 * @since 4.0.0
3254 * @category Lang
3255 * @param {*} value The value to process.
3256 * @returns {number} Returns the number.
3257 * @example
3258 *
3259 * _.toNumber(3.2);
3260 * // => 3.2
3261 *
3262 * _.toNumber(Number.MIN_VALUE);
3263 * // => 5e-324
3264 *
3265 * _.toNumber(Infinity);
3266 * // => Infinity
3267 *
3268 * _.toNumber('3.2');
3269 * // => 3.2
3270 */
3271 function toNumber(value) {
3272 if (typeof value == 'number') {
3273 return value;
3274 }
3275 if (isSymbol(value)) {
3276 return NAN;
3277 }
3278 if (isObject(value)) {
3279 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
3280 value = isObject(other) ? (other + '') : other;
3281 }
3282 if (typeof value != 'string') {
3283 return value === 0 ? value : +value;
3284 }
3285 value = value.replace(reTrim, '');
3286 var isBinary = reIsBinary.test(value);
3287 return (isBinary || reIsOctal.test(value))
3288 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
3289 : (reIsBadHex.test(value) ? NAN : +value);
3290 }
3291
3292 module.exports = toNumber;
3293
3294
3295/***/ }),
3296/* 75 */
3297/***/ (function(module, exports, __webpack_require__) {
3298
3299 var baseToString = __webpack_require__(12),
3300 castSlice = __webpack_require__(46),
3301 charsEndIndex = __webpack_require__(47),
3302 stringToArray = __webpack_require__(61),
3303 toString = __webpack_require__(11);
3304
3305 /** Used to match leading and trailing whitespace. */
3306 var reTrimEnd = /\s+$/;
3307
3308 /**
3309 * Removes trailing whitespace or specified characters from `string`.
3310 *
3311 * @static
3312 * @memberOf _
3313 * @since 4.0.0
3314 * @category String
3315 * @param {string} [string=''] The string to trim.
3316 * @param {string} [chars=whitespace] The characters to trim.
3317 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
3318 * @returns {string} Returns the trimmed string.
3319 * @example
3320 *
3321 * _.trimEnd(' abc ');
3322 * // => ' abc'
3323 *
3324 * _.trimEnd('-_-abc-_-', '_-');
3325 * // => '-_-abc'
3326 */
3327 function trimEnd(string, chars, guard) {
3328 string = toString(string);
3329 if (string && (guard || chars === undefined)) {
3330 return string.replace(reTrimEnd, '');
3331 }
3332 if (!string || !(chars = baseToString(chars))) {
3333 return string;
3334 }
3335 var strSymbols = stringToArray(string),
3336 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
3337
3338 return castSlice(strSymbols, 0, end).join('');
3339 }
3340
3341 module.exports = trimEnd;
3342
3343
3344/***/ })
3345/******/ ])
3346});
3347;
\No newline at end of file