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() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId])
|
20 | return installedModules[moduleId].exports;
|
21 |
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | exports: {},
|
25 | id: moduleId,
|
26 | loaded: false
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.loaded = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.p = "";
|
48 |
|
49 |
|
50 | return __webpack_require__(0);
|
51 | })
|
52 |
|
53 | ([
|
54 |
|
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 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
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 |
|
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 |
|
126 | (function(module, exports, __webpack_require__) {
|
127 |
|
128 | var freeGlobal = __webpack_require__(13);
|
129 |
|
130 |
|
131 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
132 |
|
133 |
|
134 | var root = freeGlobal || freeSelf || Function('return this')();
|
135 |
|
136 | module.exports = root;
|
137 |
|
138 |
|
139 | }),
|
140 |
|
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 |
|
148 | var nullTag = '[object Null]',
|
149 | undefinedTag = '[object Undefined]';
|
150 |
|
151 |
|
152 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
153 |
|
154 | |
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
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 |
|
175 | (function(module, exports, __webpack_require__) {
|
176 |
|
177 | var baseIsNative = __webpack_require__(40),
|
178 | getValue = __webpack_require__(51);
|
179 |
|
180 | |
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
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 |
|
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 |
|
233 |
|
234 |
|
235 |
|
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 |
|
250 |
|
251 |
|
252 |
|
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 |
|
331 |
|
332 |
|
333 | Formatter.prototype.equalizeWhitespace = function equalizeWhitespace(string) {
|
334 | return string.replace(/\s+/g, " ");
|
335 | };
|
336 |
|
337 |
|
338 |
|
339 |
|
340 | Formatter.prototype.formatOpeningParentheses = function formatOpeningParentheses(tokens, index, query) {
|
341 |
|
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 |
|
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 |
|
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 |
|
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 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
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 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
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 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 | Tokenizer.prototype.tokenize = function tokenize(input) {
|
546 | var tokens = [];
|
547 | var token = void 0;
|
548 |
|
549 |
|
550 | while (input.length) {
|
551 |
|
552 | token = this.getNextToken(input, token);
|
553 |
|
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 |
|
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 |
|
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 |
|
696 |
|
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 |
|
755 | (function(module, exports) {
|
756 |
|
757 | |
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
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 |
|
792 | (function(module, exports) {
|
793 |
|
794 | |
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 | function isObjectLike(value) {
|
819 | return value != null && typeof value == 'object';
|
820 | }
|
821 |
|
822 | module.exports = isObjectLike;
|
823 |
|
824 |
|
825 | }),
|
826 |
|
827 | (function(module, exports) {
|
828 |
|
829 | "use strict";
|
830 |
|
831 | exports.__esModule = true;
|
832 | |
833 |
|
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 |
|
854 | (function(module, exports, __webpack_require__) {
|
855 |
|
856 | var root = __webpack_require__(2);
|
857 |
|
858 |
|
859 | var Symbol = root.Symbol;
|
860 |
|
861 | module.exports = Symbol;
|
862 |
|
863 |
|
864 | }),
|
865 |
|
866 | (function(module, exports, __webpack_require__) {
|
867 |
|
868 | var baseToString = __webpack_require__(12);
|
869 |
|
870 | |
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 | function toString(value) {
|
892 | return value == null ? '' : baseToString(value);
|
893 | }
|
894 |
|
895 | module.exports = toString;
|
896 |
|
897 |
|
898 | }),
|
899 |
|
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 |
|
908 | var INFINITY = 1 / 0;
|
909 |
|
910 |
|
911 | var symbolProto = Symbol ? Symbol.prototype : undefined,
|
912 | symbolToString = symbolProto ? symbolProto.toString : undefined;
|
913 |
|
914 | |
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 | function baseToString(value) {
|
923 |
|
924 | if (typeof value == 'string') {
|
925 | return value;
|
926 | }
|
927 | if (isArray(value)) {
|
928 |
|
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 |
|
943 | (function(module, exports) {
|
944 |
|
945 | (function(global) {
|
946 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
947 |
|
948 | module.exports = freeGlobal;
|
949 |
|
950 | }.call(exports, (function() { return this; }())))
|
951 |
|
952 | }),
|
953 |
|
954 | (function(module, exports) {
|
955 |
|
956 |
|
957 | var objectProto = Object.prototype;
|
958 |
|
959 | |
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
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 |
|
978 | (function(module, exports) {
|
979 |
|
980 |
|
981 | var funcProto = Function.prototype;
|
982 |
|
983 |
|
984 | var funcToString = funcProto.toString;
|
985 |
|
986 | |
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
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 |
|
1010 | (function(module, exports) {
|
1011 |
|
1012 | |
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 | var isArray = Array.isArray;
|
1036 |
|
1037 | module.exports = isArray;
|
1038 |
|
1039 |
|
1040 | }),
|
1041 |
|
1042 | (function(module, exports, __webpack_require__) {
|
1043 |
|
1044 | var isFunction = __webpack_require__(18),
|
1045 | isLength = __webpack_require__(19);
|
1046 |
|
1047 | |
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 | function isArrayLike(value) {
|
1073 | return value != null && isLength(value.length) && !isFunction(value);
|
1074 | }
|
1075 |
|
1076 | module.exports = isArrayLike;
|
1077 |
|
1078 |
|
1079 | }),
|
1080 |
|
1081 | (function(module, exports, __webpack_require__) {
|
1082 |
|
1083 | var baseGetTag = __webpack_require__(3),
|
1084 | isObject = __webpack_require__(7);
|
1085 |
|
1086 |
|
1087 | var asyncTag = '[object AsyncFunction]',
|
1088 | funcTag = '[object Function]',
|
1089 | genTag = '[object GeneratorFunction]',
|
1090 | proxyTag = '[object Proxy]';
|
1091 |
|
1092 | |
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 | function isFunction(value) {
|
1110 | if (!isObject(value)) {
|
1111 | return false;
|
1112 | }
|
1113 |
|
1114 |
|
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 |
|
1124 | (function(module, exports) {
|
1125 |
|
1126 |
|
1127 | var MAX_SAFE_INTEGER = 9007199254740991;
|
1128 |
|
1129 | |
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
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 |
|
1165 | (function(module, exports, __webpack_require__) {
|
1166 |
|
1167 | var baseGetTag = __webpack_require__(3),
|
1168 | isObjectLike = __webpack_require__(8);
|
1169 |
|
1170 |
|
1171 | var symbolTag = '[object Symbol]';
|
1172 |
|
1173 | |
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
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 |
|
1200 | (function(module, exports) {
|
1201 |
|
1202 | module.exports = function(module) {
|
1203 | if(!module.webpackPolyfill) {
|
1204 | module.deprecate = function() {};
|
1205 | module.paths = [];
|
1206 |
|
1207 | module.children = [];
|
1208 | module.webpackPolyfill = 1;
|
1209 | }
|
1210 | return module;
|
1211 | }
|
1212 |
|
1213 |
|
1214 | }),
|
1215 |
|
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 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 | var Indentation = function () {
|
1249 | |
1250 |
|
1251 |
|
1252 | function Indentation(indent) {
|
1253 | (0, _classCallCheck3["default"])(this, Indentation);
|
1254 |
|
1255 | this.indent = indent || " ";
|
1256 | this.indentTypes = [];
|
1257 | }
|
1258 |
|
1259 | |
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 | Indentation.prototype.getIndent = function getIndent() {
|
1266 | return (0, _repeat2["default"])(this.indent, this.indentTypes.length);
|
1267 | };
|
1268 |
|
1269 | |
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 | Indentation.prototype.increaseToplevel = function increaseToplevel() {
|
1275 | this.indentTypes.push(INDENT_TYPE_TOP_LEVEL);
|
1276 | };
|
1277 |
|
1278 | |
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 | Indentation.prototype.increaseBlockLevel = function increaseBlockLevel() {
|
1284 | this.indentTypes.push(INDENT_TYPE_BLOCK_LEVEL);
|
1285 | };
|
1286 |
|
1287 | |
1288 |
|
1289 |
|
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 |
|
1301 |
|
1302 |
|
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 |
|
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 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 | var InlineBlock = function () {
|
1350 | function InlineBlock() {
|
1351 | (0, _classCallCheck3["default"])(this, InlineBlock);
|
1352 |
|
1353 | this.level = 0;
|
1354 | }
|
1355 |
|
1356 | |
1357 |
|
1358 |
|
1359 |
|
1360 |
|
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 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 | InlineBlock.prototype.end = function end() {
|
1381 | this.level--;
|
1382 | };
|
1383 |
|
1384 | |
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 | InlineBlock.prototype.isActive = function isActive() {
|
1391 | return this.level > 0;
|
1392 | };
|
1393 |
|
1394 |
|
1395 |
|
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 |
|
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 |
|
1428 |
|
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 |
|
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 |
|
1460 |
|
1461 | var Params = function () {
|
1462 | |
1463 |
|
1464 |
|
1465 | function Params(params) {
|
1466 | (0, _classCallCheck3["default"])(this, Params);
|
1467 |
|
1468 | this.params = params;
|
1469 | this.index = 0;
|
1470 | }
|
1471 |
|
1472 | |
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
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 |
|
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 |
|
1533 |
|
1534 | function Db2Formatter(cfg) {
|
1535 | (0, _classCallCheck3["default"])(this, Db2Formatter);
|
1536 |
|
1537 | this.cfg = cfg;
|
1538 | }
|
1539 |
|
1540 | |
1541 |
|
1542 |
|
1543 |
|
1544 |
|
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 |
|
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 |
|
1605 |
|
1606 | function N1qlFormatter(cfg) {
|
1607 | (0, _classCallCheck3["default"])(this, N1qlFormatter);
|
1608 |
|
1609 | this.cfg = cfg;
|
1610 | }
|
1611 |
|
1612 | |
1613 |
|
1614 |
|
1615 |
|
1616 |
|
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 |
|
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 |
|
1675 |
|
1676 | function PlSqlFormatter(cfg) {
|
1677 | (0, _classCallCheck3["default"])(this, PlSqlFormatter);
|
1678 |
|
1679 | this.cfg = cfg;
|
1680 | }
|
1681 |
|
1682 | |
1683 |
|
1684 |
|
1685 |
|
1686 |
|
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 |
|
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 |
|
1747 |
|
1748 | function StandardSqlFormatter(cfg) {
|
1749 | (0, _classCallCheck3["default"])(this, StandardSqlFormatter);
|
1750 |
|
1751 | this.cfg = cfg;
|
1752 | }
|
1753 |
|
1754 | |
1755 |
|
1756 |
|
1757 |
|
1758 |
|
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 |
|
1787 | (function(module, exports, __webpack_require__) {
|
1788 |
|
1789 | var getNative = __webpack_require__(4),
|
1790 | root = __webpack_require__(2);
|
1791 |
|
1792 |
|
1793 | var DataView = getNative(root, 'DataView');
|
1794 |
|
1795 | module.exports = DataView;
|
1796 |
|
1797 |
|
1798 | }),
|
1799 |
|
1800 | (function(module, exports, __webpack_require__) {
|
1801 |
|
1802 | var getNative = __webpack_require__(4),
|
1803 | root = __webpack_require__(2);
|
1804 |
|
1805 |
|
1806 | var Map = getNative(root, 'Map');
|
1807 |
|
1808 | module.exports = Map;
|
1809 |
|
1810 |
|
1811 | }),
|
1812 |
|
1813 | (function(module, exports, __webpack_require__) {
|
1814 |
|
1815 | var getNative = __webpack_require__(4),
|
1816 | root = __webpack_require__(2);
|
1817 |
|
1818 |
|
1819 | var Promise = getNative(root, 'Promise');
|
1820 |
|
1821 | module.exports = Promise;
|
1822 |
|
1823 |
|
1824 | }),
|
1825 |
|
1826 | (function(module, exports, __webpack_require__) {
|
1827 |
|
1828 | var getNative = __webpack_require__(4),
|
1829 | root = __webpack_require__(2);
|
1830 |
|
1831 |
|
1832 | var Set = getNative(root, 'Set');
|
1833 |
|
1834 | module.exports = Set;
|
1835 |
|
1836 |
|
1837 | }),
|
1838 |
|
1839 | (function(module, exports, __webpack_require__) {
|
1840 |
|
1841 | var getNative = __webpack_require__(4),
|
1842 | root = __webpack_require__(2);
|
1843 |
|
1844 |
|
1845 | var WeakMap = getNative(root, 'WeakMap');
|
1846 |
|
1847 | module.exports = WeakMap;
|
1848 |
|
1849 |
|
1850 | }),
|
1851 |
|
1852 | (function(module, exports) {
|
1853 |
|
1854 | |
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
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 |
|
1879 | (function(module, exports) {
|
1880 |
|
1881 | |
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 | function asciiToArray(string) {
|
1889 | return string.split('');
|
1890 | }
|
1891 |
|
1892 | module.exports = asciiToArray;
|
1893 |
|
1894 |
|
1895 | }),
|
1896 |
|
1897 | (function(module, exports) {
|
1898 |
|
1899 | |
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
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 |
|
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 |
|
1935 |
|
1936 |
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
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 |
|
1953 | (function(module, exports, __webpack_require__) {
|
1954 |
|
1955 | var baseGetTag = __webpack_require__(3),
|
1956 | isObjectLike = __webpack_require__(8);
|
1957 |
|
1958 |
|
1959 | var argsTag = '[object Arguments]';
|
1960 |
|
1961 | |
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 | function baseIsArguments(value) {
|
1969 | return isObjectLike(value) && baseGetTag(value) == argsTag;
|
1970 | }
|
1971 |
|
1972 | module.exports = baseIsArguments;
|
1973 |
|
1974 |
|
1975 | }),
|
1976 |
|
1977 | (function(module, exports) {
|
1978 |
|
1979 | |
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 | function baseIsNaN(value) {
|
1987 | return value !== value;
|
1988 | }
|
1989 |
|
1990 | module.exports = baseIsNaN;
|
1991 |
|
1992 |
|
1993 | }),
|
1994 |
|
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 |
|
2004 |
|
2005 |
|
2006 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
2007 |
|
2008 |
|
2009 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
2010 |
|
2011 |
|
2012 | var funcProto = Function.prototype,
|
2013 | objectProto = Object.prototype;
|
2014 |
|
2015 |
|
2016 | var funcToString = funcProto.toString;
|
2017 |
|
2018 |
|
2019 | var hasOwnProperty = objectProto.hasOwnProperty;
|
2020 |
|
2021 |
|
2022 | var reIsNative = RegExp('^' +
|
2023 | funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
2024 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
2025 | );
|
2026 |
|
2027 | |
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
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 |
|
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 |
|
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 |
|
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 |
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
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 |
|
2114 | (function(module, exports, __webpack_require__) {
|
2115 |
|
2116 | var isPrototype = __webpack_require__(14),
|
2117 | nativeKeys = __webpack_require__(56);
|
2118 |
|
2119 |
|
2120 | var objectProto = Object.prototype;
|
2121 |
|
2122 |
|
2123 | var hasOwnProperty = objectProto.hasOwnProperty;
|
2124 |
|
2125 | |
2126 |
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
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 |
|
2150 | (function(module, exports) {
|
2151 |
|
2152 |
|
2153 | var MAX_SAFE_INTEGER = 9007199254740991;
|
2154 |
|
2155 |
|
2156 | var nativeFloor = Math.floor;
|
2157 |
|
2158 | |
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 | function baseRepeat(string, n) {
|
2167 | var result = '';
|
2168 | if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
|
2169 | return result;
|
2170 | }
|
2171 |
|
2172 |
|
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 |
|
2191 | (function(module, exports) {
|
2192 |
|
2193 | |
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
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 |
|
2228 | (function(module, exports) {
|
2229 |
|
2230 | |
2231 |
|
2232 |
|
2233 |
|
2234 |
|
2235 |
|
2236 |
|
2237 | function baseUnary(func) {
|
2238 | return function(value) {
|
2239 | return func(value);
|
2240 | };
|
2241 | }
|
2242 |
|
2243 | module.exports = baseUnary;
|
2244 |
|
2245 |
|
2246 | }),
|
2247 |
|
2248 | (function(module, exports, __webpack_require__) {
|
2249 |
|
2250 | var baseSlice = __webpack_require__(44);
|
2251 |
|
2252 | |
2253 |
|
2254 |
|
2255 |
|
2256 |
|
2257 |
|
2258 |
|
2259 |
|
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 |
|
2272 | (function(module, exports, __webpack_require__) {
|
2273 |
|
2274 | var baseIndexOf = __webpack_require__(37);
|
2275 |
|
2276 | |
2277 |
|
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
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 |
|
2297 | (function(module, exports, __webpack_require__) {
|
2298 |
|
2299 | var root = __webpack_require__(2);
|
2300 |
|
2301 |
|
2302 | var coreJsData = root['__core-js_shared__'];
|
2303 |
|
2304 | module.exports = coreJsData;
|
2305 |
|
2306 |
|
2307 | }),
|
2308 |
|
2309 | (function(module, exports, __webpack_require__) {
|
2310 |
|
2311 | var Symbol = __webpack_require__(10);
|
2312 |
|
2313 |
|
2314 | var objectProto = Object.prototype;
|
2315 |
|
2316 |
|
2317 | var hasOwnProperty = objectProto.hasOwnProperty;
|
2318 |
|
2319 | |
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 | var nativeObjectToString = objectProto.toString;
|
2325 |
|
2326 |
|
2327 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
2328 |
|
2329 | |
2330 |
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
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 |
|
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 |
|
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 |
|
2381 | var dataViewCtorString = toSource(DataView),
|
2382 | mapCtorString = toSource(Map),
|
2383 | promiseCtorString = toSource(Promise),
|
2384 | setCtorString = toSource(Set),
|
2385 | weakMapCtorString = toSource(WeakMap);
|
2386 |
|
2387 | |
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 |
|
2393 |
|
2394 | var getTag = baseGetTag;
|
2395 |
|
2396 |
|
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 |
|
2425 | (function(module, exports) {
|
2426 |
|
2427 | |
2428 |
|
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 | function getValue(object, key) {
|
2436 | return object == null ? undefined : object[key];
|
2437 | }
|
2438 |
|
2439 | module.exports = getValue;
|
2440 |
|
2441 |
|
2442 | }),
|
2443 |
|
2444 | (function(module, exports) {
|
2445 |
|
2446 |
|
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 |
|
2455 | var rsZWJ = '\\u200d';
|
2456 |
|
2457 |
|
2458 | var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
2459 |
|
2460 | |
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 | function hasUnicode(string) {
|
2468 | return reHasUnicode.test(string);
|
2469 | }
|
2470 |
|
2471 | module.exports = hasUnicode;
|
2472 |
|
2473 |
|
2474 | }),
|
2475 |
|
2476 | (function(module, exports) {
|
2477 |
|
2478 |
|
2479 | var MAX_SAFE_INTEGER = 9007199254740991;
|
2480 |
|
2481 |
|
2482 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
2483 |
|
2484 | |
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
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 |
|
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 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
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 |
|
2543 | (function(module, exports, __webpack_require__) {
|
2544 |
|
2545 | var coreJsData = __webpack_require__(48);
|
2546 |
|
2547 |
|
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 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 |
|
2560 | function isMasked(func) {
|
2561 | return !!maskSrcKey && (maskSrcKey in func);
|
2562 | }
|
2563 |
|
2564 | module.exports = isMasked;
|
2565 |
|
2566 |
|
2567 | }),
|
2568 |
|
2569 | (function(module, exports, __webpack_require__) {
|
2570 |
|
2571 | var overArg = __webpack_require__(59);
|
2572 |
|
2573 |
|
2574 | var nativeKeys = overArg(Object.keys, Object);
|
2575 |
|
2576 | module.exports = nativeKeys;
|
2577 |
|
2578 |
|
2579 | }),
|
2580 |
|
2581 | (function(module, exports, __webpack_require__) {
|
2582 |
|
2583 | (function(module) {var freeGlobal = __webpack_require__(13);
|
2584 |
|
2585 |
|
2586 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
2587 |
|
2588 |
|
2589 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
2590 |
|
2591 |
|
2592 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
2593 |
|
2594 |
|
2595 | var freeProcess = moduleExports && freeGlobal.process;
|
2596 |
|
2597 |
|
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 | }.call(exports, __webpack_require__(21)(module)))
|
2607 |
|
2608 | }),
|
2609 |
|
2610 | (function(module, exports) {
|
2611 |
|
2612 |
|
2613 | var objectProto = Object.prototype;
|
2614 |
|
2615 | |
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 | var nativeObjectToString = objectProto.toString;
|
2621 |
|
2622 | |
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 |
|
2628 |
|
2629 | function objectToString(value) {
|
2630 | return nativeObjectToString.call(value);
|
2631 | }
|
2632 |
|
2633 | module.exports = objectToString;
|
2634 |
|
2635 |
|
2636 | }),
|
2637 |
|
2638 | (function(module, exports) {
|
2639 |
|
2640 | |
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
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 |
|
2659 | (function(module, exports) {
|
2660 |
|
2661 | |
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
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 |
|
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 |
|
2696 |
|
2697 |
|
2698 |
|
2699 |
|
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 |
|
2712 | (function(module, exports) {
|
2713 |
|
2714 |
|
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 |
|
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 |
|
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 |
|
2740 | var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
2741 |
|
2742 | |
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 | function unicodeToArray(string) {
|
2750 | return string.match(reUnicode) || [];
|
2751 | }
|
2752 |
|
2753 | module.exports = unicodeToArray;
|
2754 |
|
2755 |
|
2756 | }),
|
2757 |
|
2758 | (function(module, exports) {
|
2759 |
|
2760 | |
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 | function eq(value, other) {
|
2793 | return value === other || (value !== value && other !== other);
|
2794 | }
|
2795 |
|
2796 | module.exports = eq;
|
2797 |
|
2798 |
|
2799 | }),
|
2800 |
|
2801 | (function(module, exports, __webpack_require__) {
|
2802 |
|
2803 | var toString = __webpack_require__(11);
|
2804 |
|
2805 | |
2806 |
|
2807 |
|
2808 |
|
2809 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
2810 | reHasRegExpChar = RegExp(reRegExpChar.source);
|
2811 |
|
2812 | |
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
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 |
|
2839 | (function(module, exports, __webpack_require__) {
|
2840 |
|
2841 | var baseIsArguments = __webpack_require__(38),
|
2842 | isObjectLike = __webpack_require__(8);
|
2843 |
|
2844 |
|
2845 | var objectProto = Object.prototype;
|
2846 |
|
2847 |
|
2848 | var hasOwnProperty = objectProto.hasOwnProperty;
|
2849 |
|
2850 |
|
2851 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
2852 |
|
2853 | |
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
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 |
|
2881 | (function(module, exports, __webpack_require__) {
|
2882 |
|
2883 | (function(module) {var root = __webpack_require__(2),
|
2884 | stubFalse = __webpack_require__(71);
|
2885 |
|
2886 |
|
2887 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
2888 |
|
2889 |
|
2890 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
2891 |
|
2892 |
|
2893 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
2894 |
|
2895 |
|
2896 | var Buffer = moduleExports ? root.Buffer : undefined;
|
2897 |
|
2898 |
|
2899 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
2900 |
|
2901 | |
2902 |
|
2903 |
|
2904 |
|
2905 |
|
2906 |
|
2907 |
|
2908 |
|
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 | var isBuffer = nativeIsBuffer || stubFalse;
|
2919 |
|
2920 | module.exports = isBuffer;
|
2921 |
|
2922 | }.call(exports, __webpack_require__(21)(module)))
|
2923 |
|
2924 | }),
|
2925 |
|
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 |
|
2938 | var mapTag = '[object Map]',
|
2939 | setTag = '[object Set]';
|
2940 |
|
2941 |
|
2942 | var objectProto = Object.prototype;
|
2943 |
|
2944 |
|
2945 | var hasOwnProperty = objectProto.hasOwnProperty;
|
2946 |
|
2947 | |
2948 |
|
2949 |
|
2950 |
|
2951 |
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 |
|
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
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 |
|
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 |
|
3016 | var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
3017 |
|
3018 | |
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 | var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
3036 |
|
3037 | module.exports = isTypedArray;
|
3038 |
|
3039 |
|
3040 | }),
|
3041 |
|
3042 | (function(module, exports) {
|
3043 |
|
3044 | |
3045 |
|
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
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 |
|
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 |
|
3077 |
|
3078 |
|
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
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 |
|
3111 | (function(module, exports) {
|
3112 |
|
3113 | |
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 |
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 |
|
3126 | function stubFalse() {
|
3127 | return false;
|
3128 | }
|
3129 |
|
3130 | module.exports = stubFalse;
|
3131 |
|
3132 |
|
3133 | }),
|
3134 |
|
3135 | (function(module, exports, __webpack_require__) {
|
3136 |
|
3137 | var toNumber = __webpack_require__(74);
|
3138 |
|
3139 |
|
3140 | var INFINITY = 1 / 0,
|
3141 | MAX_INTEGER = 1.7976931348623157e+308;
|
3142 |
|
3143 | |
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
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 |
|
3183 | (function(module, exports, __webpack_require__) {
|
3184 |
|
3185 | var toFinite = __webpack_require__(72);
|
3186 |
|
3187 | |
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
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 |
|
3225 | (function(module, exports, __webpack_require__) {
|
3226 |
|
3227 | var isObject = __webpack_require__(7),
|
3228 | isSymbol = __webpack_require__(20);
|
3229 |
|
3230 |
|
3231 | var NAN = 0 / 0;
|
3232 |
|
3233 |
|
3234 | var reTrim = /^\s+|\s+$/g;
|
3235 |
|
3236 |
|
3237 | var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
3238 |
|
3239 |
|
3240 | var reIsBinary = /^0b[01]+$/i;
|
3241 |
|
3242 |
|
3243 | var reIsOctal = /^0o[0-7]+$/i;
|
3244 |
|
3245 |
|
3246 | var freeParseInt = parseInt;
|
3247 |
|
3248 | |
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
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 |
|
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 |
|
3306 | var reTrimEnd = /\s+$/;
|
3307 |
|
3308 | |
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
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 |