1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('chalk')) :
|
3 | typeof define === 'function' && define.amd ? define(['chalk'], factory) :
|
4 | (factory(global.chalk));
|
5 | }(this, (function (chalk) { 'use strict';
|
6 |
|
7 | chalk = chalk && chalk.hasOwnProperty('default') ? chalk['default'] : chalk;
|
8 |
|
9 | var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | function createCommonjsModule(fn, module) {
|
16 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
17 | }
|
18 |
|
19 | var diffMatchPatch = createCommonjsModule(function (module) {
|
20 | function diff_match_patch() {
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | this.Diff_Timeout = 1.0;
|
27 |
|
28 | this.Diff_EditCost = 4;
|
29 |
|
30 | this.Match_Threshold = 0.5;
|
31 |
|
32 |
|
33 |
|
34 | this.Match_Distance = 1000;
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | this.Patch_DeleteThreshold = 0.5;
|
40 |
|
41 | this.Patch_Margin = 4;
|
42 |
|
43 |
|
44 | this.Match_MaxBits = 32;
|
45 | }
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | var DIFF_DELETE = -1;
|
57 | var DIFF_INSERT = 1;
|
58 | var DIFF_EQUAL = 0;
|
59 |
|
60 |
|
61 | diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,
|
62 | opt_deadline) {
|
63 |
|
64 | if (typeof opt_deadline == 'undefined') {
|
65 | if (this.Diff_Timeout <= 0) {
|
66 | opt_deadline = Number.MAX_VALUE;
|
67 | } else {
|
68 | opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;
|
69 | }
|
70 | }
|
71 | var deadline = opt_deadline;
|
72 |
|
73 |
|
74 | if (text1 == null || text2 == null) {
|
75 | throw new Error('Null input. (diff_main)');
|
76 | }
|
77 |
|
78 |
|
79 | if (text1 == text2) {
|
80 | if (text1) {
|
81 | return [[DIFF_EQUAL, text1]];
|
82 | }
|
83 | return [];
|
84 | }
|
85 |
|
86 | if (typeof opt_checklines == 'undefined') {
|
87 | opt_checklines = true;
|
88 | }
|
89 | var checklines = opt_checklines;
|
90 |
|
91 |
|
92 | var commonlength = this.diff_commonPrefix(text1, text2);
|
93 | var commonprefix = text1.substring(0, commonlength);
|
94 | text1 = text1.substring(commonlength);
|
95 | text2 = text2.substring(commonlength);
|
96 |
|
97 |
|
98 | commonlength = this.diff_commonSuffix(text1, text2);
|
99 | var commonsuffix = text1.substring(text1.length - commonlength);
|
100 | text1 = text1.substring(0, text1.length - commonlength);
|
101 | text2 = text2.substring(0, text2.length - commonlength);
|
102 |
|
103 |
|
104 | var diffs = this.diff_compute_(text1, text2, checklines, deadline);
|
105 |
|
106 |
|
107 | if (commonprefix) {
|
108 | diffs.unshift([DIFF_EQUAL, commonprefix]);
|
109 | }
|
110 | if (commonsuffix) {
|
111 | diffs.push([DIFF_EQUAL, commonsuffix]);
|
112 | }
|
113 | this.diff_cleanupMerge(diffs);
|
114 | return diffs;
|
115 | };
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,
|
131 | deadline) {
|
132 | var diffs;
|
133 |
|
134 | if (!text1) {
|
135 |
|
136 | return [[DIFF_INSERT, text2]];
|
137 | }
|
138 |
|
139 | if (!text2) {
|
140 |
|
141 | return [[DIFF_DELETE, text1]];
|
142 | }
|
143 |
|
144 | var longtext = text1.length > text2.length ? text1 : text2;
|
145 | var shorttext = text1.length > text2.length ? text2 : text1;
|
146 | var i = longtext.indexOf(shorttext);
|
147 | if (i != -1) {
|
148 |
|
149 | diffs = [[DIFF_INSERT, longtext.substring(0, i)],
|
150 | [DIFF_EQUAL, shorttext],
|
151 | [DIFF_INSERT, longtext.substring(i + shorttext.length)]];
|
152 |
|
153 | if (text1.length > text2.length) {
|
154 | diffs[0][0] = diffs[2][0] = DIFF_DELETE;
|
155 | }
|
156 | return diffs;
|
157 | }
|
158 |
|
159 | if (shorttext.length == 1) {
|
160 |
|
161 |
|
162 | return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
|
163 | }
|
164 |
|
165 |
|
166 | var hm = this.diff_halfMatch_(text1, text2);
|
167 | if (hm) {
|
168 |
|
169 | var text1_a = hm[0];
|
170 | var text1_b = hm[1];
|
171 | var text2_a = hm[2];
|
172 | var text2_b = hm[3];
|
173 | var mid_common = hm[4];
|
174 |
|
175 | var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);
|
176 | var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);
|
177 |
|
178 | return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
|
179 | }
|
180 |
|
181 | if (checklines && text1.length > 100 && text2.length > 100) {
|
182 | return this.diff_lineMode_(text1, text2, deadline);
|
183 | }
|
184 |
|
185 | return this.diff_bisect_(text1, text2, deadline);
|
186 | };
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 | diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
|
200 |
|
201 | var a = this.diff_linesToChars_(text1, text2);
|
202 | text1 = a.chars1;
|
203 | text2 = a.chars2;
|
204 | var linearray = a.lineArray;
|
205 |
|
206 | var diffs = this.diff_main(text1, text2, false, deadline);
|
207 |
|
208 |
|
209 | this.diff_charsToLines_(diffs, linearray);
|
210 |
|
211 | this.diff_cleanupSemantic(diffs);
|
212 |
|
213 |
|
214 |
|
215 | diffs.push([DIFF_EQUAL, '']);
|
216 | var pointer = 0;
|
217 | var count_delete = 0;
|
218 | var count_insert = 0;
|
219 | var text_delete = '';
|
220 | var text_insert = '';
|
221 | while (pointer < diffs.length) {
|
222 | switch (diffs[pointer][0]) {
|
223 | case DIFF_INSERT:
|
224 | count_insert++;
|
225 | text_insert += diffs[pointer][1];
|
226 | break;
|
227 | case DIFF_DELETE:
|
228 | count_delete++;
|
229 | text_delete += diffs[pointer][1];
|
230 | break;
|
231 | case DIFF_EQUAL:
|
232 |
|
233 | if (count_delete >= 1 && count_insert >= 1) {
|
234 |
|
235 | diffs.splice(pointer - count_delete - count_insert,
|
236 | count_delete + count_insert);
|
237 | pointer = pointer - count_delete - count_insert;
|
238 | var a = this.diff_main(text_delete, text_insert, false, deadline);
|
239 | for (var j = a.length - 1; j >= 0; j--) {
|
240 | diffs.splice(pointer, 0, a[j]);
|
241 | }
|
242 | pointer = pointer + a.length;
|
243 | }
|
244 | count_insert = 0;
|
245 | count_delete = 0;
|
246 | text_delete = '';
|
247 | text_insert = '';
|
248 | break;
|
249 | }
|
250 | pointer++;
|
251 | }
|
252 | diffs.pop();
|
253 |
|
254 | return diffs;
|
255 | };
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 | diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
|
269 |
|
270 | var text1_length = text1.length;
|
271 | var text2_length = text2.length;
|
272 | var max_d = Math.ceil((text1_length + text2_length) / 2);
|
273 | var v_offset = max_d;
|
274 | var v_length = 2 * max_d;
|
275 | var v1 = new Array(v_length);
|
276 | var v2 = new Array(v_length);
|
277 |
|
278 |
|
279 | for (var x = 0; x < v_length; x++) {
|
280 | v1[x] = -1;
|
281 | v2[x] = -1;
|
282 | }
|
283 | v1[v_offset + 1] = 0;
|
284 | v2[v_offset + 1] = 0;
|
285 | var delta = text1_length - text2_length;
|
286 |
|
287 |
|
288 | var front = (delta % 2 != 0);
|
289 |
|
290 |
|
291 | var k1start = 0;
|
292 | var k1end = 0;
|
293 | var k2start = 0;
|
294 | var k2end = 0;
|
295 | for (var d = 0; d < max_d; d++) {
|
296 |
|
297 | if ((new Date()).getTime() > deadline) {
|
298 | break;
|
299 | }
|
300 |
|
301 |
|
302 | for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
|
303 | var k1_offset = v_offset + k1;
|
304 | var x1;
|
305 | if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
|
306 | x1 = v1[k1_offset + 1];
|
307 | } else {
|
308 | x1 = v1[k1_offset - 1] + 1;
|
309 | }
|
310 | var y1 = x1 - k1;
|
311 | while (x1 < text1_length && y1 < text2_length &&
|
312 | text1.charAt(x1) == text2.charAt(y1)) {
|
313 | x1++;
|
314 | y1++;
|
315 | }
|
316 | v1[k1_offset] = x1;
|
317 | if (x1 > text1_length) {
|
318 |
|
319 | k1end += 2;
|
320 | } else if (y1 > text2_length) {
|
321 |
|
322 | k1start += 2;
|
323 | } else if (front) {
|
324 | var k2_offset = v_offset + delta - k1;
|
325 | if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
|
326 |
|
327 | var x2 = text1_length - v2[k2_offset];
|
328 | if (x1 >= x2) {
|
329 |
|
330 | return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
331 | }
|
332 | }
|
333 | }
|
334 | }
|
335 |
|
336 |
|
337 | for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
|
338 | var k2_offset = v_offset + k2;
|
339 | var x2;
|
340 | if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
|
341 | x2 = v2[k2_offset + 1];
|
342 | } else {
|
343 | x2 = v2[k2_offset - 1] + 1;
|
344 | }
|
345 | var y2 = x2 - k2;
|
346 | while (x2 < text1_length && y2 < text2_length &&
|
347 | text1.charAt(text1_length - x2 - 1) ==
|
348 | text2.charAt(text2_length - y2 - 1)) {
|
349 | x2++;
|
350 | y2++;
|
351 | }
|
352 | v2[k2_offset] = x2;
|
353 | if (x2 > text1_length) {
|
354 |
|
355 | k2end += 2;
|
356 | } else if (y2 > text2_length) {
|
357 |
|
358 | k2start += 2;
|
359 | } else if (!front) {
|
360 | var k1_offset = v_offset + delta - k2;
|
361 | if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
|
362 | var x1 = v1[k1_offset];
|
363 | var y1 = v_offset + x1 - k1_offset;
|
364 |
|
365 | x2 = text1_length - x2;
|
366 | if (x1 >= x2) {
|
367 |
|
368 | return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
369 | }
|
370 | }
|
371 | }
|
372 | }
|
373 | }
|
374 |
|
375 |
|
376 | return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
|
377 | };
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 | diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,
|
392 | deadline) {
|
393 | var text1a = text1.substring(0, x);
|
394 | var text2a = text2.substring(0, y);
|
395 | var text1b = text1.substring(x);
|
396 | var text2b = text2.substring(y);
|
397 |
|
398 |
|
399 | var diffs = this.diff_main(text1a, text2a, false, deadline);
|
400 | var diffsb = this.diff_main(text1b, text2b, false, deadline);
|
401 |
|
402 | return diffs.concat(diffsb);
|
403 | };
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 | diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
|
418 | var lineArray = [];
|
419 | var lineHash = {};
|
420 |
|
421 |
|
422 |
|
423 | lineArray[0] = '';
|
424 |
|
425 | |
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 | function diff_linesToCharsMunge_(text) {
|
434 | var chars = '';
|
435 |
|
436 |
|
437 |
|
438 | var lineStart = 0;
|
439 | var lineEnd = -1;
|
440 |
|
441 | var lineArrayLength = lineArray.length;
|
442 | while (lineEnd < text.length - 1) {
|
443 | lineEnd = text.indexOf('\n', lineStart);
|
444 | if (lineEnd == -1) {
|
445 | lineEnd = text.length - 1;
|
446 | }
|
447 | var line = text.substring(lineStart, lineEnd + 1);
|
448 | lineStart = lineEnd + 1;
|
449 |
|
450 | if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :
|
451 | (lineHash[line] !== undefined)) {
|
452 | chars += String.fromCharCode(lineHash[line]);
|
453 | } else {
|
454 | chars += String.fromCharCode(lineArrayLength);
|
455 | lineHash[line] = lineArrayLength;
|
456 | lineArray[lineArrayLength++] = line;
|
457 | }
|
458 | }
|
459 | return chars;
|
460 | }
|
461 |
|
462 | var chars1 = diff_linesToCharsMunge_(text1);
|
463 | var chars2 = diff_linesToCharsMunge_(text2);
|
464 | return {chars1: chars1, chars2: chars2, lineArray: lineArray};
|
465 | };
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {
|
476 | for (var x = 0; x < diffs.length; x++) {
|
477 | var chars = diffs[x][1];
|
478 | var text = [];
|
479 | for (var y = 0; y < chars.length; y++) {
|
480 | text[y] = lineArray[chars.charCodeAt(y)];
|
481 | }
|
482 | diffs[x][1] = text.join('');
|
483 | }
|
484 | };
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
|
495 |
|
496 | if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
|
497 | return 0;
|
498 | }
|
499 |
|
500 |
|
501 | var pointermin = 0;
|
502 | var pointermax = Math.min(text1.length, text2.length);
|
503 | var pointermid = pointermax;
|
504 | var pointerstart = 0;
|
505 | while (pointermin < pointermid) {
|
506 | if (text1.substring(pointerstart, pointermid) ==
|
507 | text2.substring(pointerstart, pointermid)) {
|
508 | pointermin = pointermid;
|
509 | pointerstart = pointermin;
|
510 | } else {
|
511 | pointermax = pointermid;
|
512 | }
|
513 | pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
514 | }
|
515 | return pointermid;
|
516 | };
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 | diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
|
526 |
|
527 | if (!text1 || !text2 ||
|
528 | text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
|
529 | return 0;
|
530 | }
|
531 |
|
532 |
|
533 | var pointermin = 0;
|
534 | var pointermax = Math.min(text1.length, text2.length);
|
535 | var pointermid = pointermax;
|
536 | var pointerend = 0;
|
537 | while (pointermin < pointermid) {
|
538 | if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==
|
539 | text2.substring(text2.length - pointermid, text2.length - pointerend)) {
|
540 | pointermin = pointermid;
|
541 | pointerend = pointermin;
|
542 | } else {
|
543 | pointermax = pointermid;
|
544 | }
|
545 | pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
546 | }
|
547 | return pointermid;
|
548 | };
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 | diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
|
560 |
|
561 | var text1_length = text1.length;
|
562 | var text2_length = text2.length;
|
563 |
|
564 | if (text1_length == 0 || text2_length == 0) {
|
565 | return 0;
|
566 | }
|
567 |
|
568 | if (text1_length > text2_length) {
|
569 | text1 = text1.substring(text1_length - text2_length);
|
570 | } else if (text1_length < text2_length) {
|
571 | text2 = text2.substring(0, text1_length);
|
572 | }
|
573 | var text_length = Math.min(text1_length, text2_length);
|
574 |
|
575 | if (text1 == text2) {
|
576 | return text_length;
|
577 | }
|
578 |
|
579 |
|
580 |
|
581 |
|
582 | var best = 0;
|
583 | var length = 1;
|
584 | while (true) {
|
585 | var pattern = text1.substring(text_length - length);
|
586 | var found = text2.indexOf(pattern);
|
587 | if (found == -1) {
|
588 | return best;
|
589 | }
|
590 | length += found;
|
591 | if (found == 0 || text1.substring(text_length - length) ==
|
592 | text2.substring(0, length)) {
|
593 | best = length;
|
594 | length++;
|
595 | }
|
596 | }
|
597 | };
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 | diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
|
612 | if (this.Diff_Timeout <= 0) {
|
613 |
|
614 | return null;
|
615 | }
|
616 | var longtext = text1.length > text2.length ? text1 : text2;
|
617 | var shorttext = text1.length > text2.length ? text2 : text1;
|
618 | if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
|
619 | return null;
|
620 | }
|
621 | var dmp = this;
|
622 |
|
623 | |
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 | function diff_halfMatchI_(longtext, shorttext, i) {
|
636 |
|
637 | var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
|
638 | var j = -1;
|
639 | var best_common = '';
|
640 | var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
|
641 | while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
|
642 | var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),
|
643 | shorttext.substring(j));
|
644 | var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),
|
645 | shorttext.substring(0, j));
|
646 | if (best_common.length < suffixLength + prefixLength) {
|
647 | best_common = shorttext.substring(j - suffixLength, j) +
|
648 | shorttext.substring(j, j + prefixLength);
|
649 | best_longtext_a = longtext.substring(0, i - suffixLength);
|
650 | best_longtext_b = longtext.substring(i + prefixLength);
|
651 | best_shorttext_a = shorttext.substring(0, j - suffixLength);
|
652 | best_shorttext_b = shorttext.substring(j + prefixLength);
|
653 | }
|
654 | }
|
655 | if (best_common.length * 2 >= longtext.length) {
|
656 | return [best_longtext_a, best_longtext_b,
|
657 | best_shorttext_a, best_shorttext_b, best_common];
|
658 | } else {
|
659 | return null;
|
660 | }
|
661 | }
|
662 |
|
663 |
|
664 | var hm1 = diff_halfMatchI_(longtext, shorttext,
|
665 | Math.ceil(longtext.length / 4));
|
666 |
|
667 | var hm2 = diff_halfMatchI_(longtext, shorttext,
|
668 | Math.ceil(longtext.length / 2));
|
669 | var hm;
|
670 | if (!hm1 && !hm2) {
|
671 | return null;
|
672 | } else if (!hm2) {
|
673 | hm = hm1;
|
674 | } else if (!hm1) {
|
675 | hm = hm2;
|
676 | } else {
|
677 |
|
678 | hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
|
679 | }
|
680 |
|
681 |
|
682 | var text1_a, text1_b, text2_a, text2_b;
|
683 | if (text1.length > text2.length) {
|
684 | text1_a = hm[0];
|
685 | text1_b = hm[1];
|
686 | text2_a = hm[2];
|
687 | text2_b = hm[3];
|
688 | } else {
|
689 | text2_a = hm[0];
|
690 | text2_b = hm[1];
|
691 | text1_a = hm[2];
|
692 | text1_b = hm[3];
|
693 | }
|
694 | var mid_common = hm[4];
|
695 | return [text1_a, text1_b, text2_a, text2_b, mid_common];
|
696 | };
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 | diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
|
704 | var changes = false;
|
705 | var equalities = [];
|
706 | var equalitiesLength = 0;
|
707 |
|
708 | var lastequality = null;
|
709 |
|
710 | var pointer = 0;
|
711 |
|
712 | var length_insertions1 = 0;
|
713 | var length_deletions1 = 0;
|
714 |
|
715 | var length_insertions2 = 0;
|
716 | var length_deletions2 = 0;
|
717 | while (pointer < diffs.length) {
|
718 | if (diffs[pointer][0] == DIFF_EQUAL) {
|
719 | equalities[equalitiesLength++] = pointer;
|
720 | length_insertions1 = length_insertions2;
|
721 | length_deletions1 = length_deletions2;
|
722 | length_insertions2 = 0;
|
723 | length_deletions2 = 0;
|
724 | lastequality = diffs[pointer][1];
|
725 | } else {
|
726 | if (diffs[pointer][0] == DIFF_INSERT) {
|
727 | length_insertions2 += diffs[pointer][1].length;
|
728 | } else {
|
729 | length_deletions2 += diffs[pointer][1].length;
|
730 | }
|
731 |
|
732 |
|
733 | if (lastequality && (lastequality.length <=
|
734 | Math.max(length_insertions1, length_deletions1)) &&
|
735 | (lastequality.length <= Math.max(length_insertions2,
|
736 | length_deletions2))) {
|
737 |
|
738 | diffs.splice(equalities[equalitiesLength - 1], 0,
|
739 | [DIFF_DELETE, lastequality]);
|
740 |
|
741 | diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
742 |
|
743 | equalitiesLength--;
|
744 |
|
745 | equalitiesLength--;
|
746 | pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
747 | length_insertions1 = 0;
|
748 | length_deletions1 = 0;
|
749 | length_insertions2 = 0;
|
750 | length_deletions2 = 0;
|
751 | lastequality = null;
|
752 | changes = true;
|
753 | }
|
754 | }
|
755 | pointer++;
|
756 | }
|
757 |
|
758 |
|
759 | if (changes) {
|
760 | this.diff_cleanupMerge(diffs);
|
761 | }
|
762 | this.diff_cleanupSemanticLossless(diffs);
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 | pointer = 1;
|
771 | while (pointer < diffs.length) {
|
772 | if (diffs[pointer - 1][0] == DIFF_DELETE &&
|
773 | diffs[pointer][0] == DIFF_INSERT) {
|
774 | var deletion = diffs[pointer - 1][1];
|
775 | var insertion = diffs[pointer][1];
|
776 | var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);
|
777 | var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);
|
778 | if (overlap_length1 >= overlap_length2) {
|
779 | if (overlap_length1 >= deletion.length / 2 ||
|
780 | overlap_length1 >= insertion.length / 2) {
|
781 |
|
782 | diffs.splice(pointer, 0,
|
783 | [DIFF_EQUAL, insertion.substring(0, overlap_length1)]);
|
784 | diffs[pointer - 1][1] =
|
785 | deletion.substring(0, deletion.length - overlap_length1);
|
786 | diffs[pointer + 1][1] = insertion.substring(overlap_length1);
|
787 | pointer++;
|
788 | }
|
789 | } else {
|
790 | if (overlap_length2 >= deletion.length / 2 ||
|
791 | overlap_length2 >= insertion.length / 2) {
|
792 |
|
793 |
|
794 | diffs.splice(pointer, 0,
|
795 | [DIFF_EQUAL, deletion.substring(0, overlap_length2)]);
|
796 | diffs[pointer - 1][0] = DIFF_INSERT;
|
797 | diffs[pointer - 1][1] =
|
798 | insertion.substring(0, insertion.length - overlap_length2);
|
799 | diffs[pointer + 1][0] = DIFF_DELETE;
|
800 | diffs[pointer + 1][1] =
|
801 | deletion.substring(overlap_length2);
|
802 | pointer++;
|
803 | }
|
804 | }
|
805 | pointer++;
|
806 | }
|
807 | pointer++;
|
808 | }
|
809 | };
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 | diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
|
819 | |
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 | function diff_cleanupSemanticScore_(one, two) {
|
830 | if (!one || !two) {
|
831 |
|
832 | return 6;
|
833 | }
|
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 | var char1 = one.charAt(one.length - 1);
|
841 | var char2 = two.charAt(0);
|
842 | var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);
|
843 | var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);
|
844 | var whitespace1 = nonAlphaNumeric1 &&
|
845 | char1.match(diff_match_patch.whitespaceRegex_);
|
846 | var whitespace2 = nonAlphaNumeric2 &&
|
847 | char2.match(diff_match_patch.whitespaceRegex_);
|
848 | var lineBreak1 = whitespace1 &&
|
849 | char1.match(diff_match_patch.linebreakRegex_);
|
850 | var lineBreak2 = whitespace2 &&
|
851 | char2.match(diff_match_patch.linebreakRegex_);
|
852 | var blankLine1 = lineBreak1 &&
|
853 | one.match(diff_match_patch.blanklineEndRegex_);
|
854 | var blankLine2 = lineBreak2 &&
|
855 | two.match(diff_match_patch.blanklineStartRegex_);
|
856 |
|
857 | if (blankLine1 || blankLine2) {
|
858 |
|
859 | return 5;
|
860 | } else if (lineBreak1 || lineBreak2) {
|
861 |
|
862 | return 4;
|
863 | } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
|
864 |
|
865 | return 3;
|
866 | } else if (whitespace1 || whitespace2) {
|
867 |
|
868 | return 2;
|
869 | } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
|
870 |
|
871 | return 1;
|
872 | }
|
873 | return 0;
|
874 | }
|
875 |
|
876 | var pointer = 1;
|
877 |
|
878 | while (pointer < diffs.length - 1) {
|
879 | if (diffs[pointer - 1][0] == DIFF_EQUAL &&
|
880 | diffs[pointer + 1][0] == DIFF_EQUAL) {
|
881 |
|
882 | var equality1 = diffs[pointer - 1][1];
|
883 | var edit = diffs[pointer][1];
|
884 | var equality2 = diffs[pointer + 1][1];
|
885 |
|
886 |
|
887 | var commonOffset = this.diff_commonSuffix(equality1, edit);
|
888 | if (commonOffset) {
|
889 | var commonString = edit.substring(edit.length - commonOffset);
|
890 | equality1 = equality1.substring(0, equality1.length - commonOffset);
|
891 | edit = commonString + edit.substring(0, edit.length - commonOffset);
|
892 | equality2 = commonString + equality2;
|
893 | }
|
894 |
|
895 |
|
896 | var bestEquality1 = equality1;
|
897 | var bestEdit = edit;
|
898 | var bestEquality2 = equality2;
|
899 | var bestScore = diff_cleanupSemanticScore_(equality1, edit) +
|
900 | diff_cleanupSemanticScore_(edit, equality2);
|
901 | while (edit.charAt(0) === equality2.charAt(0)) {
|
902 | equality1 += edit.charAt(0);
|
903 | edit = edit.substring(1) + equality2.charAt(0);
|
904 | equality2 = equality2.substring(1);
|
905 | var score = diff_cleanupSemanticScore_(equality1, edit) +
|
906 | diff_cleanupSemanticScore_(edit, equality2);
|
907 |
|
908 | if (score >= bestScore) {
|
909 | bestScore = score;
|
910 | bestEquality1 = equality1;
|
911 | bestEdit = edit;
|
912 | bestEquality2 = equality2;
|
913 | }
|
914 | }
|
915 |
|
916 | if (diffs[pointer - 1][1] != bestEquality1) {
|
917 |
|
918 | if (bestEquality1) {
|
919 | diffs[pointer - 1][1] = bestEquality1;
|
920 | } else {
|
921 | diffs.splice(pointer - 1, 1);
|
922 | pointer--;
|
923 | }
|
924 | diffs[pointer][1] = bestEdit;
|
925 | if (bestEquality2) {
|
926 | diffs[pointer + 1][1] = bestEquality2;
|
927 | } else {
|
928 | diffs.splice(pointer + 1, 1);
|
929 | pointer--;
|
930 | }
|
931 | }
|
932 | }
|
933 | pointer++;
|
934 | }
|
935 | };
|
936 |
|
937 |
|
938 | diff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;
|
939 | diff_match_patch.whitespaceRegex_ = /\s/;
|
940 | diff_match_patch.linebreakRegex_ = /[\r\n]/;
|
941 | diff_match_patch.blanklineEndRegex_ = /\n\r?\n$/;
|
942 | diff_match_patch.blanklineStartRegex_ = /^\r?\n\r?\n/;
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 | diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
|
949 | var changes = false;
|
950 | var equalities = [];
|
951 | var equalitiesLength = 0;
|
952 |
|
953 | var lastequality = null;
|
954 |
|
955 | var pointer = 0;
|
956 |
|
957 | var pre_ins = false;
|
958 |
|
959 | var pre_del = false;
|
960 |
|
961 | var post_ins = false;
|
962 |
|
963 | var post_del = false;
|
964 | while (pointer < diffs.length) {
|
965 | if (diffs[pointer][0] == DIFF_EQUAL) {
|
966 | if (diffs[pointer][1].length < this.Diff_EditCost &&
|
967 | (post_ins || post_del)) {
|
968 |
|
969 | equalities[equalitiesLength++] = pointer;
|
970 | pre_ins = post_ins;
|
971 | pre_del = post_del;
|
972 | lastequality = diffs[pointer][1];
|
973 | } else {
|
974 |
|
975 | equalitiesLength = 0;
|
976 | lastequality = null;
|
977 | }
|
978 | post_ins = post_del = false;
|
979 | } else {
|
980 | if (diffs[pointer][0] == DIFF_DELETE) {
|
981 | post_del = true;
|
982 | } else {
|
983 | post_ins = true;
|
984 | }
|
985 | |
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 | if (lastequality && ((pre_ins && pre_del && post_ins && post_del) ||
|
994 | ((lastequality.length < this.Diff_EditCost / 2) &&
|
995 | (pre_ins + pre_del + post_ins + post_del) == 3))) {
|
996 |
|
997 | diffs.splice(equalities[equalitiesLength - 1], 0,
|
998 | [DIFF_DELETE, lastequality]);
|
999 |
|
1000 | diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
1001 | equalitiesLength--;
|
1002 | lastequality = null;
|
1003 | if (pre_ins && pre_del) {
|
1004 |
|
1005 | post_ins = post_del = true;
|
1006 | equalitiesLength = 0;
|
1007 | } else {
|
1008 | equalitiesLength--;
|
1009 | pointer = equalitiesLength > 0 ?
|
1010 | equalities[equalitiesLength - 1] : -1;
|
1011 | post_ins = post_del = false;
|
1012 | }
|
1013 | changes = true;
|
1014 | }
|
1015 | }
|
1016 | pointer++;
|
1017 | }
|
1018 |
|
1019 | if (changes) {
|
1020 | this.diff_cleanupMerge(diffs);
|
1021 | }
|
1022 | };
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 | diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
|
1031 | diffs.push([DIFF_EQUAL, '']);
|
1032 | var pointer = 0;
|
1033 | var count_delete = 0;
|
1034 | var count_insert = 0;
|
1035 | var text_delete = '';
|
1036 | var text_insert = '';
|
1037 | var commonlength;
|
1038 | while (pointer < diffs.length) {
|
1039 | switch (diffs[pointer][0]) {
|
1040 | case DIFF_INSERT:
|
1041 | count_insert++;
|
1042 | text_insert += diffs[pointer][1];
|
1043 | pointer++;
|
1044 | break;
|
1045 | case DIFF_DELETE:
|
1046 | count_delete++;
|
1047 | text_delete += diffs[pointer][1];
|
1048 | pointer++;
|
1049 | break;
|
1050 | case DIFF_EQUAL:
|
1051 |
|
1052 | if (count_delete + count_insert > 1) {
|
1053 | if (count_delete !== 0 && count_insert !== 0) {
|
1054 |
|
1055 | commonlength = this.diff_commonPrefix(text_insert, text_delete);
|
1056 | if (commonlength !== 0) {
|
1057 | if ((pointer - count_delete - count_insert) > 0 &&
|
1058 | diffs[pointer - count_delete - count_insert - 1][0] ==
|
1059 | DIFF_EQUAL) {
|
1060 | diffs[pointer - count_delete - count_insert - 1][1] +=
|
1061 | text_insert.substring(0, commonlength);
|
1062 | } else {
|
1063 | diffs.splice(0, 0, [DIFF_EQUAL,
|
1064 | text_insert.substring(0, commonlength)]);
|
1065 | pointer++;
|
1066 | }
|
1067 | text_insert = text_insert.substring(commonlength);
|
1068 | text_delete = text_delete.substring(commonlength);
|
1069 | }
|
1070 |
|
1071 | commonlength = this.diff_commonSuffix(text_insert, text_delete);
|
1072 | if (commonlength !== 0) {
|
1073 | diffs[pointer][1] = text_insert.substring(text_insert.length -
|
1074 | commonlength) + diffs[pointer][1];
|
1075 | text_insert = text_insert.substring(0, text_insert.length -
|
1076 | commonlength);
|
1077 | text_delete = text_delete.substring(0, text_delete.length -
|
1078 | commonlength);
|
1079 | }
|
1080 | }
|
1081 |
|
1082 | if (count_delete === 0) {
|
1083 | diffs.splice(pointer - count_insert,
|
1084 | count_delete + count_insert, [DIFF_INSERT, text_insert]);
|
1085 | } else if (count_insert === 0) {
|
1086 | diffs.splice(pointer - count_delete,
|
1087 | count_delete + count_insert, [DIFF_DELETE, text_delete]);
|
1088 | } else {
|
1089 | diffs.splice(pointer - count_delete - count_insert,
|
1090 | count_delete + count_insert, [DIFF_DELETE, text_delete],
|
1091 | [DIFF_INSERT, text_insert]);
|
1092 | }
|
1093 | pointer = pointer - count_delete - count_insert +
|
1094 | (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
|
1095 | } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
|
1096 |
|
1097 | diffs[pointer - 1][1] += diffs[pointer][1];
|
1098 | diffs.splice(pointer, 1);
|
1099 | } else {
|
1100 | pointer++;
|
1101 | }
|
1102 | count_insert = 0;
|
1103 | count_delete = 0;
|
1104 | text_delete = '';
|
1105 | text_insert = '';
|
1106 | break;
|
1107 | }
|
1108 | }
|
1109 | if (diffs[diffs.length - 1][1] === '') {
|
1110 | diffs.pop();
|
1111 | }
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 | var changes = false;
|
1117 | pointer = 1;
|
1118 |
|
1119 | while (pointer < diffs.length - 1) {
|
1120 | if (diffs[pointer - 1][0] == DIFF_EQUAL &&
|
1121 | diffs[pointer + 1][0] == DIFF_EQUAL) {
|
1122 |
|
1123 | if (diffs[pointer][1].substring(diffs[pointer][1].length -
|
1124 | diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
|
1125 |
|
1126 | diffs[pointer][1] = diffs[pointer - 1][1] +
|
1127 | diffs[pointer][1].substring(0, diffs[pointer][1].length -
|
1128 | diffs[pointer - 1][1].length);
|
1129 | diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
|
1130 | diffs.splice(pointer - 1, 1);
|
1131 | changes = true;
|
1132 | } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==
|
1133 | diffs[pointer + 1][1]) {
|
1134 |
|
1135 | diffs[pointer - 1][1] += diffs[pointer + 1][1];
|
1136 | diffs[pointer][1] =
|
1137 | diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
|
1138 | diffs[pointer + 1][1];
|
1139 | diffs.splice(pointer + 1, 1);
|
1140 | changes = true;
|
1141 | }
|
1142 | }
|
1143 | pointer++;
|
1144 | }
|
1145 |
|
1146 | if (changes) {
|
1147 | this.diff_cleanupMerge(diffs);
|
1148 | }
|
1149 | };
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 | diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
|
1161 | var chars1 = 0;
|
1162 | var chars2 = 0;
|
1163 | var last_chars1 = 0;
|
1164 | var last_chars2 = 0;
|
1165 | var x;
|
1166 | for (x = 0; x < diffs.length; x++) {
|
1167 | if (diffs[x][0] !== DIFF_INSERT) {
|
1168 | chars1 += diffs[x][1].length;
|
1169 | }
|
1170 | if (diffs[x][0] !== DIFF_DELETE) {
|
1171 | chars2 += diffs[x][1].length;
|
1172 | }
|
1173 | if (chars1 > loc) {
|
1174 | break;
|
1175 | }
|
1176 | last_chars1 = chars1;
|
1177 | last_chars2 = chars2;
|
1178 | }
|
1179 |
|
1180 | if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {
|
1181 | return last_chars2;
|
1182 | }
|
1183 |
|
1184 | return last_chars2 + (loc - last_chars1);
|
1185 | };
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 | diff_match_patch.prototype.diff_prettyHtml = function(diffs) {
|
1194 | var html = [];
|
1195 | var pattern_amp = /&/g;
|
1196 | var pattern_lt = /</g;
|
1197 | var pattern_gt = />/g;
|
1198 | var pattern_para = /\n/g;
|
1199 | for (var x = 0; x < diffs.length; x++) {
|
1200 | var op = diffs[x][0];
|
1201 | var data = diffs[x][1];
|
1202 | var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
|
1203 | .replace(pattern_gt, '>').replace(pattern_para, '¶<br>');
|
1204 | switch (op) {
|
1205 | case DIFF_INSERT:
|
1206 | html[x] = '<ins style="background:#e6ffe6;">' + text + '</ins>';
|
1207 | break;
|
1208 | case DIFF_DELETE:
|
1209 | html[x] = '<del style="background:#ffe6e6;">' + text + '</del>';
|
1210 | break;
|
1211 | case DIFF_EQUAL:
|
1212 | html[x] = '<span>' + text + '</span>';
|
1213 | break;
|
1214 | }
|
1215 | }
|
1216 | return html.join('');
|
1217 | };
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 | diff_match_patch.prototype.diff_text1 = function(diffs) {
|
1226 | var text = [];
|
1227 | for (var x = 0; x < diffs.length; x++) {
|
1228 | if (diffs[x][0] !== DIFF_INSERT) {
|
1229 | text[x] = diffs[x][1];
|
1230 | }
|
1231 | }
|
1232 | return text.join('');
|
1233 | };
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 | diff_match_patch.prototype.diff_text2 = function(diffs) {
|
1242 | var text = [];
|
1243 | for (var x = 0; x < diffs.length; x++) {
|
1244 | if (diffs[x][0] !== DIFF_DELETE) {
|
1245 | text[x] = diffs[x][1];
|
1246 | }
|
1247 | }
|
1248 | return text.join('');
|
1249 | };
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 | diff_match_patch.prototype.diff_levenshtein = function(diffs) {
|
1259 | var levenshtein = 0;
|
1260 | var insertions = 0;
|
1261 | var deletions = 0;
|
1262 | for (var x = 0; x < diffs.length; x++) {
|
1263 | var op = diffs[x][0];
|
1264 | var data = diffs[x][1];
|
1265 | switch (op) {
|
1266 | case DIFF_INSERT:
|
1267 | insertions += data.length;
|
1268 | break;
|
1269 | case DIFF_DELETE:
|
1270 | deletions += data.length;
|
1271 | break;
|
1272 | case DIFF_EQUAL:
|
1273 |
|
1274 | levenshtein += Math.max(insertions, deletions);
|
1275 | insertions = 0;
|
1276 | deletions = 0;
|
1277 | break;
|
1278 | }
|
1279 | }
|
1280 | levenshtein += Math.max(insertions, deletions);
|
1281 | return levenshtein;
|
1282 | };
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 | diff_match_patch.prototype.diff_toDelta = function(diffs) {
|
1294 | var text = [];
|
1295 | for (var x = 0; x < diffs.length; x++) {
|
1296 | switch (diffs[x][0]) {
|
1297 | case DIFF_INSERT:
|
1298 | text[x] = '+' + encodeURI(diffs[x][1]);
|
1299 | break;
|
1300 | case DIFF_DELETE:
|
1301 | text[x] = '-' + diffs[x][1].length;
|
1302 | break;
|
1303 | case DIFF_EQUAL:
|
1304 | text[x] = '=' + diffs[x][1].length;
|
1305 | break;
|
1306 | }
|
1307 | }
|
1308 | return text.join('\t').replace(/%20/g, ' ');
|
1309 | };
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 | diff_match_patch.prototype.diff_fromDelta = function(text1, delta) {
|
1321 | var diffs = [];
|
1322 | var diffsLength = 0;
|
1323 | var pointer = 0;
|
1324 | var tokens = delta.split(/\t/g);
|
1325 | for (var x = 0; x < tokens.length; x++) {
|
1326 |
|
1327 |
|
1328 | var param = tokens[x].substring(1);
|
1329 | switch (tokens[x].charAt(0)) {
|
1330 | case '+':
|
1331 | try {
|
1332 | diffs[diffsLength++] = [DIFF_INSERT, decodeURI(param)];
|
1333 | } catch (ex) {
|
1334 |
|
1335 | throw new Error('Illegal escape in diff_fromDelta: ' + param);
|
1336 | }
|
1337 | break;
|
1338 | case '-':
|
1339 |
|
1340 | case '=':
|
1341 | var n = parseInt(param, 10);
|
1342 | if (isNaN(n) || n < 0) {
|
1343 | throw new Error('Invalid number in diff_fromDelta: ' + param);
|
1344 | }
|
1345 | var text = text1.substring(pointer, pointer += n);
|
1346 | if (tokens[x].charAt(0) == '=') {
|
1347 | diffs[diffsLength++] = [DIFF_EQUAL, text];
|
1348 | } else {
|
1349 | diffs[diffsLength++] = [DIFF_DELETE, text];
|
1350 | }
|
1351 | break;
|
1352 | default:
|
1353 |
|
1354 |
|
1355 | if (tokens[x]) {
|
1356 | throw new Error('Invalid diff operation in diff_fromDelta: ' +
|
1357 | tokens[x]);
|
1358 | }
|
1359 | }
|
1360 | }
|
1361 | if (pointer != text1.length) {
|
1362 | throw new Error('Delta length (' + pointer +
|
1363 | ') does not equal source text length (' + text1.length + ').');
|
1364 | }
|
1365 | return diffs;
|
1366 | };
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 |
|
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 | diff_match_patch.prototype.match_main = function(text, pattern, loc) {
|
1380 |
|
1381 | if (text == null || pattern == null || loc == null) {
|
1382 | throw new Error('Null input. (match_main)');
|
1383 | }
|
1384 |
|
1385 | loc = Math.max(0, Math.min(loc, text.length));
|
1386 | if (text == pattern) {
|
1387 |
|
1388 | return 0;
|
1389 | } else if (!text.length) {
|
1390 |
|
1391 | return -1;
|
1392 | } else if (text.substring(loc, loc + pattern.length) == pattern) {
|
1393 |
|
1394 | return loc;
|
1395 | } else {
|
1396 |
|
1397 | return this.match_bitap_(text, pattern, loc);
|
1398 | }
|
1399 | };
|
1400 |
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 | diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
|
1412 | if (pattern.length > this.Match_MaxBits) {
|
1413 | throw new Error('Pattern too long for this browser.');
|
1414 | }
|
1415 |
|
1416 |
|
1417 | var s = this.match_alphabet_(pattern);
|
1418 |
|
1419 | var dmp = this;
|
1420 |
|
1421 | |
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 | function match_bitapScore_(e, x) {
|
1430 | var accuracy = e / pattern.length;
|
1431 | var proximity = Math.abs(loc - x);
|
1432 | if (!dmp.Match_Distance) {
|
1433 |
|
1434 | return proximity ? 1.0 : accuracy;
|
1435 | }
|
1436 | return accuracy + (proximity / dmp.Match_Distance);
|
1437 | }
|
1438 |
|
1439 |
|
1440 | var score_threshold = this.Match_Threshold;
|
1441 |
|
1442 | var best_loc = text.indexOf(pattern, loc);
|
1443 | if (best_loc != -1) {
|
1444 | score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
1445 |
|
1446 | best_loc = text.lastIndexOf(pattern, loc + pattern.length);
|
1447 | if (best_loc != -1) {
|
1448 | score_threshold =
|
1449 | Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
1450 | }
|
1451 | }
|
1452 |
|
1453 |
|
1454 | var matchmask = 1 << (pattern.length - 1);
|
1455 | best_loc = -1;
|
1456 |
|
1457 | var bin_min, bin_mid;
|
1458 | var bin_max = pattern.length + text.length;
|
1459 | var last_rd;
|
1460 | for (var d = 0; d < pattern.length; d++) {
|
1461 |
|
1462 |
|
1463 |
|
1464 | bin_min = 0;
|
1465 | bin_mid = bin_max;
|
1466 | while (bin_min < bin_mid) {
|
1467 | if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {
|
1468 | bin_min = bin_mid;
|
1469 | } else {
|
1470 | bin_max = bin_mid;
|
1471 | }
|
1472 | bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);
|
1473 | }
|
1474 |
|
1475 | bin_max = bin_mid;
|
1476 | var start = Math.max(1, loc - bin_mid + 1);
|
1477 | var finish = Math.min(loc + bin_mid, text.length) + pattern.length;
|
1478 |
|
1479 | var rd = Array(finish + 2);
|
1480 | rd[finish + 1] = (1 << d) - 1;
|
1481 | for (var j = finish; j >= start; j--) {
|
1482 |
|
1483 |
|
1484 | var charMatch = s[text.charAt(j - 1)];
|
1485 | if (d === 0) {
|
1486 | rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;
|
1487 | } else {
|
1488 | rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |
|
1489 | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |
|
1490 | last_rd[j + 1];
|
1491 | }
|
1492 | if (rd[j] & matchmask) {
|
1493 | var score = match_bitapScore_(d, j - 1);
|
1494 |
|
1495 |
|
1496 | if (score <= score_threshold) {
|
1497 |
|
1498 | score_threshold = score;
|
1499 | best_loc = j - 1;
|
1500 | if (best_loc > loc) {
|
1501 |
|
1502 | start = Math.max(1, 2 * loc - best_loc);
|
1503 | } else {
|
1504 |
|
1505 | break;
|
1506 | }
|
1507 | }
|
1508 | }
|
1509 | }
|
1510 |
|
1511 | if (match_bitapScore_(d + 1, loc) > score_threshold) {
|
1512 | break;
|
1513 | }
|
1514 | last_rd = rd;
|
1515 | }
|
1516 | return best_loc;
|
1517 | };
|
1518 |
|
1519 |
|
1520 |
|
1521 |
|
1522 |
|
1523 |
|
1524 |
|
1525 |
|
1526 | diff_match_patch.prototype.match_alphabet_ = function(pattern) {
|
1527 | var s = {};
|
1528 | for (var i = 0; i < pattern.length; i++) {
|
1529 | s[pattern.charAt(i)] = 0;
|
1530 | }
|
1531 | for (var i = 0; i < pattern.length; i++) {
|
1532 | s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);
|
1533 | }
|
1534 | return s;
|
1535 | };
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 | diff_match_patch.prototype.patch_addContext_ = function(patch, text) {
|
1549 | if (text.length == 0) {
|
1550 | return;
|
1551 | }
|
1552 | var pattern = text.substring(patch.start2, patch.start2 + patch.length1);
|
1553 | var padding = 0;
|
1554 |
|
1555 |
|
1556 |
|
1557 | while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&
|
1558 | pattern.length < this.Match_MaxBits - this.Patch_Margin -
|
1559 | this.Patch_Margin) {
|
1560 | padding += this.Patch_Margin;
|
1561 | pattern = text.substring(patch.start2 - padding,
|
1562 | patch.start2 + patch.length1 + padding);
|
1563 | }
|
1564 |
|
1565 | padding += this.Patch_Margin;
|
1566 |
|
1567 |
|
1568 | var prefix = text.substring(patch.start2 - padding, patch.start2);
|
1569 | if (prefix) {
|
1570 | patch.diffs.unshift([DIFF_EQUAL, prefix]);
|
1571 | }
|
1572 |
|
1573 | var suffix = text.substring(patch.start2 + patch.length1,
|
1574 | patch.start2 + patch.length1 + padding);
|
1575 | if (suffix) {
|
1576 | patch.diffs.push([DIFF_EQUAL, suffix]);
|
1577 | }
|
1578 |
|
1579 |
|
1580 | patch.start1 -= prefix.length;
|
1581 | patch.start2 -= prefix.length;
|
1582 |
|
1583 | patch.length1 += prefix.length + suffix.length;
|
1584 | patch.length2 += prefix.length + suffix.length;
|
1585 | };
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 | diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
|
1611 | var text1, diffs;
|
1612 | if (typeof a == 'string' && typeof opt_b == 'string' &&
|
1613 | typeof opt_c == 'undefined') {
|
1614 |
|
1615 |
|
1616 | text1 = (a);
|
1617 | diffs = this.diff_main(text1, (opt_b), true);
|
1618 | if (diffs.length > 2) {
|
1619 | this.diff_cleanupSemantic(diffs);
|
1620 | this.diff_cleanupEfficiency(diffs);
|
1621 | }
|
1622 | } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&
|
1623 | typeof opt_c == 'undefined') {
|
1624 |
|
1625 |
|
1626 | diffs = (a);
|
1627 | text1 = this.diff_text1(diffs);
|
1628 | } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&
|
1629 | typeof opt_c == 'undefined') {
|
1630 |
|
1631 | text1 = (a);
|
1632 | diffs = (opt_b);
|
1633 | } else if (typeof a == 'string' && typeof opt_b == 'string' &&
|
1634 | opt_c && typeof opt_c == 'object') {
|
1635 |
|
1636 |
|
1637 | text1 = (a);
|
1638 | diffs = (opt_c);
|
1639 | } else {
|
1640 | throw new Error('Unknown call format to patch_make.');
|
1641 | }
|
1642 |
|
1643 | if (diffs.length === 0) {
|
1644 | return [];
|
1645 | }
|
1646 | var patches = [];
|
1647 | var patch = new diff_match_patch.patch_obj();
|
1648 | var patchDiffLength = 0;
|
1649 | var char_count1 = 0;
|
1650 | var char_count2 = 0;
|
1651 |
|
1652 |
|
1653 |
|
1654 | var prepatch_text = text1;
|
1655 | var postpatch_text = text1;
|
1656 | for (var x = 0; x < diffs.length; x++) {
|
1657 | var diff_type = diffs[x][0];
|
1658 | var diff_text = diffs[x][1];
|
1659 |
|
1660 | if (!patchDiffLength && diff_type !== DIFF_EQUAL) {
|
1661 |
|
1662 | patch.start1 = char_count1;
|
1663 | patch.start2 = char_count2;
|
1664 | }
|
1665 |
|
1666 | switch (diff_type) {
|
1667 | case DIFF_INSERT:
|
1668 | patch.diffs[patchDiffLength++] = diffs[x];
|
1669 | patch.length2 += diff_text.length;
|
1670 | postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +
|
1671 | postpatch_text.substring(char_count2);
|
1672 | break;
|
1673 | case DIFF_DELETE:
|
1674 | patch.length1 += diff_text.length;
|
1675 | patch.diffs[patchDiffLength++] = diffs[x];
|
1676 | postpatch_text = postpatch_text.substring(0, char_count2) +
|
1677 | postpatch_text.substring(char_count2 +
|
1678 | diff_text.length);
|
1679 | break;
|
1680 | case DIFF_EQUAL:
|
1681 | if (diff_text.length <= 2 * this.Patch_Margin &&
|
1682 | patchDiffLength && diffs.length != x + 1) {
|
1683 |
|
1684 | patch.diffs[patchDiffLength++] = diffs[x];
|
1685 | patch.length1 += diff_text.length;
|
1686 | patch.length2 += diff_text.length;
|
1687 | } else if (diff_text.length >= 2 * this.Patch_Margin) {
|
1688 |
|
1689 | if (patchDiffLength) {
|
1690 | this.patch_addContext_(patch, prepatch_text);
|
1691 | patches.push(patch);
|
1692 | patch = new diff_match_patch.patch_obj();
|
1693 | patchDiffLength = 0;
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 | prepatch_text = postpatch_text;
|
1699 | char_count1 = char_count2;
|
1700 | }
|
1701 | }
|
1702 | break;
|
1703 | }
|
1704 |
|
1705 |
|
1706 | if (diff_type !== DIFF_INSERT) {
|
1707 | char_count1 += diff_text.length;
|
1708 | }
|
1709 | if (diff_type !== DIFF_DELETE) {
|
1710 | char_count2 += diff_text.length;
|
1711 | }
|
1712 | }
|
1713 |
|
1714 | if (patchDiffLength) {
|
1715 | this.patch_addContext_(patch, prepatch_text);
|
1716 | patches.push(patch);
|
1717 | }
|
1718 |
|
1719 | return patches;
|
1720 | };
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 | diff_match_patch.prototype.patch_deepCopy = function(patches) {
|
1729 |
|
1730 | var patchesCopy = [];
|
1731 | for (var x = 0; x < patches.length; x++) {
|
1732 | var patch = patches[x];
|
1733 | var patchCopy = new diff_match_patch.patch_obj();
|
1734 | patchCopy.diffs = [];
|
1735 | for (var y = 0; y < patch.diffs.length; y++) {
|
1736 | patchCopy.diffs[y] = patch.diffs[y].slice();
|
1737 | }
|
1738 | patchCopy.start1 = patch.start1;
|
1739 | patchCopy.start2 = patch.start2;
|
1740 | patchCopy.length1 = patch.length1;
|
1741 | patchCopy.length2 = patch.length2;
|
1742 | patchesCopy[x] = patchCopy;
|
1743 | }
|
1744 | return patchesCopy;
|
1745 | };
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 | diff_match_patch.prototype.patch_apply = function(patches, text) {
|
1757 | if (patches.length == 0) {
|
1758 | return [text, []];
|
1759 | }
|
1760 |
|
1761 |
|
1762 | patches = this.patch_deepCopy(patches);
|
1763 |
|
1764 | var nullPadding = this.patch_addPadding(patches);
|
1765 | text = nullPadding + text + nullPadding;
|
1766 |
|
1767 | this.patch_splitMax(patches);
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 | var delta = 0;
|
1773 | var results = [];
|
1774 | for (var x = 0; x < patches.length; x++) {
|
1775 | var expected_loc = patches[x].start2 + delta;
|
1776 | var text1 = this.diff_text1(patches[x].diffs);
|
1777 | var start_loc;
|
1778 | var end_loc = -1;
|
1779 | if (text1.length > this.Match_MaxBits) {
|
1780 |
|
1781 |
|
1782 | start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),
|
1783 | expected_loc);
|
1784 | if (start_loc != -1) {
|
1785 | end_loc = this.match_main(text,
|
1786 | text1.substring(text1.length - this.Match_MaxBits),
|
1787 | expected_loc + text1.length - this.Match_MaxBits);
|
1788 | if (end_loc == -1 || start_loc >= end_loc) {
|
1789 |
|
1790 | start_loc = -1;
|
1791 | }
|
1792 | }
|
1793 | } else {
|
1794 | start_loc = this.match_main(text, text1, expected_loc);
|
1795 | }
|
1796 | if (start_loc == -1) {
|
1797 |
|
1798 | results[x] = false;
|
1799 |
|
1800 | delta -= patches[x].length2 - patches[x].length1;
|
1801 | } else {
|
1802 |
|
1803 | results[x] = true;
|
1804 | delta = start_loc - expected_loc;
|
1805 | var text2;
|
1806 | if (end_loc == -1) {
|
1807 | text2 = text.substring(start_loc, start_loc + text1.length);
|
1808 | } else {
|
1809 | text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);
|
1810 | }
|
1811 | if (text1 == text2) {
|
1812 |
|
1813 | text = text.substring(0, start_loc) +
|
1814 | this.diff_text2(patches[x].diffs) +
|
1815 | text.substring(start_loc + text1.length);
|
1816 | } else {
|
1817 |
|
1818 |
|
1819 | var diffs = this.diff_main(text1, text2, false);
|
1820 | if (text1.length > this.Match_MaxBits &&
|
1821 | this.diff_levenshtein(diffs) / text1.length >
|
1822 | this.Patch_DeleteThreshold) {
|
1823 |
|
1824 | results[x] = false;
|
1825 | } else {
|
1826 | this.diff_cleanupSemanticLossless(diffs);
|
1827 | var index1 = 0;
|
1828 | var index2;
|
1829 | for (var y = 0; y < patches[x].diffs.length; y++) {
|
1830 | var mod = patches[x].diffs[y];
|
1831 | if (mod[0] !== DIFF_EQUAL) {
|
1832 | index2 = this.diff_xIndex(diffs, index1);
|
1833 | }
|
1834 | if (mod[0] === DIFF_INSERT) {
|
1835 | text = text.substring(0, start_loc + index2) + mod[1] +
|
1836 | text.substring(start_loc + index2);
|
1837 | } else if (mod[0] === DIFF_DELETE) {
|
1838 | text = text.substring(0, start_loc + index2) +
|
1839 | text.substring(start_loc + this.diff_xIndex(diffs,
|
1840 | index1 + mod[1].length));
|
1841 | }
|
1842 | if (mod[0] !== DIFF_DELETE) {
|
1843 | index1 += mod[1].length;
|
1844 | }
|
1845 | }
|
1846 | }
|
1847 | }
|
1848 | }
|
1849 | }
|
1850 |
|
1851 | text = text.substring(nullPadding.length, text.length - nullPadding.length);
|
1852 | return [text, results];
|
1853 | };
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 | diff_match_patch.prototype.patch_addPadding = function(patches) {
|
1863 | var paddingLength = this.Patch_Margin;
|
1864 | var nullPadding = '';
|
1865 | for (var x = 1; x <= paddingLength; x++) {
|
1866 | nullPadding += String.fromCharCode(x);
|
1867 | }
|
1868 |
|
1869 |
|
1870 | for (var x = 0; x < patches.length; x++) {
|
1871 | patches[x].start1 += paddingLength;
|
1872 | patches[x].start2 += paddingLength;
|
1873 | }
|
1874 |
|
1875 |
|
1876 | var patch = patches[0];
|
1877 | var diffs = patch.diffs;
|
1878 | if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {
|
1879 |
|
1880 | diffs.unshift([DIFF_EQUAL, nullPadding]);
|
1881 | patch.start1 -= paddingLength;
|
1882 | patch.start2 -= paddingLength;
|
1883 | patch.length1 += paddingLength;
|
1884 | patch.length2 += paddingLength;
|
1885 | } else if (paddingLength > diffs[0][1].length) {
|
1886 |
|
1887 | var extraLength = paddingLength - diffs[0][1].length;
|
1888 | diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];
|
1889 | patch.start1 -= extraLength;
|
1890 | patch.start2 -= extraLength;
|
1891 | patch.length1 += extraLength;
|
1892 | patch.length2 += extraLength;
|
1893 | }
|
1894 |
|
1895 |
|
1896 | patch = patches[patches.length - 1];
|
1897 | diffs = patch.diffs;
|
1898 | if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {
|
1899 |
|
1900 | diffs.push([DIFF_EQUAL, nullPadding]);
|
1901 | patch.length1 += paddingLength;
|
1902 | patch.length2 += paddingLength;
|
1903 | } else if (paddingLength > diffs[diffs.length - 1][1].length) {
|
1904 |
|
1905 | var extraLength = paddingLength - diffs[diffs.length - 1][1].length;
|
1906 | diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);
|
1907 | patch.length1 += extraLength;
|
1908 | patch.length2 += extraLength;
|
1909 | }
|
1910 |
|
1911 | return nullPadding;
|
1912 | };
|
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 | diff_match_patch.prototype.patch_splitMax = function(patches) {
|
1922 | var patch_size = this.Match_MaxBits;
|
1923 | for (var x = 0; x < patches.length; x++) {
|
1924 | if (patches[x].length1 <= patch_size) {
|
1925 | continue;
|
1926 | }
|
1927 | var bigpatch = patches[x];
|
1928 |
|
1929 | patches.splice(x--, 1);
|
1930 | var start1 = bigpatch.start1;
|
1931 | var start2 = bigpatch.start2;
|
1932 | var precontext = '';
|
1933 | while (bigpatch.diffs.length !== 0) {
|
1934 |
|
1935 | var patch = new diff_match_patch.patch_obj();
|
1936 | var empty = true;
|
1937 | patch.start1 = start1 - precontext.length;
|
1938 | patch.start2 = start2 - precontext.length;
|
1939 | if (precontext !== '') {
|
1940 | patch.length1 = patch.length2 = precontext.length;
|
1941 | patch.diffs.push([DIFF_EQUAL, precontext]);
|
1942 | }
|
1943 | while (bigpatch.diffs.length !== 0 &&
|
1944 | patch.length1 < patch_size - this.Patch_Margin) {
|
1945 | var diff_type = bigpatch.diffs[0][0];
|
1946 | var diff_text = bigpatch.diffs[0][1];
|
1947 | if (diff_type === DIFF_INSERT) {
|
1948 |
|
1949 | patch.length2 += diff_text.length;
|
1950 | start2 += diff_text.length;
|
1951 | patch.diffs.push(bigpatch.diffs.shift());
|
1952 | empty = false;
|
1953 | } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&
|
1954 | patch.diffs[0][0] == DIFF_EQUAL &&
|
1955 | diff_text.length > 2 * patch_size) {
|
1956 |
|
1957 | patch.length1 += diff_text.length;
|
1958 | start1 += diff_text.length;
|
1959 | empty = false;
|
1960 | patch.diffs.push([diff_type, diff_text]);
|
1961 | bigpatch.diffs.shift();
|
1962 | } else {
|
1963 |
|
1964 | diff_text = diff_text.substring(0,
|
1965 | patch_size - patch.length1 - this.Patch_Margin);
|
1966 | patch.length1 += diff_text.length;
|
1967 | start1 += diff_text.length;
|
1968 | if (diff_type === DIFF_EQUAL) {
|
1969 | patch.length2 += diff_text.length;
|
1970 | start2 += diff_text.length;
|
1971 | } else {
|
1972 | empty = false;
|
1973 | }
|
1974 | patch.diffs.push([diff_type, diff_text]);
|
1975 | if (diff_text == bigpatch.diffs[0][1]) {
|
1976 | bigpatch.diffs.shift();
|
1977 | } else {
|
1978 | bigpatch.diffs[0][1] =
|
1979 | bigpatch.diffs[0][1].substring(diff_text.length);
|
1980 | }
|
1981 | }
|
1982 | }
|
1983 |
|
1984 | precontext = this.diff_text2(patch.diffs);
|
1985 | precontext =
|
1986 | precontext.substring(precontext.length - this.Patch_Margin);
|
1987 |
|
1988 | var postcontext = this.diff_text1(bigpatch.diffs)
|
1989 | .substring(0, this.Patch_Margin);
|
1990 | if (postcontext !== '') {
|
1991 | patch.length1 += postcontext.length;
|
1992 | patch.length2 += postcontext.length;
|
1993 | if (patch.diffs.length !== 0 &&
|
1994 | patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
|
1995 | patch.diffs[patch.diffs.length - 1][1] += postcontext;
|
1996 | } else {
|
1997 | patch.diffs.push([DIFF_EQUAL, postcontext]);
|
1998 | }
|
1999 | }
|
2000 | if (!empty) {
|
2001 | patches.splice(++x, 0, patch);
|
2002 | }
|
2003 | }
|
2004 | }
|
2005 | };
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 | diff_match_patch.prototype.patch_toText = function(patches) {
|
2014 | var text = [];
|
2015 | for (var x = 0; x < patches.length; x++) {
|
2016 | text[x] = patches[x];
|
2017 | }
|
2018 | return text.join('');
|
2019 | };
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 | diff_match_patch.prototype.patch_fromText = function(textline) {
|
2029 | var patches = [];
|
2030 | if (!textline) {
|
2031 | return patches;
|
2032 | }
|
2033 | var text = textline.split('\n');
|
2034 | var textPointer = 0;
|
2035 | var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
|
2036 | while (textPointer < text.length) {
|
2037 | var m = text[textPointer].match(patchHeader);
|
2038 | if (!m) {
|
2039 | throw new Error('Invalid patch string: ' + text[textPointer]);
|
2040 | }
|
2041 | var patch = new diff_match_patch.patch_obj();
|
2042 | patches.push(patch);
|
2043 | patch.start1 = parseInt(m[1], 10);
|
2044 | if (m[2] === '') {
|
2045 | patch.start1--;
|
2046 | patch.length1 = 1;
|
2047 | } else if (m[2] == '0') {
|
2048 | patch.length1 = 0;
|
2049 | } else {
|
2050 | patch.start1--;
|
2051 | patch.length1 = parseInt(m[2], 10);
|
2052 | }
|
2053 |
|
2054 | patch.start2 = parseInt(m[3], 10);
|
2055 | if (m[4] === '') {
|
2056 | patch.start2--;
|
2057 | patch.length2 = 1;
|
2058 | } else if (m[4] == '0') {
|
2059 | patch.length2 = 0;
|
2060 | } else {
|
2061 | patch.start2--;
|
2062 | patch.length2 = parseInt(m[4], 10);
|
2063 | }
|
2064 | textPointer++;
|
2065 |
|
2066 | while (textPointer < text.length) {
|
2067 | var sign = text[textPointer].charAt(0);
|
2068 | try {
|
2069 | var line = decodeURI(text[textPointer].substring(1));
|
2070 | } catch (ex) {
|
2071 |
|
2072 | throw new Error('Illegal escape in patch_fromText: ' + line);
|
2073 | }
|
2074 | if (sign == '-') {
|
2075 |
|
2076 | patch.diffs.push([DIFF_DELETE, line]);
|
2077 | } else if (sign == '+') {
|
2078 |
|
2079 | patch.diffs.push([DIFF_INSERT, line]);
|
2080 | } else if (sign == ' ') {
|
2081 |
|
2082 | patch.diffs.push([DIFF_EQUAL, line]);
|
2083 | } else if (sign == '@') {
|
2084 |
|
2085 | break;
|
2086 | } else if (sign === '') {
|
2087 |
|
2088 | } else {
|
2089 |
|
2090 | throw new Error('Invalid patch mode "' + sign + '" in: ' + line);
|
2091 | }
|
2092 | textPointer++;
|
2093 | }
|
2094 | }
|
2095 | return patches;
|
2096 | };
|
2097 |
|
2098 |
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 | diff_match_patch.patch_obj = function() {
|
2104 |
|
2105 | this.diffs = [];
|
2106 |
|
2107 | this.start1 = null;
|
2108 |
|
2109 | this.start2 = null;
|
2110 |
|
2111 | this.length1 = 0;
|
2112 |
|
2113 | this.length2 = 0;
|
2114 | };
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 | diff_match_patch.patch_obj.prototype.toString = function() {
|
2124 | var coords1, coords2;
|
2125 | if (this.length1 === 0) {
|
2126 | coords1 = this.start1 + ',0';
|
2127 | } else if (this.length1 == 1) {
|
2128 | coords1 = this.start1 + 1;
|
2129 | } else {
|
2130 | coords1 = (this.start1 + 1) + ',' + this.length1;
|
2131 | }
|
2132 | if (this.length2 === 0) {
|
2133 | coords2 = this.start2 + ',0';
|
2134 | } else if (this.length2 == 1) {
|
2135 | coords2 = this.start2 + 1;
|
2136 | } else {
|
2137 | coords2 = (this.start2 + 1) + ',' + this.length2;
|
2138 | }
|
2139 | var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\n'];
|
2140 | var op;
|
2141 |
|
2142 | for (var x = 0; x < this.diffs.length; x++) {
|
2143 | switch (this.diffs[x][0]) {
|
2144 | case DIFF_INSERT:
|
2145 | op = '+';
|
2146 | break;
|
2147 | case DIFF_DELETE:
|
2148 | op = '-';
|
2149 | break;
|
2150 | case DIFF_EQUAL:
|
2151 | op = ' ';
|
2152 | break;
|
2153 | }
|
2154 | text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\n';
|
2155 | }
|
2156 | return text.join('').replace(/%20/g, ' ');
|
2157 | };
|
2158 |
|
2159 |
|
2160 |
|
2161 | module.exports = diff_match_patch;
|
2162 | module.exports['diff_match_patch'] = diff_match_patch;
|
2163 | module.exports['DIFF_DELETE'] = DIFF_DELETE;
|
2164 | module.exports['DIFF_INSERT'] = DIFF_INSERT;
|
2165 | module.exports['DIFF_EQUAL'] = DIFF_EQUAL;
|
2166 | });
|
2167 |
|
2168 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
2169 | return typeof obj;
|
2170 | } : function (obj) {
|
2171 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
2172 | };
|
2173 |
|
2174 | var _typeof$1 = typeof Symbol === "function" && _typeof(Symbol.iterator) === "symbol" ? function (obj) {
|
2175 | return typeof obj === 'undefined' ? 'undefined' : _typeof(obj);
|
2176 | } : function (obj) {
|
2177 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof(obj);
|
2178 | };
|
2179 |
|
2180 | var classCallCheck$1 = function classCallCheck$$1(instance, Constructor) {
|
2181 | if (!(instance instanceof Constructor)) {
|
2182 | throw new TypeError("Cannot call a class as a function");
|
2183 | }
|
2184 | };
|
2185 |
|
2186 | var createClass$1 = function () {
|
2187 | function defineProperties(target, props) {
|
2188 | for (var i = 0; i < props.length; i++) {
|
2189 | var descriptor = props[i];
|
2190 | descriptor.enumerable = descriptor.enumerable || false;
|
2191 | descriptor.configurable = true;
|
2192 | if ("value" in descriptor) descriptor.writable = true;
|
2193 | Object.defineProperty(target, descriptor.key, descriptor);
|
2194 | }
|
2195 | }
|
2196 |
|
2197 | return function (Constructor, protoProps, staticProps) {
|
2198 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
2199 | if (staticProps) defineProperties(Constructor, staticProps);
|
2200 | return Constructor;
|
2201 | };
|
2202 | }();
|
2203 |
|
2204 | var get$1 = function get$$1(object, property, receiver) {
|
2205 | if (object === null) object = Function.prototype;
|
2206 | var desc = Object.getOwnPropertyDescriptor(object, property);
|
2207 |
|
2208 | if (desc === undefined) {
|
2209 | var parent = Object.getPrototypeOf(object);
|
2210 |
|
2211 | if (parent === null) {
|
2212 | return undefined;
|
2213 | } else {
|
2214 | return get$$1(parent, property, receiver);
|
2215 | }
|
2216 | } else if ("value" in desc) {
|
2217 | return desc.value;
|
2218 | } else {
|
2219 | var getter = desc.get;
|
2220 |
|
2221 | if (getter === undefined) {
|
2222 | return undefined;
|
2223 | }
|
2224 |
|
2225 | return getter.call(receiver);
|
2226 | }
|
2227 | };
|
2228 |
|
2229 | var inherits$1 = function inherits$$1(subClass, superClass) {
|
2230 | if (typeof superClass !== "function" && superClass !== null) {
|
2231 | throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
|
2232 | }
|
2233 |
|
2234 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
2235 | constructor: {
|
2236 | value: subClass,
|
2237 | enumerable: false,
|
2238 | writable: true,
|
2239 | configurable: true
|
2240 | }
|
2241 | });
|
2242 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
2243 | };
|
2244 |
|
2245 | var possibleConstructorReturn$1 = function possibleConstructorReturn$$1(self, call) {
|
2246 | if (!self) {
|
2247 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
2248 | }
|
2249 |
|
2250 | return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
|
2251 | };
|
2252 |
|
2253 | var slicedToArray$1 = function () {
|
2254 | function sliceIterator(arr, i) {
|
2255 | var _arr = [];
|
2256 | var _n = true;
|
2257 | var _d = false;
|
2258 | var _e = undefined;
|
2259 |
|
2260 | try {
|
2261 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
2262 | _arr.push(_s.value);
|
2263 |
|
2264 | if (i && _arr.length === i) break;
|
2265 | }
|
2266 | } catch (err) {
|
2267 | _d = true;
|
2268 | _e = err;
|
2269 | } finally {
|
2270 | try {
|
2271 | if (!_n && _i["return"]) _i["return"]();
|
2272 | } finally {
|
2273 | if (_d) throw _e;
|
2274 | }
|
2275 | }
|
2276 |
|
2277 | return _arr;
|
2278 | }
|
2279 |
|
2280 | return function (arr, i) {
|
2281 | if (Array.isArray(arr)) {
|
2282 | return arr;
|
2283 | } else if (Symbol.iterator in Object(arr)) {
|
2284 | return sliceIterator(arr, i);
|
2285 | } else {
|
2286 | throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
2287 | }
|
2288 | };
|
2289 | }();
|
2290 |
|
2291 | var cov_z93lwrnu3 = function () {
|
2292 | var path = '/Users/benja/proj/jsondiffpatch/src/processor.js',
|
2293 | hash = '111c186e30b3622bcb132abb50bff6e1e123593a',
|
2294 | global = new Function('return this')(),
|
2295 | gcv = '__coverage__',
|
2296 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/processor.js', statementMap: { '0': { start: { line: 1, column: 16 }, end: { line: 71, column: 3 } }, '1': { start: { line: 3, column: 4 }, end: { line: 3, column: 49 } }, '2': { start: { line: 5, column: 4 }, end: { line: 5, column: 37 } }, '3': { start: { line: 6, column: 4 }, end: { line: 6, column: 20 } }, '4': { start: { line: 9, column: 2 }, end: { line: 69, column: 6 } }, '5': { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, '6': { start: { line: 13, column: 8 }, end: { line: 13, column: 36 } }, '7': { start: { line: 15, column: 6 }, end: { line: 15, column: 30 } }, '8': { start: { line: 20, column: 17 }, end: { line: 20, column: 24 } }, '9': { start: { line: 21, column: 6 }, end: { line: 27, column: 7 } }, '10': { start: { line: 22, column: 8 }, end: { line: 26, column: 9 } }, '11': { start: { line: 23, column: 10 }, end: { line: 23, column: 34 } }, '12': { start: { line: 25, column: 10 }, end: { line: 25, column: 34 } }, '13': { start: { line: 28, column: 6 }, end: { line: 34, column: 7 } }, '14': { start: { line: 29, column: 8 }, end: { line: 29, column: 20 } }, '15': { start: { line: 30, column: 8 }, end: { line: 32, column: 9 } }, '16': { start: { line: 31, column: 10 }, end: { line: 31, column: 22 } }, '17': { start: { line: 33, column: 8 }, end: { line: 33, column: 37 } }, '18': { start: { line: 35, column: 6 }, end: { line: 35, column: 28 } }, '19': { start: { line: 36, column: 6 }, end: { line: 36, column: 18 } }, '20': { start: { line: 41, column: 20 }, end: { line: 41, column: 25 } }, '21': { start: { line: 42, column: 6 }, end: { line: 42, column: 39 } }, '22': { start: { line: 43, column: 21 }, end: { line: 43, column: 52 } }, '23': { start: { line: 44, column: 21 }, end: { line: 44, column: 27 } }, '24': { start: { line: 45, column: 24 }, end: { line: 45, column: 30 } }, '25': { start: { line: 46, column: 6 }, end: { line: 66, column: 7 } }, '26': { start: { line: 47, column: 8 }, end: { line: 51, column: 9 } }, '27': { start: { line: 49, column: 10 }, end: { line: 49, column: 51 } }, '28': { start: { line: 50, column: 10 }, end: { line: 50, column: 43 } }, '29': { start: { line: 53, column: 8 }, end: { line: 55, column: 9 } }, '30': { start: { line: 54, column: 10 }, end: { line: 54, column: 41 } }, '31': { start: { line: 56, column: 8 }, end: { line: 56, column: 34 } }, '32': { start: { line: 57, column: 8 }, end: { line: 57, column: 30 } }, '33': { start: { line: 58, column: 8 }, end: { line: 58, column: 28 } }, '34': { start: { line: 59, column: 8 }, end: { line: 59, column: 24 } }, '35': { start: { line: 60, column: 8 }, end: { line: 65, column: 9 } }, '36': { start: { line: 61, column: 10 }, end: { line: 64, column: 11 } }, '37': { start: { line: 62, column: 12 }, end: { line: 62, column: 35 } }, '38': { start: { line: 63, column: 12 }, end: { line: 63, column: 72 } }, '39': { start: { line: 67, column: 6 }, end: { line: 67, column: 60 } }, '40': { start: { line: 70, column: 2 }, end: { line: 70, column: 19 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 1, column: 16 }, end: { line: 1, column: 17 } }, loc: { start: { line: 1, column: 28 }, end: { line: 71, column: 1 } }, line: 1 }, '1': { name: 'Processor', decl: { start: { line: 2, column: 11 }, end: { line: 2, column: 20 } }, loc: { start: { line: 2, column: 30 }, end: { line: 7, column: 3 } }, line: 2 }, '2': { name: 'options', decl: { start: { line: 11, column: 20 }, end: { line: 11, column: 27 } }, loc: { start: { line: 11, column: 38 }, end: { line: 16, column: 5 } }, line: 11 }, '3': { name: 'pipe', decl: { start: { line: 19, column: 20 }, end: { line: 19, column: 24 } }, loc: { start: { line: 19, column: 40 }, end: { line: 37, column: 5 } }, line: 19 }, '4': { name: 'process', decl: { start: { line: 40, column: 20 }, end: { line: 40, column: 27 } }, loc: { start: { line: 40, column: 41 }, end: { line: 68, column: 5 } }, line: 40 } }, branchMap: { '0': { loc: { start: { line: 5, column: 23 }, end: { line: 5, column: 36 } }, type: 'binary-expr', locations: [{ start: { line: 5, column: 23 }, end: { line: 5, column: 30 } }, { start: { line: 5, column: 34 }, end: { line: 5, column: 36 } }], line: 5 }, '1': { loc: { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, type: 'if', locations: [{ start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }], line: 12 }, '2': { loc: { start: { line: 21, column: 6 }, end: { line: 27, column: 7 } }, type: 'if', locations: [{ start: { line: 21, column: 6 }, end: { line: 27, column: 7 } }, { start: { line: 21, column: 6 }, end: { line: 27, column: 7 } }], line: 21 }, '3': { loc: { start: { line: 22, column: 8 }, end: { line: 26, column: 9 } }, type: 'if', locations: [{ start: { line: 22, column: 8 }, end: { line: 26, column: 9 } }, { start: { line: 22, column: 8 }, end: { line: 26, column: 9 } }], line: 22 }, '4': { loc: { start: { line: 28, column: 6 }, end: { line: 34, column: 7 } }, type: 'if', locations: [{ start: { line: 28, column: 6 }, end: { line: 34, column: 7 } }, { start: { line: 28, column: 6 }, end: { line: 34, column: 7 } }], line: 28 }, '5': { loc: { start: { line: 28, column: 10 }, end: { line: 28, column: 27 } }, type: 'binary-expr', locations: [{ start: { line: 28, column: 10 }, end: { line: 28, column: 14 } }, { start: { line: 28, column: 18 }, end: { line: 28, column: 27 } }], line: 28 }, '6': { loc: { start: { line: 30, column: 8 }, end: { line: 32, column: 9 } }, type: 'if', locations: [{ start: { line: 30, column: 8 }, end: { line: 32, column: 9 } }, { start: { line: 30, column: 8 }, end: { line: 32, column: 9 } }], line: 30 }, '7': { loc: { start: { line: 43, column: 21 }, end: { line: 43, column: 52 } }, type: 'binary-expr', locations: [{ start: { line: 43, column: 21 }, end: { line: 43, column: 25 } }, { start: { line: 43, column: 29 }, end: { line: 43, column: 39 } }, { start: { line: 43, column: 43 }, end: { line: 43, column: 52 } }], line: 43 }, '8': { loc: { start: { line: 47, column: 8 }, end: { line: 51, column: 9 } }, type: 'if', locations: [{ start: { line: 47, column: 8 }, end: { line: 51, column: 9 } }, { start: { line: 47, column: 8 }, end: { line: 51, column: 9 } }], line: 47 }, '9': { loc: { start: { line: 53, column: 8 }, end: { line: 55, column: 9 } }, type: 'if', locations: [{ start: { line: 53, column: 8 }, end: { line: 55, column: 9 } }, { start: { line: 53, column: 8 }, end: { line: 55, column: 9 } }], line: 53 }, '10': { loc: { start: { line: 60, column: 8 }, end: { line: 65, column: 9 } }, type: 'if', locations: [{ start: { line: 60, column: 8 }, end: { line: 65, column: 9 } }, { start: { line: 60, column: 8 }, end: { line: 65, column: 9 } }], line: 60 }, '11': { loc: { start: { line: 61, column: 10 }, end: { line: 64, column: 11 } }, type: 'if', locations: [{ start: { line: 61, column: 10 }, end: { line: 64, column: 11 } }, { start: { line: 61, column: 10 }, end: { line: 64, column: 11 } }], line: 61 }, '12': { loc: { start: { line: 63, column: 23 }, end: { line: 63, column: 71 } }, type: 'binary-expr', locations: [{ start: { line: 63, column: 23 }, end: { line: 63, column: 43 } }, { start: { line: 63, column: 47 }, end: { line: 63, column: 59 } }, { start: { line: 63, column: 63 }, end: { line: 63, column: 71 } }], line: 63 }, '13': { loc: { start: { line: 67, column: 13 }, end: { line: 67, column: 59 } }, type: 'cond-expr', locations: [{ start: { line: 67, column: 33 }, end: { line: 67, column: 47 } }, { start: { line: 67, column: 50 }, end: { line: 67, column: 59 } }], line: 67 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0, 0], '13': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2297 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2298 | return coverage[path];
|
2299 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2300 | }();var Processor = (cov_z93lwrnu3.s[0]++, function () {
|
2301 | cov_z93lwrnu3.f[0]++;function Processor(options) {
|
2302 | cov_z93lwrnu3.f[1]++;cov_z93lwrnu3.s[1]++;classCallCheck$1(this, Processor);cov_z93lwrnu3.s[2]++;this.selfOptions = (cov_z93lwrnu3.b[0][0]++, options) || (cov_z93lwrnu3.b[0][1]++, {});cov_z93lwrnu3.s[3]++;this.pipes = {};
|
2303 | }cov_z93lwrnu3.s[4]++;createClass$1(Processor, [{ key: 'options', value: function options(_options) {
|
2304 | cov_z93lwrnu3.f[2]++;cov_z93lwrnu3.s[5]++;if (_options) {
|
2305 | cov_z93lwrnu3.b[1][0]++;cov_z93lwrnu3.s[6]++;this.selfOptions = _options;
|
2306 | } else {
|
2307 | cov_z93lwrnu3.b[1][1]++;
|
2308 | }cov_z93lwrnu3.s[7]++;return this.selfOptions;
|
2309 | } }, { key: 'pipe', value: function pipe(name, pipeArg) {
|
2310 | cov_z93lwrnu3.f[3]++;var pipe = (cov_z93lwrnu3.s[8]++, pipeArg);cov_z93lwrnu3.s[9]++;if (typeof name === 'string') {
|
2311 | cov_z93lwrnu3.b[2][0]++;cov_z93lwrnu3.s[10]++;if (typeof pipe === 'undefined') {
|
2312 | cov_z93lwrnu3.b[3][0]++;cov_z93lwrnu3.s[11]++;return this.pipes[name];
|
2313 | } else {
|
2314 | cov_z93lwrnu3.b[3][1]++;cov_z93lwrnu3.s[12]++;this.pipes[name] = pipe;
|
2315 | }
|
2316 | } else {
|
2317 | cov_z93lwrnu3.b[2][1]++;
|
2318 | }cov_z93lwrnu3.s[13]++;if ((cov_z93lwrnu3.b[5][0]++, name) && (cov_z93lwrnu3.b[5][1]++, name.name)) {
|
2319 | cov_z93lwrnu3.b[4][0]++;cov_z93lwrnu3.s[14]++;pipe = name;cov_z93lwrnu3.s[15]++;if (pipe.processor === this) {
|
2320 | cov_z93lwrnu3.b[6][0]++;cov_z93lwrnu3.s[16]++;return pipe;
|
2321 | } else {
|
2322 | cov_z93lwrnu3.b[6][1]++;
|
2323 | }cov_z93lwrnu3.s[17]++;this.pipes[pipe.name] = pipe;
|
2324 | } else {
|
2325 | cov_z93lwrnu3.b[4][1]++;
|
2326 | }cov_z93lwrnu3.s[18]++;pipe.processor = this;cov_z93lwrnu3.s[19]++;return pipe;
|
2327 | } }, { key: 'process', value: function process(input, pipe) {
|
2328 | cov_z93lwrnu3.f[4]++;var context = (cov_z93lwrnu3.s[20]++, input);cov_z93lwrnu3.s[21]++;context.options = this.options();var nextPipe = (cov_z93lwrnu3.s[22]++, (cov_z93lwrnu3.b[7][0]++, pipe) || (cov_z93lwrnu3.b[7][1]++, input.pipe) || (cov_z93lwrnu3.b[7][2]++, 'default'));var lastPipe = (cov_z93lwrnu3.s[23]++, void 0);var lastContext = (cov_z93lwrnu3.s[24]++, void 0);cov_z93lwrnu3.s[25]++;while (nextPipe) {
|
2329 | cov_z93lwrnu3.s[26]++;if (typeof context.nextAfterChildren !== 'undefined') {
|
2330 | cov_z93lwrnu3.b[8][0]++;cov_z93lwrnu3.s[27]++;
|
2331 | context.next = context.nextAfterChildren;cov_z93lwrnu3.s[28]++;context.nextAfterChildren = null;
|
2332 | } else {
|
2333 | cov_z93lwrnu3.b[8][1]++;
|
2334 | }cov_z93lwrnu3.s[29]++;if (typeof nextPipe === 'string') {
|
2335 | cov_z93lwrnu3.b[9][0]++;cov_z93lwrnu3.s[30]++;nextPipe = this.pipe(nextPipe);
|
2336 | } else {
|
2337 | cov_z93lwrnu3.b[9][1]++;
|
2338 | }cov_z93lwrnu3.s[31]++;nextPipe.process(context);cov_z93lwrnu3.s[32]++;lastContext = context;cov_z93lwrnu3.s[33]++;lastPipe = nextPipe;cov_z93lwrnu3.s[34]++;nextPipe = null;cov_z93lwrnu3.s[35]++;if (context) {
|
2339 | cov_z93lwrnu3.b[10][0]++;cov_z93lwrnu3.s[36]++;if (context.next) {
|
2340 | cov_z93lwrnu3.b[11][0]++;cov_z93lwrnu3.s[37]++;context = context.next;cov_z93lwrnu3.s[38]++;nextPipe = (cov_z93lwrnu3.b[12][0]++, lastContext.nextPipe) || (cov_z93lwrnu3.b[12][1]++, context.pipe) || (cov_z93lwrnu3.b[12][2]++, lastPipe);
|
2341 | } else {
|
2342 | cov_z93lwrnu3.b[11][1]++;
|
2343 | }
|
2344 | } else {
|
2345 | cov_z93lwrnu3.b[10][1]++;
|
2346 | }
|
2347 | }cov_z93lwrnu3.s[39]++;return context.hasResult ? (cov_z93lwrnu3.b[13][0]++, context.result) : (cov_z93lwrnu3.b[13][1]++, undefined);
|
2348 | } }]);cov_z93lwrnu3.s[40]++;return Processor;
|
2349 | }());
|
2350 |
|
2351 | var cov_mwia6hc6s = function () {
|
2352 | var path = '/Users/benja/proj/jsondiffpatch/src/pipe.js',
|
2353 | hash = '74d5af74abfffcb914d9f6d33955ea80539f7771',
|
2354 | global = new Function('return this')(),
|
2355 | gcv = '__coverage__',
|
2356 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/pipe.js', statementMap: { '0': { start: { line: 1, column: 11 }, end: { line: 172, column: 3 } }, '1': { start: { line: 3, column: 4 }, end: { line: 3, column: 44 } }, '2': { start: { line: 5, column: 4 }, end: { line: 5, column: 21 } }, '3': { start: { line: 6, column: 4 }, end: { line: 6, column: 22 } }, '4': { start: { line: 9, column: 2 }, end: { line: 170, column: 6 } }, '5': { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, '6': { start: { line: 13, column: 8 }, end: { line: 13, column: 72 } }, '7': { start: { line: 15, column: 18 }, end: { line: 15, column: 28 } }, '8': { start: { line: 16, column: 19 }, end: { line: 16, column: 38 } }, '9': { start: { line: 17, column: 20 }, end: { line: 17, column: 25 } }, '10': { start: { line: 18, column: 6 }, end: { line: 28, column: 7 } }, '11': { start: { line: 19, column: 21 }, end: { line: 19, column: 40 } }, '12': { start: { line: 20, column: 8 }, end: { line: 22, column: 9 } }, '13': { start: { line: 21, column: 10 }, end: { line: 21, column: 51 } }, '14': { start: { line: 23, column: 8 }, end: { line: 23, column: 24 } }, '15': { start: { line: 24, column: 8 }, end: { line: 27, column: 9 } }, '16': { start: { line: 25, column: 10 }, end: { line: 25, column: 34 } }, '17': { start: { line: 26, column: 10 }, end: { line: 26, column: 16 } }, '18': { start: { line: 29, column: 6 }, end: { line: 31, column: 7 } }, '19': { start: { line: 30, column: 8 }, end: { line: 30, column: 34 } }, '20': { start: { line: 36, column: 6 }, end: { line: 36, column: 68 } }, '21': { start: { line: 43, column: 6 }, end: { line: 43, column: 64 } }, '22': { start: { line: 44, column: 6 }, end: { line: 44, column: 18 } }, '23': { start: { line: 51, column: 6 }, end: { line: 51, column: 69 } }, '24': { start: { line: 52, column: 6 }, end: { line: 52, column: 18 } }, '25': { start: { line: 57, column: 6 }, end: { line: 59, column: 7 } }, '26': { start: { line: 58, column: 8 }, end: { line: 58, column: 53 } }, '27': { start: { line: 60, column: 6 }, end: { line: 65, column: 7 } }, '28': { start: { line: 61, column: 21 }, end: { line: 61, column: 40 } }, '29': { start: { line: 62, column: 8 }, end: { line: 64, column: 9 } }, '30': { start: { line: 63, column: 10 }, end: { line: 63, column: 23 } }, '31': { start: { line: 66, column: 6 }, end: { line: 66, column: 57 } }, '32': { start: { line: 71, column: 18 }, end: { line: 71, column: 20 } }, '33': { start: { line: 73, column: 38 }, end: { line: 73, column: 42 } }, '34': { start: { line: 74, column: 30 }, end: { line: 74, column: 35 } }, '35': { start: { line: 75, column: 27 }, end: { line: 75, column: 36 } }, '36': { start: { line: 77, column: 6 }, end: { line: 96, column: 7 } }, '37': { start: { line: 78, column: 8 }, end: { line: 82, column: 9 } }, '38': { start: { line: 79, column: 23 }, end: { line: 79, column: 34 } }, '39': { start: { line: 81, column: 10 }, end: { line: 81, column: 40 } }, '40': { start: { line: 84, column: 8 }, end: { line: 84, column: 33 } }, '41': { start: { line: 85, column: 8 }, end: { line: 85, column: 29 } }, '42': { start: { line: 87, column: 8 }, end: { line: 95, column: 9 } }, '43': { start: { line: 88, column: 10 }, end: { line: 90, column: 11 } }, '44': { start: { line: 89, column: 12 }, end: { line: 89, column: 31 } }, '45': { start: { line: 92, column: 10 }, end: { line: 94, column: 11 } }, '46': { start: { line: 93, column: 12 }, end: { line: 93, column: 33 } }, '47': { start: { line: 98, column: 6 }, end: { line: 98, column: 19 } }, '48': { start: { line: 103, column: 18 }, end: { line: 103, column: 42 } }, '49': { start: { line: 104, column: 19 }, end: { line: 104, column: 59 } }, '50': { start: { line: 105, column: 6 }, end: { line: 107, column: 7 } }, '51': { start: { line: 106, column: 8 }, end: { line: 106, column: 48 } }, '52': { start: { line: 108, column: 6 }, end: { line: 108, column: 35 } }, '53': { start: { line: 109, column: 6 }, end: { line: 109, column: 57 } }, '54': { start: { line: 110, column: 6 }, end: { line: 110, column: 18 } }, '55': { start: { line: 115, column: 18 }, end: { line: 115, column: 42 } }, '56': { start: { line: 116, column: 19 }, end: { line: 116, column: 59 } }, '57': { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, '58': { start: { line: 118, column: 8 }, end: { line: 118, column: 48 } }, '59': { start: { line: 120, column: 6 }, end: { line: 120, column: 31 } }, '60': { start: { line: 121, column: 6 }, end: { line: 121, column: 57 } }, '61': { start: { line: 122, column: 6 }, end: { line: 122, column: 18 } }, '62': { start: { line: 127, column: 18 }, end: { line: 127, column: 42 } }, '63': { start: { line: 128, column: 19 }, end: { line: 128, column: 59 } }, '64': { start: { line: 129, column: 6 }, end: { line: 131, column: 7 } }, '65': { start: { line: 130, column: 8 }, end: { line: 130, column: 48 } }, '66': { start: { line: 132, column: 6 }, end: { line: 132, column: 31 } }, '67': { start: { line: 133, column: 6 }, end: { line: 133, column: 57 } }, '68': { start: { line: 134, column: 6 }, end: { line: 134, column: 18 } }, '69': { start: { line: 139, column: 18 }, end: { line: 139, column: 42 } }, '70': { start: { line: 140, column: 6 }, end: { line: 140, column: 36 } }, '71': { start: { line: 141, column: 6 }, end: { line: 141, column: 18 } }, '72': { start: { line: 146, column: 6 }, end: { line: 146, column: 30 } }, '73': { start: { line: 147, column: 6 }, end: { line: 147, column: 18 } }, '74': { start: { line: 152, column: 6 }, end: { line: 155, column: 7 } }, '75': { start: { line: 153, column: 8 }, end: { line: 153, column: 32 } }, '76': { start: { line: 154, column: 8 }, end: { line: 154, column: 15 } }, '77': { start: { line: 156, column: 6 }, end: { line: 158, column: 7 } }, '78': { start: { line: 157, column: 8 }, end: { line: 157, column: 15 } }, '79': { start: { line: 159, column: 17 }, end: { line: 159, column: 21 } }, '80': { start: { line: 160, column: 6 }, end: { line: 167, column: 8 } }, '81': { start: { line: 161, column: 8 }, end: { line: 166, column: 9 } }, '82': { start: { line: 162, column: 10 }, end: { line: 162, column: 31 } }, '83': { start: { line: 163, column: 22 }, end: { line: 163, column: 54 } }, '84': { start: { line: 164, column: 10 }, end: { line: 164, column: 32 } }, '85': { start: { line: 165, column: 10 }, end: { line: 165, column: 22 } }, '86': { start: { line: 168, column: 6 }, end: { line: 168, column: 18 } }, '87': { start: { line: 171, column: 2 }, end: { line: 171, column: 14 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 1, column: 11 }, end: { line: 1, column: 12 } }, loc: { start: { line: 1, column: 23 }, end: { line: 172, column: 1 } }, line: 1 }, '1': { name: 'Pipe', decl: { start: { line: 2, column: 11 }, end: { line: 2, column: 15 } }, loc: { start: { line: 2, column: 22 }, end: { line: 7, column: 3 } }, line: 2 }, '2': { name: 'process', decl: { start: { line: 11, column: 20 }, end: { line: 11, column: 27 } }, loc: { start: { line: 11, column: 35 }, end: { line: 32, column: 5 } }, line: 11 }, '3': { name: 'log', decl: { start: { line: 35, column: 20 }, end: { line: 35, column: 23 } }, loc: { start: { line: 35, column: 29 }, end: { line: 37, column: 5 } }, line: 35 }, '4': { name: 'append', decl: { start: { line: 40, column: 20 }, end: { line: 40, column: 26 } }, loc: { start: { line: 40, column: 29 }, end: { line: 45, column: 5 } }, line: 40 }, '5': { name: 'prepend', decl: { start: { line: 48, column: 20 }, end: { line: 48, column: 27 } }, loc: { start: { line: 48, column: 30 }, end: { line: 53, column: 5 } }, line: 48 }, '6': { name: 'indexOf', decl: { start: { line: 56, column: 20 }, end: { line: 56, column: 27 } }, loc: { start: { line: 56, column: 40 }, end: { line: 67, column: 5 } }, line: 56 }, '7': { name: 'list', decl: { start: { line: 70, column: 20 }, end: { line: 70, column: 24 } }, loc: { start: { line: 70, column: 27 }, end: { line: 99, column: 5 } }, line: 70 }, '8': { name: 'after', decl: { start: { line: 102, column: 20 }, end: { line: 102, column: 25 } }, loc: { start: { line: 102, column: 38 }, end: { line: 111, column: 5 } }, line: 102 }, '9': { name: 'before', decl: { start: { line: 114, column: 20 }, end: { line: 114, column: 26 } }, loc: { start: { line: 114, column: 39 }, end: { line: 123, column: 5 } }, line: 114 }, '10': { name: 'replace', decl: { start: { line: 126, column: 20 }, end: { line: 126, column: 27 } }, loc: { start: { line: 126, column: 40 }, end: { line: 135, column: 5 } }, line: 126 }, '11': { name: 'remove', decl: { start: { line: 138, column: 20 }, end: { line: 138, column: 26 } }, loc: { start: { line: 138, column: 39 }, end: { line: 142, column: 5 } }, line: 138 }, '12': { name: 'clear', decl: { start: { line: 145, column: 20 }, end: { line: 145, column: 25 } }, loc: { start: { line: 145, column: 28 }, end: { line: 148, column: 5 } }, line: 145 }, '13': { name: 'shouldHaveResult', decl: { start: { line: 151, column: 20 }, end: { line: 151, column: 36 } }, loc: { start: { line: 151, column: 45 }, end: { line: 169, column: 5 } }, line: 151 }, '14': { name: '(anonymous_14)', decl: { start: { line: 160, column: 25 }, end: { line: 160, column: 26 } }, loc: { start: { line: 160, column: 44 }, end: { line: 167, column: 7 } }, line: 160 } }, branchMap: { '0': { loc: { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, type: 'if', locations: [{ start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }, { start: { line: 12, column: 6 }, end: { line: 14, column: 7 } }], line: 12 }, '1': { loc: { start: { line: 20, column: 8 }, end: { line: 22, column: 9 } }, type: 'if', locations: [{ start: { line: 20, column: 8 }, end: { line: 22, column: 9 } }, { start: { line: 20, column: 8 }, end: { line: 22, column: 9 } }], line: 20 }, '2': { loc: { start: { line: 24, column: 8 }, end: { line: 27, column: 9 } }, type: 'if', locations: [{ start: { line: 24, column: 8 }, end: { line: 27, column: 9 } }, { start: { line: 24, column: 8 }, end: { line: 27, column: 9 } }], line: 24 }, '3': { loc: { start: { line: 24, column: 12 }, end: { line: 24, column: 121 } }, type: 'binary-expr', locations: [{ start: { line: 24, column: 12 }, end: { line: 24, column: 102 } }, { start: { line: 24, column: 106 }, end: { line: 24, column: 121 } }], line: 24 }, '4': { loc: { start: { line: 24, column: 13 }, end: { line: 24, column: 88 } }, type: 'cond-expr', locations: [{ start: { line: 24, column: 46 }, end: { line: 24, column: 57 } }, { start: { line: 24, column: 60 }, end: { line: 24, column: 88 } }], line: 24 }, '5': { loc: { start: { line: 29, column: 6 }, end: { line: 31, column: 7 } }, type: 'if', locations: [{ start: { line: 29, column: 6 }, end: { line: 31, column: 7 } }, { start: { line: 29, column: 6 }, end: { line: 31, column: 7 } }], line: 29 }, '6': { loc: { start: { line: 29, column: 10 }, end: { line: 29, column: 43 } }, type: 'binary-expr', locations: [{ start: { line: 29, column: 10 }, end: { line: 29, column: 23 } }, { start: { line: 29, column: 27 }, end: { line: 29, column: 43 } }], line: 29 }, '7': { loc: { start: { line: 57, column: 6 }, end: { line: 59, column: 7 } }, type: 'if', locations: [{ start: { line: 57, column: 6 }, end: { line: 59, column: 7 } }, { start: { line: 57, column: 6 }, end: { line: 59, column: 7 } }], line: 57 }, '8': { loc: { start: { line: 62, column: 8 }, end: { line: 64, column: 9 } }, type: 'if', locations: [{ start: { line: 62, column: 8 }, end: { line: 64, column: 9 } }, { start: { line: 62, column: 8 }, end: { line: 64, column: 9 } }], line: 62 }, '9': { loc: { start: { line: 88, column: 10 }, end: { line: 90, column: 11 } }, type: 'if', locations: [{ start: { line: 88, column: 10 }, end: { line: 90, column: 11 } }, { start: { line: 88, column: 10 }, end: { line: 90, column: 11 } }], line: 88 }, '10': { loc: { start: { line: 88, column: 14 }, end: { line: 88, column: 60 } }, type: 'binary-expr', locations: [{ start: { line: 88, column: 14 }, end: { line: 88, column: 40 } }, { start: { line: 88, column: 44 }, end: { line: 88, column: 60 } }], line: 88 }, '11': { loc: { start: { line: 92, column: 10 }, end: { line: 94, column: 11 } }, type: 'if', locations: [{ start: { line: 92, column: 10 }, end: { line: 94, column: 11 } }, { start: { line: 92, column: 10 }, end: { line: 94, column: 11 } }], line: 92 }, '12': { loc: { start: { line: 105, column: 6 }, end: { line: 107, column: 7 } }, type: 'if', locations: [{ start: { line: 105, column: 6 }, end: { line: 107, column: 7 } }, { start: { line: 105, column: 6 }, end: { line: 107, column: 7 } }], line: 105 }, '13': { loc: { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, type: 'if', locations: [{ start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }], line: 117 }, '14': { loc: { start: { line: 129, column: 6 }, end: { line: 131, column: 7 } }, type: 'if', locations: [{ start: { line: 129, column: 6 }, end: { line: 131, column: 7 } }, { start: { line: 129, column: 6 }, end: { line: 131, column: 7 } }], line: 129 }, '15': { loc: { start: { line: 152, column: 6 }, end: { line: 155, column: 7 } }, type: 'if', locations: [{ start: { line: 152, column: 6 }, end: { line: 155, column: 7 } }, { start: { line: 152, column: 6 }, end: { line: 155, column: 7 } }], line: 152 }, '16': { loc: { start: { line: 156, column: 6 }, end: { line: 158, column: 7 } }, type: 'if', locations: [{ start: { line: 156, column: 6 }, end: { line: 158, column: 7 } }, { start: { line: 156, column: 6 }, end: { line: 158, column: 7 } }], line: 156 }, '17': { loc: { start: { line: 161, column: 8 }, end: { line: 166, column: 9 } }, type: 'if', locations: [{ start: { line: 161, column: 8 }, end: { line: 166, column: 9 } }, { start: { line: 161, column: 8 }, end: { line: 166, column: 9 } }], line: 161 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2357 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2358 | return coverage[path];
|
2359 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2360 | }();var Pipe = (cov_mwia6hc6s.s[0]++, function () {
|
2361 | cov_mwia6hc6s.f[0]++;function Pipe(name) {
|
2362 | cov_mwia6hc6s.f[1]++;cov_mwia6hc6s.s[1]++;classCallCheck$1(this, Pipe);cov_mwia6hc6s.s[2]++;this.name = name;cov_mwia6hc6s.s[3]++;this.filters = [];
|
2363 | }cov_mwia6hc6s.s[4]++;createClass$1(Pipe, [{ key: 'process', value: function process(input) {
|
2364 | cov_mwia6hc6s.f[2]++;cov_mwia6hc6s.s[5]++;if (!this.processor) {
|
2365 | cov_mwia6hc6s.b[0][0]++;cov_mwia6hc6s.s[6]++;throw new Error('add this pipe to a processor before using it');
|
2366 | } else {
|
2367 | cov_mwia6hc6s.b[0][1]++;
|
2368 | }var debug = (cov_mwia6hc6s.s[7]++, this.debug);var length = (cov_mwia6hc6s.s[8]++, this.filters.length);var context = (cov_mwia6hc6s.s[9]++, input);cov_mwia6hc6s.s[10]++;for (var index = 0; index < length; index++) {
|
2369 | var filter = (cov_mwia6hc6s.s[11]++, this.filters[index]);cov_mwia6hc6s.s[12]++;if (debug) {
|
2370 | cov_mwia6hc6s.b[1][0]++;cov_mwia6hc6s.s[13]++;this.log('filter: ' + filter.filterName);
|
2371 | } else {
|
2372 | cov_mwia6hc6s.b[1][1]++;
|
2373 | }cov_mwia6hc6s.s[14]++;filter(context);cov_mwia6hc6s.s[15]++;if ((cov_mwia6hc6s.b[3][0]++, (typeof context === 'undefined' ? (cov_mwia6hc6s.b[4][0]++, 'undefined') : (cov_mwia6hc6s.b[4][1]++, _typeof$1(context))) === 'object') && (cov_mwia6hc6s.b[3][1]++, context.exiting)) {
|
2374 | cov_mwia6hc6s.b[2][0]++;cov_mwia6hc6s.s[16]++;context.exiting = false;cov_mwia6hc6s.s[17]++;break;
|
2375 | } else {
|
2376 | cov_mwia6hc6s.b[2][1]++;
|
2377 | }
|
2378 | }cov_mwia6hc6s.s[18]++;if ((cov_mwia6hc6s.b[6][0]++, !context.next) && (cov_mwia6hc6s.b[6][1]++, this.resultCheck)) {
|
2379 | cov_mwia6hc6s.b[5][0]++;cov_mwia6hc6s.s[19]++;this.resultCheck(context);
|
2380 | } else {
|
2381 | cov_mwia6hc6s.b[5][1]++;
|
2382 | }
|
2383 | } }, { key: 'log', value: function log(msg) {
|
2384 | cov_mwia6hc6s.f[3]++;cov_mwia6hc6s.s[20]++;console.log('[jsondiffpatch] ' + this.name + ' pipe, ' + msg);
|
2385 | } }, { key: 'append', value: function append() {
|
2386 | cov_mwia6hc6s.f[4]++;var _filters;cov_mwia6hc6s.s[21]++;(_filters = this.filters).push.apply(_filters, arguments);cov_mwia6hc6s.s[22]++;return this;
|
2387 | } }, { key: 'prepend', value: function prepend() {
|
2388 | cov_mwia6hc6s.f[5]++;var _filters2;cov_mwia6hc6s.s[23]++;(_filters2 = this.filters).unshift.apply(_filters2, arguments);cov_mwia6hc6s.s[24]++;return this;
|
2389 | } }, { key: 'indexOf', value: function indexOf(filterName) {
|
2390 | cov_mwia6hc6s.f[6]++;cov_mwia6hc6s.s[25]++;if (!filterName) {
|
2391 | cov_mwia6hc6s.b[7][0]++;cov_mwia6hc6s.s[26]++;throw new Error('a filter name is required');
|
2392 | } else {
|
2393 | cov_mwia6hc6s.b[7][1]++;
|
2394 | }cov_mwia6hc6s.s[27]++;for (var index = 0; index < this.filters.length; index++) {
|
2395 | var filter = (cov_mwia6hc6s.s[28]++, this.filters[index]);cov_mwia6hc6s.s[29]++;if (filter.filterName === filterName) {
|
2396 | cov_mwia6hc6s.b[8][0]++;cov_mwia6hc6s.s[30]++;return index;
|
2397 | } else {
|
2398 | cov_mwia6hc6s.b[8][1]++;
|
2399 | }
|
2400 | }cov_mwia6hc6s.s[31]++;throw new Error('filter not found: ' + filterName);
|
2401 | } }, { key: 'list', value: function list() {
|
2402 | cov_mwia6hc6s.f[7]++;var names = (cov_mwia6hc6s.s[32]++, []);var _iteratorNormalCompletion = (cov_mwia6hc6s.s[33]++, true);var _didIteratorError = (cov_mwia6hc6s.s[34]++, false);var _iteratorError = (cov_mwia6hc6s.s[35]++, undefined);cov_mwia6hc6s.s[36]++;try {
|
2403 | cov_mwia6hc6s.s[37]++;for (var _iterator = this.filters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
2404 | var filter = (cov_mwia6hc6s.s[38]++, _step.value);cov_mwia6hc6s.s[39]++;names.push(filter.filterName);
|
2405 | }
|
2406 | } catch (err) {
|
2407 | cov_mwia6hc6s.s[40]++;_didIteratorError = true;cov_mwia6hc6s.s[41]++;_iteratorError = err;
|
2408 | } finally {
|
2409 | cov_mwia6hc6s.s[42]++;try {
|
2410 | cov_mwia6hc6s.s[43]++;if ((cov_mwia6hc6s.b[10][0]++, !_iteratorNormalCompletion) && (cov_mwia6hc6s.b[10][1]++, _iterator.return)) {
|
2411 | cov_mwia6hc6s.b[9][0]++;cov_mwia6hc6s.s[44]++;_iterator.return();
|
2412 | } else {
|
2413 | cov_mwia6hc6s.b[9][1]++;
|
2414 | }
|
2415 | } finally {
|
2416 | cov_mwia6hc6s.s[45]++;if (_didIteratorError) {
|
2417 | cov_mwia6hc6s.b[11][0]++;cov_mwia6hc6s.s[46]++;throw _iteratorError;
|
2418 | } else {
|
2419 | cov_mwia6hc6s.b[11][1]++;
|
2420 | }
|
2421 | }
|
2422 | }cov_mwia6hc6s.s[47]++;return names;
|
2423 | } }, { key: 'after', value: function after(filterName) {
|
2424 | cov_mwia6hc6s.f[8]++;var index = (cov_mwia6hc6s.s[48]++, this.indexOf(filterName));var params = (cov_mwia6hc6s.s[49]++, Array.prototype.slice.call(arguments, 1));cov_mwia6hc6s.s[50]++;if (!params.length) {
|
2425 | cov_mwia6hc6s.b[12][0]++;cov_mwia6hc6s.s[51]++;throw new Error('a filter is required');
|
2426 | } else {
|
2427 | cov_mwia6hc6s.b[12][1]++;
|
2428 | }cov_mwia6hc6s.s[52]++;params.unshift(index + 1, 0);cov_mwia6hc6s.s[53]++;Array.prototype.splice.apply(this.filters, params);cov_mwia6hc6s.s[54]++;return this;
|
2429 | } }, { key: 'before', value: function before(filterName) {
|
2430 | cov_mwia6hc6s.f[9]++;var index = (cov_mwia6hc6s.s[55]++, this.indexOf(filterName));var params = (cov_mwia6hc6s.s[56]++, Array.prototype.slice.call(arguments, 1));cov_mwia6hc6s.s[57]++;if (!params.length) {
|
2431 | cov_mwia6hc6s.b[13][0]++;cov_mwia6hc6s.s[58]++;throw new Error('a filter is required');
|
2432 | } else {
|
2433 | cov_mwia6hc6s.b[13][1]++;
|
2434 | }cov_mwia6hc6s.s[59]++;params.unshift(index, 0);cov_mwia6hc6s.s[60]++;Array.prototype.splice.apply(this.filters, params);cov_mwia6hc6s.s[61]++;return this;
|
2435 | } }, { key: 'replace', value: function replace(filterName) {
|
2436 | cov_mwia6hc6s.f[10]++;var index = (cov_mwia6hc6s.s[62]++, this.indexOf(filterName));var params = (cov_mwia6hc6s.s[63]++, Array.prototype.slice.call(arguments, 1));cov_mwia6hc6s.s[64]++;if (!params.length) {
|
2437 | cov_mwia6hc6s.b[14][0]++;cov_mwia6hc6s.s[65]++;throw new Error('a filter is required');
|
2438 | } else {
|
2439 | cov_mwia6hc6s.b[14][1]++;
|
2440 | }cov_mwia6hc6s.s[66]++;params.unshift(index, 1);cov_mwia6hc6s.s[67]++;Array.prototype.splice.apply(this.filters, params);cov_mwia6hc6s.s[68]++;return this;
|
2441 | } }, { key: 'remove', value: function remove(filterName) {
|
2442 | cov_mwia6hc6s.f[11]++;var index = (cov_mwia6hc6s.s[69]++, this.indexOf(filterName));cov_mwia6hc6s.s[70]++;this.filters.splice(index, 1);cov_mwia6hc6s.s[71]++;return this;
|
2443 | } }, { key: 'clear', value: function clear() {
|
2444 | cov_mwia6hc6s.f[12]++;cov_mwia6hc6s.s[72]++;this.filters.length = 0;cov_mwia6hc6s.s[73]++;return this;
|
2445 | } }, { key: 'shouldHaveResult', value: function shouldHaveResult(should) {
|
2446 | cov_mwia6hc6s.f[13]++;cov_mwia6hc6s.s[74]++;if (should === false) {
|
2447 | cov_mwia6hc6s.b[15][0]++;cov_mwia6hc6s.s[75]++;this.resultCheck = null;cov_mwia6hc6s.s[76]++;return;
|
2448 | } else {
|
2449 | cov_mwia6hc6s.b[15][1]++;
|
2450 | }cov_mwia6hc6s.s[77]++;if (this.resultCheck) {
|
2451 | cov_mwia6hc6s.b[16][0]++;cov_mwia6hc6s.s[78]++;return;
|
2452 | } else {
|
2453 | cov_mwia6hc6s.b[16][1]++;
|
2454 | }var pipe = (cov_mwia6hc6s.s[79]++, this);cov_mwia6hc6s.s[80]++;this.resultCheck = function (context) {
|
2455 | cov_mwia6hc6s.f[14]++;cov_mwia6hc6s.s[81]++;if (!context.hasResult) {
|
2456 | cov_mwia6hc6s.b[17][0]++;cov_mwia6hc6s.s[82]++;console.log(context);var error = (cov_mwia6hc6s.s[83]++, new Error(pipe.name + ' failed'));cov_mwia6hc6s.s[84]++;error.noResult = true;cov_mwia6hc6s.s[85]++;throw error;
|
2457 | } else {
|
2458 | cov_mwia6hc6s.b[17][1]++;
|
2459 | }
|
2460 | };cov_mwia6hc6s.s[86]++;return this;
|
2461 | } }]);cov_mwia6hc6s.s[87]++;return Pipe;
|
2462 | }());
|
2463 |
|
2464 | var cov_15dz7p942d = function () {
|
2465 | var path = '/Users/benja/proj/jsondiffpatch/src/contexts/context.js',
|
2466 | hash = 'd8af74e6f94b0d75ab256641f76a0c75f3293d60',
|
2467 | global = new Function('return this')(),
|
2468 | gcv = '__coverage__',
|
2469 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/contexts/context.js', statementMap: { '0': { start: { line: 3, column: 14 }, end: { line: 56, column: 3 } }, '1': { start: { line: 5, column: 4 }, end: { line: 5, column: 47 } }, '2': { start: { line: 8, column: 2 }, end: { line: 54, column: 6 } }, '3': { start: { line: 11, column: 6 }, end: { line: 11, column: 27 } }, '4': { start: { line: 12, column: 6 }, end: { line: 12, column: 28 } }, '5': { start: { line: 13, column: 6 }, end: { line: 13, column: 18 } }, '6': { start: { line: 18, column: 6 }, end: { line: 18, column: 26 } }, '7': { start: { line: 19, column: 6 }, end: { line: 19, column: 18 } }, '8': { start: { line: 24, column: 6 }, end: { line: 31, column: 7 } }, '9': { start: { line: 25, column: 8 }, end: { line: 25, column: 29 } }, '10': { start: { line: 27, column: 8 }, end: { line: 27, column: 25 } }, '11': { start: { line: 28, column: 8 }, end: { line: 30, column: 9 } }, '12': { start: { line: 29, column: 10 }, end: { line: 29, column: 31 } }, '13': { start: { line: 32, column: 6 }, end: { line: 32, column: 18 } }, '14': { start: { line: 37, column: 6 }, end: { line: 37, column: 26 } }, '15': { start: { line: 38, column: 6 }, end: { line: 40, column: 7 } }, '16': { start: { line: 39, column: 8 }, end: { line: 39, column: 31 } }, '17': { start: { line: 41, column: 6 }, end: { line: 41, column: 37 } }, '18': { start: { line: 42, column: 6 }, end: { line: 42, column: 52 } }, '19': { start: { line: 43, column: 6 }, end: { line: 50, column: 7 } }, '20': { start: { line: 44, column: 8 }, end: { line: 44, column: 32 } }, '21': { start: { line: 45, column: 8 }, end: { line: 45, column: 51 } }, '22': { start: { line: 46, column: 8 }, end: { line: 46, column: 26 } }, '23': { start: { line: 48, column: 8 }, end: { line: 48, column: 61 } }, '24': { start: { line: 49, column: 8 }, end: { line: 49, column: 34 } }, '25': { start: { line: 51, column: 6 }, end: { line: 51, column: 24 } }, '26': { start: { line: 52, column: 6 }, end: { line: 52, column: 18 } }, '27': { start: { line: 55, column: 2 }, end: { line: 55, column: 17 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 3, column: 14 }, end: { line: 3, column: 15 } }, loc: { start: { line: 3, column: 26 }, end: { line: 56, column: 1 } }, line: 3 }, '1': { name: 'Context', decl: { start: { line: 4, column: 11 }, end: { line: 4, column: 18 } }, loc: { start: { line: 4, column: 21 }, end: { line: 6, column: 3 } }, line: 4 }, '2': { name: 'setResult', decl: { start: { line: 10, column: 20 }, end: { line: 10, column: 29 } }, loc: { start: { line: 10, column: 38 }, end: { line: 14, column: 5 } }, line: 10 }, '3': { name: 'exit', decl: { start: { line: 17, column: 20 }, end: { line: 17, column: 24 } }, loc: { start: { line: 17, column: 27 }, end: { line: 20, column: 5 } }, line: 17 }, '4': { name: 'switchTo', decl: { start: { line: 23, column: 20 }, end: { line: 23, column: 28 } }, loc: { start: { line: 23, column: 41 }, end: { line: 33, column: 5 } }, line: 23 }, '5': { name: 'push', decl: { start: { line: 36, column: 20 }, end: { line: 36, column: 24 } }, loc: { start: { line: 36, column: 38 }, end: { line: 53, column: 5 } }, line: 36 } }, branchMap: { '0': { loc: { start: { line: 24, column: 6 }, end: { line: 31, column: 7 } }, type: 'if', locations: [{ start: { line: 24, column: 6 }, end: { line: 31, column: 7 } }, { start: { line: 24, column: 6 }, end: { line: 31, column: 7 } }], line: 24 }, '1': { loc: { start: { line: 24, column: 10 }, end: { line: 24, column: 58 } }, type: 'binary-expr', locations: [{ start: { line: 24, column: 10 }, end: { line: 24, column: 34 } }, { start: { line: 24, column: 38 }, end: { line: 24, column: 58 } }], line: 24 }, '2': { loc: { start: { line: 28, column: 8 }, end: { line: 30, column: 9 } }, type: 'if', locations: [{ start: { line: 28, column: 8 }, end: { line: 30, column: 9 } }, { start: { line: 28, column: 8 }, end: { line: 30, column: 9 } }], line: 28 }, '3': { loc: { start: { line: 38, column: 6 }, end: { line: 40, column: 7 } }, type: 'if', locations: [{ start: { line: 38, column: 6 }, end: { line: 40, column: 7 } }, { start: { line: 38, column: 6 }, end: { line: 40, column: 7 } }], line: 38 }, '4': { loc: { start: { line: 41, column: 19 }, end: { line: 41, column: 36 } }, type: 'binary-expr', locations: [{ start: { line: 41, column: 19 }, end: { line: 41, column: 28 } }, { start: { line: 41, column: 32 }, end: { line: 41, column: 36 } }], line: 41 }, '5': { loc: { start: { line: 42, column: 22 }, end: { line: 42, column: 51 } }, type: 'binary-expr', locations: [{ start: { line: 42, column: 22 }, end: { line: 42, column: 35 } }, { start: { line: 42, column: 39 }, end: { line: 42, column: 51 } }], line: 42 }, '6': { loc: { start: { line: 43, column: 6 }, end: { line: 50, column: 7 } }, type: 'if', locations: [{ start: { line: 43, column: 6 }, end: { line: 50, column: 7 } }, { start: { line: 43, column: 6 }, end: { line: 50, column: 7 } }], line: 43 }, '7': { loc: { start: { line: 45, column: 33 }, end: { line: 45, column: 50 } }, type: 'binary-expr', locations: [{ start: { line: 45, column: 33 }, end: { line: 45, column: 42 } }, { start: { line: 45, column: 46 }, end: { line: 45, column: 50 } }], line: 45 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2470 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2471 | return coverage[path];
|
2472 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2473 | }();var Context = (cov_15dz7p942d.s[0]++, function () {
|
2474 | cov_15dz7p942d.f[0]++;function Context() {
|
2475 | cov_15dz7p942d.f[1]++;cov_15dz7p942d.s[1]++;classCallCheck$1(this, Context);
|
2476 | }cov_15dz7p942d.s[2]++;createClass$1(Context, [{ key: 'setResult', value: function setResult(result) {
|
2477 | cov_15dz7p942d.f[2]++;cov_15dz7p942d.s[3]++;this.result = result;cov_15dz7p942d.s[4]++;this.hasResult = true;cov_15dz7p942d.s[5]++;return this;
|
2478 | } }, { key: 'exit', value: function exit() {
|
2479 | cov_15dz7p942d.f[3]++;cov_15dz7p942d.s[6]++;this.exiting = true;cov_15dz7p942d.s[7]++;return this;
|
2480 | } }, { key: 'switchTo', value: function switchTo(next, pipe) {
|
2481 | cov_15dz7p942d.f[4]++;cov_15dz7p942d.s[8]++;if ((cov_15dz7p942d.b[1][0]++, typeof next === 'string') || (cov_15dz7p942d.b[1][1]++, next instanceof Pipe)) {
|
2482 | cov_15dz7p942d.b[0][0]++;cov_15dz7p942d.s[9]++;this.nextPipe = next;
|
2483 | } else {
|
2484 | cov_15dz7p942d.b[0][1]++;cov_15dz7p942d.s[10]++;this.next = next;cov_15dz7p942d.s[11]++;if (pipe) {
|
2485 | cov_15dz7p942d.b[2][0]++;cov_15dz7p942d.s[12]++;this.nextPipe = pipe;
|
2486 | } else {
|
2487 | cov_15dz7p942d.b[2][1]++;
|
2488 | }
|
2489 | }cov_15dz7p942d.s[13]++;return this;
|
2490 | } }, { key: 'push', value: function push(child, name) {
|
2491 | cov_15dz7p942d.f[5]++;cov_15dz7p942d.s[14]++;child.parent = this;cov_15dz7p942d.s[15]++;if (typeof name !== 'undefined') {
|
2492 | cov_15dz7p942d.b[3][0]++;cov_15dz7p942d.s[16]++;child.childName = name;
|
2493 | } else {
|
2494 | cov_15dz7p942d.b[3][1]++;
|
2495 | }cov_15dz7p942d.s[17]++;child.root = (cov_15dz7p942d.b[4][0]++, this.root) || (cov_15dz7p942d.b[4][1]++, this);cov_15dz7p942d.s[18]++;child.options = (cov_15dz7p942d.b[5][0]++, child.options) || (cov_15dz7p942d.b[5][1]++, this.options);cov_15dz7p942d.s[19]++;if (!this.children) {
|
2496 | cov_15dz7p942d.b[6][0]++;cov_15dz7p942d.s[20]++;this.children = [child];cov_15dz7p942d.s[21]++;this.nextAfterChildren = (cov_15dz7p942d.b[7][0]++, this.next) || (cov_15dz7p942d.b[7][1]++, null);cov_15dz7p942d.s[22]++;this.next = child;
|
2497 | } else {
|
2498 | cov_15dz7p942d.b[6][1]++;cov_15dz7p942d.s[23]++;this.children[this.children.length - 1].next = child;cov_15dz7p942d.s[24]++;this.children.push(child);
|
2499 | }cov_15dz7p942d.s[25]++;child.next = this;cov_15dz7p942d.s[26]++;return this;
|
2500 | } }]);cov_15dz7p942d.s[27]++;return Context;
|
2501 | }());
|
2502 |
|
2503 | var cov_2ces1qo8h1 = function () {
|
2504 | var path = '/Users/benja/proj/jsondiffpatch/src/clone.js',
|
2505 | hash = 'b42c839cc01fdbfba8802dced1ea6cd089d41859',
|
2506 | global = new Function('return this')(),
|
2507 | gcv = '__coverage__',
|
2508 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/clone.js', statementMap: { '0': { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, '1': { start: { line: 2, column: 2 }, end: { line: 2, column: 28 } }, '2': { start: { line: 6, column: 19 }, end: { line: 6, column: 61 } }, '3': { start: { line: 7, column: 2 }, end: { line: 7, column: 50 } }, '4': { start: { line: 11, column: 2 }, end: { line: 13, column: 3 } }, '5': { start: { line: 12, column: 4 }, end: { line: 12, column: 15 } }, '6': { start: { line: 14, column: 2 }, end: { line: 16, column: 3 } }, '7': { start: { line: 15, column: 4 }, end: { line: 15, column: 16 } }, '8': { start: { line: 17, column: 2 }, end: { line: 19, column: 3 } }, '9': { start: { line: 18, column: 4 }, end: { line: 18, column: 26 } }, '10': { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, '11': { start: { line: 21, column: 4 }, end: { line: 21, column: 35 } }, '12': { start: { line: 23, column: 2 }, end: { line: 25, column: 3 } }, '13': { start: { line: 24, column: 4 }, end: { line: 24, column: 28 } }, '14': { start: { line: 26, column: 15 }, end: { line: 26, column: 17 } }, '15': { start: { line: 27, column: 2 }, end: { line: 31, column: 3 } }, '16': { start: { line: 28, column: 4 }, end: { line: 30, column: 5 } }, '17': { start: { line: 29, column: 6 }, end: { line: 29, column: 38 } }, '18': { start: { line: 32, column: 2 }, end: { line: 32, column: 16 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 1, column: 68 }, end: { line: 1, column: 69 } }, loc: { start: { line: 1, column: 81 }, end: { line: 3, column: 1 } }, line: 1 }, '1': { name: 'cloneRegExp', decl: { start: { line: 5, column: 9 }, end: { line: 5, column: 20 } }, loc: { start: { line: 5, column: 25 }, end: { line: 8, column: 1 } }, line: 5 }, '2': { name: 'clone', decl: { start: { line: 10, column: 24 }, end: { line: 10, column: 29 } }, loc: { start: { line: 10, column: 35 }, end: { line: 33, column: 1 } }, line: 10 } }, branchMap: { '0': { loc: { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 1, column: 52 }, end: { line: 1, column: 65 } }, { start: { line: 1, column: 68 }, end: { line: 3, column: 1 } }], line: 1 }, '1': { loc: { start: { line: 11, column: 2 }, end: { line: 13, column: 3 } }, type: 'if', locations: [{ start: { line: 11, column: 2 }, end: { line: 13, column: 3 } }, { start: { line: 11, column: 2 }, end: { line: 13, column: 3 } }], line: 11 }, '2': { loc: { start: { line: 11, column: 7 }, end: { line: 11, column: 74 } }, type: 'cond-expr', locations: [{ start: { line: 11, column: 36 }, end: { line: 11, column: 47 } }, { start: { line: 11, column: 50 }, end: { line: 11, column: 74 } }], line: 11 }, '3': { loc: { start: { line: 14, column: 2 }, end: { line: 16, column: 3 } }, type: 'if', locations: [{ start: { line: 14, column: 2 }, end: { line: 16, column: 3 } }, { start: { line: 14, column: 2 }, end: { line: 16, column: 3 } }], line: 14 }, '4': { loc: { start: { line: 17, column: 2 }, end: { line: 19, column: 3 } }, type: 'if', locations: [{ start: { line: 17, column: 2 }, end: { line: 19, column: 3 } }, { start: { line: 17, column: 2 }, end: { line: 19, column: 3 } }], line: 17 }, '5': { loc: { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, type: 'if', locations: [{ start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }], line: 20 }, '6': { loc: { start: { line: 23, column: 2 }, end: { line: 25, column: 3 } }, type: 'if', locations: [{ start: { line: 23, column: 2 }, end: { line: 25, column: 3 } }, { start: { line: 23, column: 2 }, end: { line: 25, column: 3 } }], line: 23 }, '7': { loc: { start: { line: 28, column: 4 }, end: { line: 30, column: 5 } }, type: 'if', locations: [{ start: { line: 28, column: 4 }, end: { line: 30, column: 5 } }, { start: { line: 28, column: 4 }, end: { line: 30, column: 5 } }], line: 28 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0 }, f: { '0': 0, '1': 0, '2': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2509 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2510 | return coverage[path];
|
2511 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2512 | }();var isArray = (cov_2ces1qo8h1.s[0]++, typeof Array.isArray === 'function' ? (cov_2ces1qo8h1.b[0][0]++, Array.isArray) : (cov_2ces1qo8h1.b[0][1]++, function (a) {
|
2513 | cov_2ces1qo8h1.f[0]++;cov_2ces1qo8h1.s[1]++;return a instanceof Array;
|
2514 | }));function cloneRegExp(re) {
|
2515 | cov_2ces1qo8h1.f[1]++;var regexMatch = (cov_2ces1qo8h1.s[2]++, /^\/(.*)\/([gimyu]*)$/.exec(re.toString()));cov_2ces1qo8h1.s[3]++;return new RegExp(regexMatch[1], regexMatch[2]);
|
2516 | }function clone(arg) {
|
2517 | cov_2ces1qo8h1.f[2]++;cov_2ces1qo8h1.s[4]++;if ((typeof arg === 'undefined' ? (cov_2ces1qo8h1.b[2][0]++, 'undefined') : (cov_2ces1qo8h1.b[2][1]++, _typeof$1(arg))) !== 'object') {
|
2518 | cov_2ces1qo8h1.b[1][0]++;cov_2ces1qo8h1.s[5]++;return arg;
|
2519 | } else {
|
2520 | cov_2ces1qo8h1.b[1][1]++;
|
2521 | }cov_2ces1qo8h1.s[6]++;if (arg === null) {
|
2522 | cov_2ces1qo8h1.b[3][0]++;cov_2ces1qo8h1.s[7]++;return null;
|
2523 | } else {
|
2524 | cov_2ces1qo8h1.b[3][1]++;
|
2525 | }cov_2ces1qo8h1.s[8]++;if (isArray(arg)) {
|
2526 | cov_2ces1qo8h1.b[4][0]++;cov_2ces1qo8h1.s[9]++;return arg.map(clone);
|
2527 | } else {
|
2528 | cov_2ces1qo8h1.b[4][1]++;
|
2529 | }cov_2ces1qo8h1.s[10]++;if (arg instanceof Date) {
|
2530 | cov_2ces1qo8h1.b[5][0]++;cov_2ces1qo8h1.s[11]++;return new Date(arg.getTime());
|
2531 | } else {
|
2532 | cov_2ces1qo8h1.b[5][1]++;
|
2533 | }cov_2ces1qo8h1.s[12]++;if (arg instanceof RegExp) {
|
2534 | cov_2ces1qo8h1.b[6][0]++;cov_2ces1qo8h1.s[13]++;return cloneRegExp(arg);
|
2535 | } else {
|
2536 | cov_2ces1qo8h1.b[6][1]++;
|
2537 | }var cloned = (cov_2ces1qo8h1.s[14]++, {});cov_2ces1qo8h1.s[15]++;for (var name in arg) {
|
2538 | cov_2ces1qo8h1.s[16]++;if (Object.prototype.hasOwnProperty.call(arg, name)) {
|
2539 | cov_2ces1qo8h1.b[7][0]++;cov_2ces1qo8h1.s[17]++;cloned[name] = clone(arg[name]);
|
2540 | } else {
|
2541 | cov_2ces1qo8h1.b[7][1]++;
|
2542 | }
|
2543 | }cov_2ces1qo8h1.s[18]++;return cloned;
|
2544 | }
|
2545 |
|
2546 | var cov_16togqrbp8 = function () {
|
2547 | var path = '/Users/benja/proj/jsondiffpatch/src/contexts/diff.js',
|
2548 | hash = '90bb9cbdad306b0254c6caaccb0a396d5a9299a4',
|
2549 | global = new Function('return this')(),
|
2550 | gcv = '__coverage__',
|
2551 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/contexts/diff.js', statementMap: { '0': { start: { line: 4, column: 18 }, end: { line: 34, column: 10 } }, '1': { start: { line: 5, column: 2 }, end: { line: 5, column: 47 } }, '2': { start: { line: 8, column: 4 }, end: { line: 8, column: 51 } }, '3': { start: { line: 10, column: 16 }, end: { line: 10, column: 134 } }, '4': { start: { line: 12, column: 4 }, end: { line: 12, column: 22 } }, '5': { start: { line: 13, column: 4 }, end: { line: 13, column: 24 } }, '6': { start: { line: 14, column: 4 }, end: { line: 14, column: 24 } }, '7': { start: { line: 15, column: 4 }, end: { line: 15, column: 17 } }, '8': { start: { line: 18, column: 2 }, end: { line: 32, column: 6 } }, '9': { start: { line: 21, column: 6 }, end: { line: 29, column: 7 } }, '10': { start: { line: 22, column: 20 }, end: { line: 22, column: 116 } }, '11': { start: { line: 23, column: 8 }, end: { line: 25, column: 9 } }, '12': { start: { line: 24, column: 10 }, end: { line: 24, column: 39 } }, '13': { start: { line: 26, column: 8 }, end: { line: 28, column: 9 } }, '14': { start: { line: 27, column: 10 }, end: { line: 27, column: 39 } }, '15': { start: { line: 30, column: 6 }, end: { line: 30, column: 64 } }, '16': { start: { line: 33, column: 2 }, end: { line: 33, column: 21 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 4, column: 18 }, end: { line: 4, column: 19 } }, loc: { start: { line: 4, column: 38 }, end: { line: 34, column: 1 } }, line: 4 }, '1': { name: 'DiffContext', decl: { start: { line: 7, column: 11 }, end: { line: 7, column: 22 } }, loc: { start: { line: 7, column: 36 }, end: { line: 16, column: 3 } }, line: 7 }, '2': { name: 'setResult', decl: { start: { line: 20, column: 20 }, end: { line: 20, column: 29 } }, loc: { start: { line: 20, column: 38 }, end: { line: 31, column: 5 } }, line: 20 } }, branchMap: { '0': { loc: { start: { line: 10, column: 62 }, end: { line: 10, column: 121 } }, type: 'binary-expr', locations: [{ start: { line: 10, column: 62 }, end: { line: 10, column: 83 } }, { start: { line: 10, column: 87 }, end: { line: 10, column: 121 } }], line: 10 }, '1': { loc: { start: { line: 21, column: 6 }, end: { line: 29, column: 7 } }, type: 'if', locations: [{ start: { line: 21, column: 6 }, end: { line: 29, column: 7 } }, { start: { line: 21, column: 6 }, end: { line: 29, column: 7 } }], line: 21 }, '2': { loc: { start: { line: 21, column: 10 }, end: { line: 21, column: 130 } }, type: 'binary-expr', locations: [{ start: { line: 21, column: 10 }, end: { line: 21, column: 38 } }, { start: { line: 21, column: 42 }, end: { line: 21, column: 130 } }], line: 21 }, '3': { loc: { start: { line: 21, column: 43 }, end: { line: 21, column: 116 } }, type: 'cond-expr', locations: [{ start: { line: 21, column: 75 }, end: { line: 21, column: 86 } }, { start: { line: 21, column: 89 }, end: { line: 21, column: 116 } }], line: 21 }, '4': { loc: { start: { line: 22, column: 20 }, end: { line: 22, column: 116 } }, type: 'cond-expr', locations: [{ start: { line: 22, column: 73 }, end: { line: 22, column: 101 } }, { start: { line: 22, column: 104 }, end: { line: 22, column: 116 } }], line: 22 }, '5': { loc: { start: { line: 23, column: 8 }, end: { line: 25, column: 9 } }, type: 'if', locations: [{ start: { line: 23, column: 8 }, end: { line: 25, column: 9 } }, { start: { line: 23, column: 8 }, end: { line: 25, column: 9 } }], line: 23 }, '6': { loc: { start: { line: 26, column: 8 }, end: { line: 28, column: 9 } }, type: 'if', locations: [{ start: { line: 26, column: 8 }, end: { line: 28, column: 9 } }, { start: { line: 26, column: 8 }, end: { line: 28, column: 9 } }], line: 26 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0 }, f: { '0': 0, '1': 0, '2': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2552 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2553 | return coverage[path];
|
2554 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2555 | }();var DiffContext = (cov_16togqrbp8.s[0]++, function (_Context) {
|
2556 | cov_16togqrbp8.f[0]++;cov_16togqrbp8.s[1]++;inherits$1(DiffContext, _Context);function DiffContext(left, right) {
|
2557 | cov_16togqrbp8.f[1]++;cov_16togqrbp8.s[2]++;classCallCheck$1(this, DiffContext);var _this = (cov_16togqrbp8.s[3]++, possibleConstructorReturn$1(this, ((cov_16togqrbp8.b[0][0]++, DiffContext.__proto__) || (cov_16togqrbp8.b[0][1]++, Object.getPrototypeOf(DiffContext))).call(this)));cov_16togqrbp8.s[4]++;_this.left = left;cov_16togqrbp8.s[5]++;_this.right = right;cov_16togqrbp8.s[6]++;_this.pipe = 'diff';cov_16togqrbp8.s[7]++;return _this;
|
2558 | }cov_16togqrbp8.s[8]++;createClass$1(DiffContext, [{ key: 'setResult', value: function setResult(result) {
|
2559 | cov_16togqrbp8.f[2]++;cov_16togqrbp8.s[9]++;if ((cov_16togqrbp8.b[2][0]++, this.options.cloneDiffValues) && (cov_16togqrbp8.b[2][1]++, (typeof result === 'undefined' ? (cov_16togqrbp8.b[3][0]++, 'undefined') : (cov_16togqrbp8.b[3][1]++, _typeof$1(result))) === 'object')) {
|
2560 | cov_16togqrbp8.b[1][0]++;var clone$$1 = (cov_16togqrbp8.s[10]++, typeof this.options.cloneDiffValues === 'function' ? (cov_16togqrbp8.b[4][0]++, this.options.cloneDiffValues) : (cov_16togqrbp8.b[4][1]++, clone));cov_16togqrbp8.s[11]++;if (_typeof$1(result[0]) === 'object') {
|
2561 | cov_16togqrbp8.b[5][0]++;cov_16togqrbp8.s[12]++;result[0] = clone$$1(result[0]);
|
2562 | } else {
|
2563 | cov_16togqrbp8.b[5][1]++;
|
2564 | }cov_16togqrbp8.s[13]++;if (_typeof$1(result[1]) === 'object') {
|
2565 | cov_16togqrbp8.b[6][0]++;cov_16togqrbp8.s[14]++;result[1] = clone$$1(result[1]);
|
2566 | } else {
|
2567 | cov_16togqrbp8.b[6][1]++;
|
2568 | }
|
2569 | } else {
|
2570 | cov_16togqrbp8.b[1][1]++;
|
2571 | }cov_16togqrbp8.s[15]++;return Context.prototype.setResult.apply(this, arguments);
|
2572 | } }]);cov_16togqrbp8.s[16]++;return DiffContext;
|
2573 | }(Context));
|
2574 |
|
2575 | var cov_1lch9qj04n = function () {
|
2576 | var path = '/Users/benja/proj/jsondiffpatch/src/contexts/patch.js',
|
2577 | hash = '60e4c19ac942f0d668ee8b1d8ccd4c42e2bbeee8',
|
2578 | global = new Function('return this')(),
|
2579 | gcv = '__coverage__',
|
2580 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/contexts/patch.js', statementMap: { '0': { start: { line: 3, column: 19 }, end: { line: 18, column: 10 } }, '1': { start: { line: 4, column: 2 }, end: { line: 4, column: 48 } }, '2': { start: { line: 7, column: 4 }, end: { line: 7, column: 52 } }, '3': { start: { line: 9, column: 16 }, end: { line: 9, column: 136 } }, '4': { start: { line: 11, column: 4 }, end: { line: 11, column: 22 } }, '5': { start: { line: 12, column: 4 }, end: { line: 12, column: 24 } }, '6': { start: { line: 13, column: 4 }, end: { line: 13, column: 25 } }, '7': { start: { line: 14, column: 4 }, end: { line: 14, column: 17 } }, '8': { start: { line: 17, column: 2 }, end: { line: 17, column: 22 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 3, column: 19 }, end: { line: 3, column: 20 } }, loc: { start: { line: 3, column: 39 }, end: { line: 18, column: 1 } }, line: 3 }, '1': { name: 'PatchContext', decl: { start: { line: 6, column: 11 }, end: { line: 6, column: 23 } }, loc: { start: { line: 6, column: 37 }, end: { line: 15, column: 3 } }, line: 6 } }, branchMap: { '0': { loc: { start: { line: 9, column: 62 }, end: { line: 9, column: 123 } }, type: 'binary-expr', locations: [{ start: { line: 9, column: 62 }, end: { line: 9, column: 84 } }, { start: { line: 9, column: 88 }, end: { line: 9, column: 123 } }], line: 9 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0 }, f: { '0': 0, '1': 0 }, b: { '0': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2581 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2582 | return coverage[path];
|
2583 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2584 | }();var PatchContext = (cov_1lch9qj04n.s[0]++, function (_Context) {
|
2585 | cov_1lch9qj04n.f[0]++;cov_1lch9qj04n.s[1]++;inherits$1(PatchContext, _Context);function PatchContext(left, delta) {
|
2586 | cov_1lch9qj04n.f[1]++;cov_1lch9qj04n.s[2]++;classCallCheck$1(this, PatchContext);var _this = (cov_1lch9qj04n.s[3]++, possibleConstructorReturn$1(this, ((cov_1lch9qj04n.b[0][0]++, PatchContext.__proto__) || (cov_1lch9qj04n.b[0][1]++, Object.getPrototypeOf(PatchContext))).call(this)));cov_1lch9qj04n.s[4]++;_this.left = left;cov_1lch9qj04n.s[5]++;_this.delta = delta;cov_1lch9qj04n.s[6]++;_this.pipe = 'patch';cov_1lch9qj04n.s[7]++;return _this;
|
2587 | }cov_1lch9qj04n.s[8]++;return PatchContext;
|
2588 | }(Context));
|
2589 |
|
2590 | var cov_15hv6xp4jc = function () {
|
2591 | var path = '/Users/benja/proj/jsondiffpatch/src/contexts/reverse.js',
|
2592 | hash = 'e404bb01b76ce93560e185b5c0356e677942aae3',
|
2593 | global = new Function('return this')(),
|
2594 | gcv = '__coverage__',
|
2595 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/contexts/reverse.js', statementMap: { '0': { start: { line: 3, column: 21 }, end: { line: 17, column: 10 } }, '1': { start: { line: 4, column: 2 }, end: { line: 4, column: 50 } }, '2': { start: { line: 7, column: 4 }, end: { line: 7, column: 54 } }, '3': { start: { line: 9, column: 16 }, end: { line: 9, column: 140 } }, '4': { start: { line: 11, column: 4 }, end: { line: 11, column: 24 } }, '5': { start: { line: 12, column: 4 }, end: { line: 12, column: 27 } }, '6': { start: { line: 13, column: 4 }, end: { line: 13, column: 17 } }, '7': { start: { line: 16, column: 2 }, end: { line: 16, column: 24 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 3, column: 21 }, end: { line: 3, column: 22 } }, loc: { start: { line: 3, column: 41 }, end: { line: 17, column: 1 } }, line: 3 }, '1': { name: 'ReverseContext', decl: { start: { line: 6, column: 11 }, end: { line: 6, column: 25 } }, loc: { start: { line: 6, column: 33 }, end: { line: 14, column: 3 } }, line: 6 } }, branchMap: { '0': { loc: { start: { line: 9, column: 62 }, end: { line: 9, column: 127 } }, type: 'binary-expr', locations: [{ start: { line: 9, column: 62 }, end: { line: 9, column: 86 } }, { start: { line: 9, column: 90 }, end: { line: 9, column: 127 } }], line: 9 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0 }, f: { '0': 0, '1': 0 }, b: { '0': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2596 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2597 | return coverage[path];
|
2598 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2599 | }();var ReverseContext = (cov_15hv6xp4jc.s[0]++, function (_Context) {
|
2600 | cov_15hv6xp4jc.f[0]++;cov_15hv6xp4jc.s[1]++;inherits$1(ReverseContext, _Context);function ReverseContext(delta) {
|
2601 | cov_15hv6xp4jc.f[1]++;cov_15hv6xp4jc.s[2]++;classCallCheck$1(this, ReverseContext);var _this = (cov_15hv6xp4jc.s[3]++, possibleConstructorReturn$1(this, ((cov_15hv6xp4jc.b[0][0]++, ReverseContext.__proto__) || (cov_15hv6xp4jc.b[0][1]++, Object.getPrototypeOf(ReverseContext))).call(this)));cov_15hv6xp4jc.s[4]++;_this.delta = delta;cov_15hv6xp4jc.s[5]++;_this.pipe = 'reverse';cov_15hv6xp4jc.s[6]++;return _this;
|
2602 | }cov_15hv6xp4jc.s[7]++;return ReverseContext;
|
2603 | }(Context));
|
2604 |
|
2605 | var cov_1c74kci15l = function () {
|
2606 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/trivial.js',
|
2607 | hash = '98d37903597642b2333c51a70abec4329d29cfc3',
|
2608 | global = new Function('return this')(),
|
2609 | gcv = '__coverage__',
|
2610 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/trivial.js', statementMap: { '0': { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, '1': { start: { line: 2, column: 2 }, end: { line: 2, column: 28 } }, '2': { start: { line: 5, column: 24 }, end: { line: 52, column: 1 } }, '3': { start: { line: 6, column: 2 }, end: { line: 9, column: 3 } }, '4': { start: { line: 7, column: 4 }, end: { line: 7, column: 40 } }, '5': { start: { line: 8, column: 4 }, end: { line: 8, column: 11 } }, '6': { start: { line: 10, column: 2 }, end: { line: 16, column: 3 } }, '7': { start: { line: 11, column: 4 }, end: { line: 13, column: 5 } }, '8': { start: { line: 12, column: 6 }, end: { line: 12, column: 53 } }, '9': { start: { line: 14, column: 4 }, end: { line: 14, column: 46 } }, '10': { start: { line: 15, column: 4 }, end: { line: 15, column: 11 } }, '11': { start: { line: 17, column: 2 }, end: { line: 20, column: 3 } }, '12': { start: { line: 18, column: 4 }, end: { line: 18, column: 51 } }, '13': { start: { line: 19, column: 4 }, end: { line: 19, column: 11 } }, '14': { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, '15': { start: { line: 22, column: 4 }, end: { line: 22, column: 51 } }, '16': { start: { line: 24, column: 2 }, end: { line: 24, column: 88 } }, '17': { start: { line: 25, column: 2 }, end: { line: 25, column: 91 } }, '18': { start: { line: 26, column: 2 }, end: { line: 29, column: 3 } }, '19': { start: { line: 27, column: 4 }, end: { line: 27, column: 60 } }, '20': { start: { line: 28, column: 4 }, end: { line: 28, column: 11 } }, '21': { start: { line: 30, column: 2 }, end: { line: 33, column: 3 } }, '22': { start: { line: 31, column: 4 }, end: { line: 31, column: 60 } }, '23': { start: { line: 32, column: 4 }, end: { line: 32, column: 11 } }, '24': { start: { line: 34, column: 2 }, end: { line: 36, column: 3 } }, '25': { start: { line: 35, column: 4 }, end: { line: 35, column: 48 } }, '26': { start: { line: 37, column: 2 }, end: { line: 39, column: 3 } }, '27': { start: { line: 38, column: 4 }, end: { line: 38, column: 50 } }, '28': { start: { line: 40, column: 2 }, end: { line: 43, column: 3 } }, '29': { start: { line: 41, column: 4 }, end: { line: 41, column: 60 } }, '30': { start: { line: 42, column: 4 }, end: { line: 42, column: 11 } }, '31': { start: { line: 45, column: 2 }, end: { line: 51, column: 3 } }, '32': { start: { line: 46, column: 4 }, end: { line: 50, column: 5 } }, '33': { start: { line: 47, column: 6 }, end: { line: 47, column: 84 } }, '34': { start: { line: 49, column: 6 }, end: { line: 49, column: 62 } }, '35': { start: { line: 53, column: 0 }, end: { line: 53, column: 34 } }, '36': { start: { line: 55, column: 25 }, end: { line: 82, column: 1 } }, '37': { start: { line: 56, column: 2 }, end: { line: 59, column: 3 } }, '38': { start: { line: 57, column: 4 }, end: { line: 57, column: 43 } }, '39': { start: { line: 58, column: 4 }, end: { line: 58, column: 11 } }, '40': { start: { line: 60, column: 2 }, end: { line: 60, column: 43 } }, '41': { start: { line: 61, column: 2 }, end: { line: 63, column: 3 } }, '42': { start: { line: 62, column: 4 }, end: { line: 62, column: 11 } }, '43': { start: { line: 64, column: 2 }, end: { line: 67, column: 3 } }, '44': { start: { line: 65, column: 4 }, end: { line: 65, column: 47 } }, '45': { start: { line: 66, column: 4 }, end: { line: 66, column: 11 } }, '46': { start: { line: 68, column: 2 }, end: { line: 78, column: 3 } }, '47': { start: { line: 69, column: 4 }, end: { line: 75, column: 5 } }, '48': { start: { line: 70, column: 22 }, end: { line: 70, column: 67 } }, '49': { start: { line: 71, column: 6 }, end: { line: 74, column: 7 } }, '50': { start: { line: 72, column: 8 }, end: { line: 72, column: 73 } }, '51': { start: { line: 73, column: 8 }, end: { line: 73, column: 15 } }, '52': { start: { line: 76, column: 4 }, end: { line: 76, column: 47 } }, '53': { start: { line: 77, column: 4 }, end: { line: 77, column: 11 } }, '54': { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, '55': { start: { line: 80, column: 4 }, end: { line: 80, column: 40 } }, '56': { start: { line: 83, column: 0 }, end: { line: 83, column: 35 } }, '57': { start: { line: 85, column: 27 }, end: { line: 105, column: 1 } }, '58': { start: { line: 86, column: 2 }, end: { line: 89, column: 3 } }, '59': { start: { line: 87, column: 4 }, end: { line: 87, column: 44 } }, '60': { start: { line: 88, column: 4 }, end: { line: 88, column: 11 } }, '61': { start: { line: 90, column: 2 }, end: { line: 90, column: 43 } }, '62': { start: { line: 91, column: 2 }, end: { line: 93, column: 3 } }, '63': { start: { line: 92, column: 4 }, end: { line: 92, column: 11 } }, '64': { start: { line: 94, column: 2 }, end: { line: 97, column: 3 } }, '65': { start: { line: 95, column: 4 }, end: { line: 95, column: 55 } }, '66': { start: { line: 96, column: 4 }, end: { line: 96, column: 11 } }, '67': { start: { line: 98, column: 2 }, end: { line: 101, column: 3 } }, '68': { start: { line: 99, column: 4 }, end: { line: 99, column: 67 } }, '69': { start: { line: 100, column: 4 }, end: { line: 100, column: 11 } }, '70': { start: { line: 102, column: 2 }, end: { line: 104, column: 3 } }, '71': { start: { line: 103, column: 4 }, end: { line: 103, column: 49 } }, '72': { start: { line: 106, column: 0 }, end: { line: 106, column: 37 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 1, column: 68 }, end: { line: 1, column: 69 } }, loc: { start: { line: 1, column: 81 }, end: { line: 3, column: 1 } }, line: 1 }, '1': { name: 'trivialMatchesDiffFilter', decl: { start: { line: 5, column: 33 }, end: { line: 5, column: 57 } }, loc: { start: { line: 5, column: 67 }, end: { line: 52, column: 1 } }, line: 5 }, '2': { name: 'trivialMatchesPatchFilter', decl: { start: { line: 55, column: 34 }, end: { line: 55, column: 59 } }, loc: { start: { line: 55, column: 69 }, end: { line: 82, column: 1 } }, line: 55 }, '3': { name: 'trivialReferseFilter', decl: { start: { line: 85, column: 36 }, end: { line: 85, column: 56 } }, loc: { start: { line: 85, column: 66 }, end: { line: 105, column: 1 } }, line: 85 } }, branchMap: { '0': { loc: { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 1, column: 52 }, end: { line: 1, column: 65 } }, { start: { line: 1, column: 68 }, end: { line: 3, column: 1 } }], line: 1 }, '1': { loc: { start: { line: 6, column: 2 }, end: { line: 9, column: 3 } }, type: 'if', locations: [{ start: { line: 6, column: 2 }, end: { line: 9, column: 3 } }, { start: { line: 6, column: 2 }, end: { line: 9, column: 3 } }], line: 6 }, '2': { loc: { start: { line: 10, column: 2 }, end: { line: 16, column: 3 } }, type: 'if', locations: [{ start: { line: 10, column: 2 }, end: { line: 16, column: 3 } }, { start: { line: 10, column: 2 }, end: { line: 16, column: 3 } }], line: 10 }, '3': { loc: { start: { line: 11, column: 4 }, end: { line: 13, column: 5 } }, type: 'if', locations: [{ start: { line: 11, column: 4 }, end: { line: 13, column: 5 } }, { start: { line: 11, column: 4 }, end: { line: 13, column: 5 } }], line: 11 }, '4': { loc: { start: { line: 17, column: 2 }, end: { line: 20, column: 3 } }, type: 'if', locations: [{ start: { line: 17, column: 2 }, end: { line: 20, column: 3 } }, { start: { line: 17, column: 2 }, end: { line: 20, column: 3 } }], line: 17 }, '5': { loc: { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, type: 'if', locations: [{ start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }], line: 21 }, '6': { loc: { start: { line: 21, column: 6 }, end: { line: 21, column: 79 } }, type: 'binary-expr', locations: [{ start: { line: 21, column: 6 }, end: { line: 21, column: 40 } }, { start: { line: 21, column: 44 }, end: { line: 21, column: 79 } }], line: 21 }, '7': { loc: { start: { line: 24, column: 21 }, end: { line: 24, column: 87 } }, type: 'cond-expr', locations: [{ start: { line: 24, column: 45 }, end: { line: 24, column: 51 } }, { start: { line: 24, column: 54 }, end: { line: 24, column: 87 } }], line: 24 }, '8': { loc: { start: { line: 25, column: 22 }, end: { line: 25, column: 90 } }, type: 'cond-expr', locations: [{ start: { line: 25, column: 47 }, end: { line: 25, column: 53 } }, { start: { line: 25, column: 56 }, end: { line: 25, column: 90 } }], line: 25 }, '9': { loc: { start: { line: 26, column: 2 }, end: { line: 29, column: 3 } }, type: 'if', locations: [{ start: { line: 26, column: 2 }, end: { line: 29, column: 3 } }, { start: { line: 26, column: 2 }, end: { line: 29, column: 3 } }], line: 26 }, '10': { loc: { start: { line: 30, column: 2 }, end: { line: 33, column: 3 } }, type: 'if', locations: [{ start: { line: 30, column: 2 }, end: { line: 33, column: 3 } }, { start: { line: 30, column: 2 }, end: { line: 33, column: 3 } }], line: 30 }, '11': { loc: { start: { line: 30, column: 6 }, end: { line: 30, column: 69 } }, type: 'binary-expr', locations: [{ start: { line: 30, column: 6 }, end: { line: 30, column: 36 } }, { start: { line: 30, column: 40 }, end: { line: 30, column: 69 } }], line: 30 }, '12': { loc: { start: { line: 34, column: 2 }, end: { line: 36, column: 3 } }, type: 'if', locations: [{ start: { line: 34, column: 2 }, end: { line: 36, column: 3 } }, { start: { line: 34, column: 2 }, end: { line: 36, column: 3 } }], line: 34 }, '13': { loc: { start: { line: 37, column: 2 }, end: { line: 39, column: 3 } }, type: 'if', locations: [{ start: { line: 37, column: 2 }, end: { line: 39, column: 3 } }, { start: { line: 37, column: 2 }, end: { line: 39, column: 3 } }], line: 37 }, '14': { loc: { start: { line: 40, column: 2 }, end: { line: 43, column: 3 } }, type: 'if', locations: [{ start: { line: 40, column: 2 }, end: { line: 43, column: 3 } }, { start: { line: 40, column: 2 }, end: { line: 43, column: 3 } }], line: 40 }, '15': { loc: { start: { line: 45, column: 2 }, end: { line: 51, column: 3 } }, type: 'if', locations: [{ start: { line: 45, column: 2 }, end: { line: 51, column: 3 } }, { start: { line: 45, column: 2 }, end: { line: 51, column: 3 } }], line: 45 }, '16': { loc: { start: { line: 46, column: 4 }, end: { line: 50, column: 5 } }, type: 'if', locations: [{ start: { line: 46, column: 4 }, end: { line: 50, column: 5 } }, { start: { line: 46, column: 4 }, end: { line: 50, column: 5 } }], line: 46 }, '17': { loc: { start: { line: 56, column: 2 }, end: { line: 59, column: 3 } }, type: 'if', locations: [{ start: { line: 56, column: 2 }, end: { line: 59, column: 3 } }, { start: { line: 56, column: 2 }, end: { line: 59, column: 3 } }], line: 56 }, '18': { loc: { start: { line: 61, column: 2 }, end: { line: 63, column: 3 } }, type: 'if', locations: [{ start: { line: 61, column: 2 }, end: { line: 63, column: 3 } }, { start: { line: 61, column: 2 }, end: { line: 63, column: 3 } }], line: 61 }, '19': { loc: { start: { line: 64, column: 2 }, end: { line: 67, column: 3 } }, type: 'if', locations: [{ start: { line: 64, column: 2 }, end: { line: 67, column: 3 } }, { start: { line: 64, column: 2 }, end: { line: 67, column: 3 } }], line: 64 }, '20': { loc: { start: { line: 68, column: 2 }, end: { line: 78, column: 3 } }, type: 'if', locations: [{ start: { line: 68, column: 2 }, end: { line: 78, column: 3 } }, { start: { line: 68, column: 2 }, end: { line: 78, column: 3 } }], line: 68 }, '21': { loc: { start: { line: 69, column: 4 }, end: { line: 75, column: 5 } }, type: 'if', locations: [{ start: { line: 69, column: 4 }, end: { line: 75, column: 5 } }, { start: { line: 69, column: 4 }, end: { line: 75, column: 5 } }], line: 69 }, '22': { loc: { start: { line: 71, column: 6 }, end: { line: 74, column: 7 } }, type: 'if', locations: [{ start: { line: 71, column: 6 }, end: { line: 74, column: 7 } }, { start: { line: 71, column: 6 }, end: { line: 74, column: 7 } }], line: 71 }, '23': { loc: { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, type: 'if', locations: [{ start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }], line: 79 }, '24': { loc: { start: { line: 79, column: 6 }, end: { line: 79, column: 58 } }, type: 'binary-expr', locations: [{ start: { line: 79, column: 6 }, end: { line: 79, column: 32 } }, { start: { line: 79, column: 36 }, end: { line: 79, column: 58 } }], line: 79 }, '25': { loc: { start: { line: 86, column: 2 }, end: { line: 89, column: 3 } }, type: 'if', locations: [{ start: { line: 86, column: 2 }, end: { line: 89, column: 3 } }, { start: { line: 86, column: 2 }, end: { line: 89, column: 3 } }], line: 86 }, '26': { loc: { start: { line: 91, column: 2 }, end: { line: 93, column: 3 } }, type: 'if', locations: [{ start: { line: 91, column: 2 }, end: { line: 93, column: 3 } }, { start: { line: 91, column: 2 }, end: { line: 93, column: 3 } }], line: 91 }, '27': { loc: { start: { line: 94, column: 2 }, end: { line: 97, column: 3 } }, type: 'if', locations: [{ start: { line: 94, column: 2 }, end: { line: 97, column: 3 } }, { start: { line: 94, column: 2 }, end: { line: 97, column: 3 } }], line: 94 }, '28': { loc: { start: { line: 98, column: 2 }, end: { line: 101, column: 3 } }, type: 'if', locations: [{ start: { line: 98, column: 2 }, end: { line: 101, column: 3 } }, { start: { line: 98, column: 2 }, end: { line: 101, column: 3 } }], line: 98 }, '29': { loc: { start: { line: 102, column: 2 }, end: { line: 104, column: 3 } }, type: 'if', locations: [{ start: { line: 102, column: 2 }, end: { line: 104, column: 3 } }, { start: { line: 102, column: 2 }, end: { line: 104, column: 3 } }], line: 102 }, '30': { loc: { start: { line: 102, column: 6 }, end: { line: 102, column: 58 } }, type: 'binary-expr', locations: [{ start: { line: 102, column: 6 }, end: { line: 102, column: 32 } }, { start: { line: 102, column: 36 }, end: { line: 102, column: 58 } }], line: 102 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0], '22': [0, 0], '23': [0, 0], '24': [0, 0], '25': [0, 0], '26': [0, 0], '27': [0, 0], '28': [0, 0], '29': [0, 0], '30': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2611 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2612 | return coverage[path];
|
2613 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2614 | }();var isArray$1 = (cov_1c74kci15l.s[0]++, typeof Array.isArray === 'function' ? (cov_1c74kci15l.b[0][0]++, Array.isArray) : (cov_1c74kci15l.b[0][1]++, function (a) {
|
2615 | cov_1c74kci15l.f[0]++;cov_1c74kci15l.s[1]++;return a instanceof Array;
|
2616 | }));cov_1c74kci15l.s[2]++;var diffFilter = function trivialMatchesDiffFilter(context) {
|
2617 | cov_1c74kci15l.f[1]++;cov_1c74kci15l.s[3]++;if (context.left === context.right) {
|
2618 | cov_1c74kci15l.b[1][0]++;cov_1c74kci15l.s[4]++;context.setResult(undefined).exit();cov_1c74kci15l.s[5]++;return;
|
2619 | } else {
|
2620 | cov_1c74kci15l.b[1][1]++;
|
2621 | }cov_1c74kci15l.s[6]++;if (typeof context.left === 'undefined') {
|
2622 | cov_1c74kci15l.b[2][0]++;cov_1c74kci15l.s[7]++;if (typeof context.right === 'function') {
|
2623 | cov_1c74kci15l.b[3][0]++;cov_1c74kci15l.s[8]++;throw new Error('functions are not supported');
|
2624 | } else {
|
2625 | cov_1c74kci15l.b[3][1]++;
|
2626 | }cov_1c74kci15l.s[9]++;context.setResult([context.right]).exit();cov_1c74kci15l.s[10]++;return;
|
2627 | } else {
|
2628 | cov_1c74kci15l.b[2][1]++;
|
2629 | }cov_1c74kci15l.s[11]++;if (typeof context.right === 'undefined') {
|
2630 | cov_1c74kci15l.b[4][0]++;cov_1c74kci15l.s[12]++;context.setResult([context.left, 0, 0]).exit();cov_1c74kci15l.s[13]++;return;
|
2631 | } else {
|
2632 | cov_1c74kci15l.b[4][1]++;
|
2633 | }cov_1c74kci15l.s[14]++;if ((cov_1c74kci15l.b[6][0]++, typeof context.left === 'function') || (cov_1c74kci15l.b[6][1]++, typeof context.right === 'function')) {
|
2634 | cov_1c74kci15l.b[5][0]++;cov_1c74kci15l.s[15]++;throw new Error('functions are not supported');
|
2635 | } else {
|
2636 | cov_1c74kci15l.b[5][1]++;
|
2637 | }cov_1c74kci15l.s[16]++;context.leftType = context.left === null ? (cov_1c74kci15l.b[7][0]++, 'null') : (cov_1c74kci15l.b[7][1]++, _typeof$1(context.left));cov_1c74kci15l.s[17]++;context.rightType = context.right === null ? (cov_1c74kci15l.b[8][0]++, 'null') : (cov_1c74kci15l.b[8][1]++, _typeof$1(context.right));cov_1c74kci15l.s[18]++;if (context.leftType !== context.rightType) {
|
2638 | cov_1c74kci15l.b[9][0]++;cov_1c74kci15l.s[19]++;context.setResult([context.left, context.right]).exit();cov_1c74kci15l.s[20]++;return;
|
2639 | } else {
|
2640 | cov_1c74kci15l.b[9][1]++;
|
2641 | }cov_1c74kci15l.s[21]++;if ((cov_1c74kci15l.b[11][0]++, context.leftType === 'boolean') || (cov_1c74kci15l.b[11][1]++, context.leftType === 'number')) {
|
2642 | cov_1c74kci15l.b[10][0]++;cov_1c74kci15l.s[22]++;context.setResult([context.left, context.right]).exit();cov_1c74kci15l.s[23]++;return;
|
2643 | } else {
|
2644 | cov_1c74kci15l.b[10][1]++;
|
2645 | }cov_1c74kci15l.s[24]++;if (context.leftType === 'object') {
|
2646 | cov_1c74kci15l.b[12][0]++;cov_1c74kci15l.s[25]++;context.leftIsArray = isArray$1(context.left);
|
2647 | } else {
|
2648 | cov_1c74kci15l.b[12][1]++;
|
2649 | }cov_1c74kci15l.s[26]++;if (context.rightType === 'object') {
|
2650 | cov_1c74kci15l.b[13][0]++;cov_1c74kci15l.s[27]++;context.rightIsArray = isArray$1(context.right);
|
2651 | } else {
|
2652 | cov_1c74kci15l.b[13][1]++;
|
2653 | }cov_1c74kci15l.s[28]++;if (context.leftIsArray !== context.rightIsArray) {
|
2654 | cov_1c74kci15l.b[14][0]++;cov_1c74kci15l.s[29]++;context.setResult([context.left, context.right]).exit();cov_1c74kci15l.s[30]++;return;
|
2655 | } else {
|
2656 | cov_1c74kci15l.b[14][1]++;
|
2657 | }cov_1c74kci15l.s[31]++;if (context.left instanceof RegExp) {
|
2658 | cov_1c74kci15l.b[15][0]++;cov_1c74kci15l.s[32]++;if (context.right instanceof RegExp) {
|
2659 | cov_1c74kci15l.b[16][0]++;cov_1c74kci15l.s[33]++;context.setResult([context.left.toString(), context.right.toString()]).exit();
|
2660 | } else {
|
2661 | cov_1c74kci15l.b[16][1]++;cov_1c74kci15l.s[34]++;context.setResult([context.left, context.right]).exit();
|
2662 | }
|
2663 | } else {
|
2664 | cov_1c74kci15l.b[15][1]++;
|
2665 | }
|
2666 | };cov_1c74kci15l.s[35]++;diffFilter.filterName = 'trivial';cov_1c74kci15l.s[36]++;var patchFilter = function trivialMatchesPatchFilter(context) {
|
2667 | cov_1c74kci15l.f[2]++;cov_1c74kci15l.s[37]++;if (typeof context.delta === 'undefined') {
|
2668 | cov_1c74kci15l.b[17][0]++;cov_1c74kci15l.s[38]++;context.setResult(context.left).exit();cov_1c74kci15l.s[39]++;return;
|
2669 | } else {
|
2670 | cov_1c74kci15l.b[17][1]++;
|
2671 | }cov_1c74kci15l.s[40]++;context.nested = !isArray$1(context.delta);cov_1c74kci15l.s[41]++;if (context.nested) {
|
2672 | cov_1c74kci15l.b[18][0]++;cov_1c74kci15l.s[42]++;return;
|
2673 | } else {
|
2674 | cov_1c74kci15l.b[18][1]++;
|
2675 | }cov_1c74kci15l.s[43]++;if (context.delta.length === 1) {
|
2676 | cov_1c74kci15l.b[19][0]++;cov_1c74kci15l.s[44]++;context.setResult(context.delta[0]).exit();cov_1c74kci15l.s[45]++;return;
|
2677 | } else {
|
2678 | cov_1c74kci15l.b[19][1]++;
|
2679 | }cov_1c74kci15l.s[46]++;if (context.delta.length === 2) {
|
2680 | cov_1c74kci15l.b[20][0]++;cov_1c74kci15l.s[47]++;if (context.left instanceof RegExp) {
|
2681 | cov_1c74kci15l.b[21][0]++;var regexArgs = (cov_1c74kci15l.s[48]++, /^\/(.*)\/([gimyu]+)$/.exec(context.delta[1]));cov_1c74kci15l.s[49]++;if (regexArgs) {
|
2682 | cov_1c74kci15l.b[22][0]++;cov_1c74kci15l.s[50]++;context.setResult(new RegExp(regexArgs[1], regexArgs[2])).exit();cov_1c74kci15l.s[51]++;return;
|
2683 | } else {
|
2684 | cov_1c74kci15l.b[22][1]++;
|
2685 | }
|
2686 | } else {
|
2687 | cov_1c74kci15l.b[21][1]++;
|
2688 | }cov_1c74kci15l.s[52]++;context.setResult(context.delta[1]).exit();cov_1c74kci15l.s[53]++;return;
|
2689 | } else {
|
2690 | cov_1c74kci15l.b[20][1]++;
|
2691 | }cov_1c74kci15l.s[54]++;if ((cov_1c74kci15l.b[24][0]++, context.delta.length === 3) && (cov_1c74kci15l.b[24][1]++, context.delta[2] === 0)) {
|
2692 | cov_1c74kci15l.b[23][0]++;cov_1c74kci15l.s[55]++;context.setResult(undefined).exit();
|
2693 | } else {
|
2694 | cov_1c74kci15l.b[23][1]++;
|
2695 | }
|
2696 | };cov_1c74kci15l.s[56]++;patchFilter.filterName = 'trivial';cov_1c74kci15l.s[57]++;var reverseFilter = function trivialReferseFilter(context) {
|
2697 | cov_1c74kci15l.f[3]++;cov_1c74kci15l.s[58]++;if (typeof context.delta === 'undefined') {
|
2698 | cov_1c74kci15l.b[25][0]++;cov_1c74kci15l.s[59]++;context.setResult(context.delta).exit();cov_1c74kci15l.s[60]++;return;
|
2699 | } else {
|
2700 | cov_1c74kci15l.b[25][1]++;
|
2701 | }cov_1c74kci15l.s[61]++;context.nested = !isArray$1(context.delta);cov_1c74kci15l.s[62]++;if (context.nested) {
|
2702 | cov_1c74kci15l.b[26][0]++;cov_1c74kci15l.s[63]++;return;
|
2703 | } else {
|
2704 | cov_1c74kci15l.b[26][1]++;
|
2705 | }cov_1c74kci15l.s[64]++;if (context.delta.length === 1) {
|
2706 | cov_1c74kci15l.b[27][0]++;cov_1c74kci15l.s[65]++;context.setResult([context.delta[0], 0, 0]).exit();cov_1c74kci15l.s[66]++;return;
|
2707 | } else {
|
2708 | cov_1c74kci15l.b[27][1]++;
|
2709 | }cov_1c74kci15l.s[67]++;if (context.delta.length === 2) {
|
2710 | cov_1c74kci15l.b[28][0]++;cov_1c74kci15l.s[68]++;context.setResult([context.delta[1], context.delta[0]]).exit();cov_1c74kci15l.s[69]++;return;
|
2711 | } else {
|
2712 | cov_1c74kci15l.b[28][1]++;
|
2713 | }cov_1c74kci15l.s[70]++;if ((cov_1c74kci15l.b[30][0]++, context.delta.length === 3) && (cov_1c74kci15l.b[30][1]++, context.delta[2] === 0)) {
|
2714 | cov_1c74kci15l.b[29][0]++;cov_1c74kci15l.s[71]++;context.setResult([context.delta[0]]).exit();
|
2715 | } else {
|
2716 | cov_1c74kci15l.b[29][1]++;
|
2717 | }
|
2718 | };cov_1c74kci15l.s[72]++;reverseFilter.filterName = 'trivial';
|
2719 |
|
2720 | var cov_14lky13xfg = function () {
|
2721 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/nested.js',
|
2722 | hash = 'eb2d12068ad3836a566899c7905a81f33404efa3',
|
2723 | global = new Function('return this')(),
|
2724 | gcv = '__coverage__',
|
2725 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/nested.js', statementMap: { '0': { start: { line: 6, column: 2 }, end: { line: 8, column: 3 } }, '1': { start: { line: 7, column: 4 }, end: { line: 7, column: 11 } }, '2': { start: { line: 9, column: 15 }, end: { line: 9, column: 38 } }, '3': { start: { line: 10, column: 14 }, end: { line: 10, column: 20 } }, '4': { start: { line: 11, column: 15 }, end: { line: 11, column: 29 } }, '5': { start: { line: 12, column: 2 }, end: { line: 19, column: 3 } }, '6': { start: { line: 13, column: 4 }, end: { line: 13, column: 36 } }, '7': { start: { line: 14, column: 4 }, end: { line: 16, column: 5 } }, '8': { start: { line: 15, column: 6 }, end: { line: 15, column: 15 } }, '9': { start: { line: 17, column: 4 }, end: { line: 17, column: 26 } }, '10': { start: { line: 18, column: 4 }, end: { line: 18, column: 43 } }, '11': { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, '12': { start: { line: 21, column: 4 }, end: { line: 21, column: 20 } }, '13': { start: { line: 23, column: 2 }, end: { line: 23, column: 35 } }, '14': { start: { line: 25, column: 0 }, end: { line: 25, column: 57 } }, '15': { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, '16': { start: { line: 29, column: 4 }, end: { line: 29, column: 11 } }, '17': { start: { line: 32, column: 13 }, end: { line: 32, column: 19 } }, '18': { start: { line: 33, column: 14 }, end: { line: 33, column: 20 } }, '19': { start: { line: 34, column: 23 }, end: { line: 34, column: 53 } }, '20': { start: { line: 35, column: 2 }, end: { line: 44, column: 3 } }, '21': { start: { line: 36, column: 4 }, end: { line: 38, column: 5 } }, '22': { start: { line: 37, column: 6 }, end: { line: 37, column: 15 } }, '23': { start: { line: 39, column: 4 }, end: { line: 41, column: 5 } }, '24': { start: { line: 40, column: 6 }, end: { line: 40, column: 15 } }, '25': { start: { line: 42, column: 4 }, end: { line: 42, column: 69 } }, '26': { start: { line: 43, column: 4 }, end: { line: 43, column: 30 } }, '27': { start: { line: 45, column: 2 }, end: { line: 56, column: 3 } }, '28': { start: { line: 46, column: 4 }, end: { line: 48, column: 5 } }, '29': { start: { line: 47, column: 6 }, end: { line: 47, column: 15 } }, '30': { start: { line: 49, column: 4 }, end: { line: 51, column: 5 } }, '31': { start: { line: 50, column: 6 }, end: { line: 50, column: 15 } }, '32': { start: { line: 52, column: 4 }, end: { line: 55, column: 5 } }, '33': { start: { line: 53, column: 6 }, end: { line: 53, column: 62 } }, '34': { start: { line: 54, column: 6 }, end: { line: 54, column: 32 } }, '35': { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, '36': { start: { line: 59, column: 4 }, end: { line: 59, column: 40 } }, '37': { start: { line: 60, column: 4 }, end: { line: 60, column: 11 } }, '38': { start: { line: 62, column: 2 }, end: { line: 62, column: 17 } }, '39': { start: { line: 64, column: 0 }, end: { line: 64, column: 41 } }, '40': { start: { line: 66, column: 25 }, end: { line: 80, column: 1 } }, '41': { start: { line: 67, column: 2 }, end: { line: 69, column: 3 } }, '42': { start: { line: 68, column: 4 }, end: { line: 68, column: 11 } }, '43': { start: { line: 70, column: 2 }, end: { line: 72, column: 3 } }, '44': { start: { line: 71, column: 4 }, end: { line: 71, column: 11 } }, '45': { start: { line: 73, column: 13 }, end: { line: 73, column: 19 } }, '46': { start: { line: 74, column: 14 }, end: { line: 74, column: 20 } }, '47': { start: { line: 75, column: 2 }, end: { line: 78, column: 3 } }, '48': { start: { line: 76, column: 4 }, end: { line: 76, column: 70 } }, '49': { start: { line: 77, column: 4 }, end: { line: 77, column: 30 } }, '50': { start: { line: 79, column: 2 }, end: { line: 79, column: 17 } }, '51': { start: { line: 81, column: 0 }, end: { line: 81, column: 35 } }, '52': { start: { line: 83, column: 40 }, end: { line: 101, column: 1 } }, '53': { start: { line: 84, column: 2 }, end: { line: 86, column: 3 } }, '54': { start: { line: 85, column: 4 }, end: { line: 85, column: 11 } }, '55': { start: { line: 87, column: 2 }, end: { line: 89, column: 3 } }, '56': { start: { line: 88, column: 4 }, end: { line: 88, column: 11 } }, '57': { start: { line: 90, column: 15 }, end: { line: 90, column: 38 } }, '58': { start: { line: 91, column: 14 }, end: { line: 91, column: 20 } }, '59': { start: { line: 92, column: 2 }, end: { line: 99, column: 3 } }, '60': { start: { line: 93, column: 4 }, end: { line: 93, column: 36 } }, '61': { start: { line: 94, column: 4 }, end: { line: 98, column: 5 } }, '62': { start: { line: 95, column: 6 }, end: { line: 95, column: 43 } }, '63': { start: { line: 96, column: 11 }, end: { line: 98, column: 5 } }, '64': { start: { line: 97, column: 6 }, end: { line: 97, column: 51 } }, '65': { start: { line: 100, column: 2 }, end: { line: 100, column: 41 } }, '66': { start: { line: 102, column: 0 }, end: { line: 102, column: 58 } }, '67': { start: { line: 104, column: 27 }, end: { line: 118, column: 1 } }, '68': { start: { line: 105, column: 2 }, end: { line: 107, column: 3 } }, '69': { start: { line: 106, column: 4 }, end: { line: 106, column: 11 } }, '70': { start: { line: 108, column: 2 }, end: { line: 110, column: 3 } }, '71': { start: { line: 109, column: 4 }, end: { line: 109, column: 11 } }, '72': { start: { line: 111, column: 13 }, end: { line: 111, column: 19 } }, '73': { start: { line: 112, column: 14 }, end: { line: 112, column: 20 } }, '74': { start: { line: 113, column: 2 }, end: { line: 116, column: 3 } }, '75': { start: { line: 114, column: 4 }, end: { line: 114, column: 52 } }, '76': { start: { line: 115, column: 4 }, end: { line: 115, column: 30 } }, '77': { start: { line: 117, column: 2 }, end: { line: 117, column: 17 } }, '78': { start: { line: 119, column: 0 }, end: { line: 119, column: 37 } }, '79': { start: { line: 122, column: 2 }, end: { line: 124, column: 3 } }, '80': { start: { line: 123, column: 4 }, end: { line: 123, column: 11 } }, '81': { start: { line: 125, column: 2 }, end: { line: 127, column: 3 } }, '82': { start: { line: 126, column: 4 }, end: { line: 126, column: 11 } }, '83': { start: { line: 128, column: 15 }, end: { line: 128, column: 38 } }, '84': { start: { line: 129, column: 14 }, end: { line: 129, column: 20 } }, '85': { start: { line: 130, column: 14 }, end: { line: 130, column: 16 } }, '86': { start: { line: 131, column: 2 }, end: { line: 136, column: 3 } }, '87': { start: { line: 132, column: 4 }, end: { line: 132, column: 36 } }, '88': { start: { line: 133, column: 4 }, end: { line: 135, column: 5 } }, '89': { start: { line: 134, column: 6 }, end: { line: 134, column: 44 } }, '90': { start: { line: 137, column: 2 }, end: { line: 137, column: 34 } }, '91': { start: { line: 139, column: 0 }, end: { line: 139, column: 60 } } }, fnMap: { '0': { name: 'collectChildrenDiffFilter', decl: { start: { line: 5, column: 16 }, end: { line: 5, column: 41 } }, loc: { start: { line: 5, column: 51 }, end: { line: 24, column: 1 } }, line: 5 }, '1': { name: 'objectsDiffFilter', decl: { start: { line: 27, column: 16 }, end: { line: 27, column: 33 } }, loc: { start: { line: 27, column: 43 }, end: { line: 63, column: 1 } }, line: 27 }, '2': { name: 'nestedPatchFilter', decl: { start: { line: 66, column: 34 }, end: { line: 66, column: 51 } }, loc: { start: { line: 66, column: 61 }, end: { line: 80, column: 1 } }, line: 66 }, '3': { name: 'collectChildrenPatchFilter', decl: { start: { line: 83, column: 49 }, end: { line: 83, column: 75 } }, loc: { start: { line: 83, column: 85 }, end: { line: 101, column: 1 } }, line: 83 }, '4': { name: 'nestedReverseFilter', decl: { start: { line: 104, column: 36 }, end: { line: 104, column: 55 } }, loc: { start: { line: 104, column: 65 }, end: { line: 118, column: 1 } }, line: 104 }, '5': { name: 'collectChildrenReverseFilter', decl: { start: { line: 121, column: 16 }, end: { line: 121, column: 44 } }, loc: { start: { line: 121, column: 54 }, end: { line: 138, column: 1 } }, line: 121 } }, branchMap: { '0': { loc: { start: { line: 6, column: 2 }, end: { line: 8, column: 3 } }, type: 'if', locations: [{ start: { line: 6, column: 2 }, end: { line: 8, column: 3 } }, { start: { line: 6, column: 2 }, end: { line: 8, column: 3 } }], line: 6 }, '1': { loc: { start: { line: 6, column: 6 }, end: { line: 6, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 6, column: 6 }, end: { line: 6, column: 14 } }, { start: { line: 6, column: 18 }, end: { line: 6, column: 35 } }], line: 6 }, '2': { loc: { start: { line: 14, column: 4 }, end: { line: 16, column: 5 } }, type: 'if', locations: [{ start: { line: 14, column: 4 }, end: { line: 16, column: 5 } }, { start: { line: 14, column: 4 }, end: { line: 16, column: 5 } }], line: 14 }, '3': { loc: { start: { line: 17, column: 13 }, end: { line: 17, column: 25 } }, type: 'binary-expr', locations: [{ start: { line: 17, column: 13 }, end: { line: 17, column: 19 } }, { start: { line: 17, column: 23 }, end: { line: 17, column: 25 } }], line: 17 }, '4': { loc: { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, type: 'if', locations: [{ start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }, { start: { line: 20, column: 2 }, end: { line: 22, column: 3 } }], line: 20 }, '5': { loc: { start: { line: 20, column: 6 }, end: { line: 20, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 20, column: 6 }, end: { line: 20, column: 12 } }, { start: { line: 20, column: 16 }, end: { line: 20, column: 35 } }], line: 20 }, '6': { loc: { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, type: 'if', locations: [{ start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }], line: 28 }, '7': { loc: { start: { line: 28, column: 6 }, end: { line: 28, column: 58 } }, type: 'binary-expr', locations: [{ start: { line: 28, column: 6 }, end: { line: 28, column: 25 } }, { start: { line: 28, column: 29 }, end: { line: 28, column: 58 } }], line: 28 }, '8': { loc: { start: { line: 36, column: 4 }, end: { line: 38, column: 5 } }, type: 'if', locations: [{ start: { line: 36, column: 4 }, end: { line: 38, column: 5 } }, { start: { line: 36, column: 4 }, end: { line: 38, column: 5 } }], line: 36 }, '9': { loc: { start: { line: 39, column: 4 }, end: { line: 41, column: 5 } }, type: 'if', locations: [{ start: { line: 39, column: 4 }, end: { line: 41, column: 5 } }, { start: { line: 39, column: 4 }, end: { line: 41, column: 5 } }], line: 39 }, '10': { loc: { start: { line: 39, column: 8 }, end: { line: 39, column: 56 } }, type: 'binary-expr', locations: [{ start: { line: 39, column: 8 }, end: { line: 39, column: 22 } }, { start: { line: 39, column: 26 }, end: { line: 39, column: 56 } }], line: 39 }, '11': { loc: { start: { line: 46, column: 4 }, end: { line: 48, column: 5 } }, type: 'if', locations: [{ start: { line: 46, column: 4 }, end: { line: 48, column: 5 } }, { start: { line: 46, column: 4 }, end: { line: 48, column: 5 } }], line: 46 }, '12': { loc: { start: { line: 49, column: 4 }, end: { line: 51, column: 5 } }, type: 'if', locations: [{ start: { line: 49, column: 4 }, end: { line: 51, column: 5 } }, { start: { line: 49, column: 4 }, end: { line: 51, column: 5 } }], line: 49 }, '13': { loc: { start: { line: 49, column: 8 }, end: { line: 49, column: 56 } }, type: 'binary-expr', locations: [{ start: { line: 49, column: 8 }, end: { line: 49, column: 22 } }, { start: { line: 49, column: 26 }, end: { line: 49, column: 56 } }], line: 49 }, '14': { loc: { start: { line: 52, column: 4 }, end: { line: 55, column: 5 } }, type: 'if', locations: [{ start: { line: 52, column: 4 }, end: { line: 55, column: 5 } }, { start: { line: 52, column: 4 }, end: { line: 55, column: 5 } }], line: 52 }, '15': { loc: { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, type: 'if', locations: [{ start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }], line: 58 }, '16': { loc: { start: { line: 58, column: 6 }, end: { line: 58, column: 56 } }, type: 'binary-expr', locations: [{ start: { line: 58, column: 6 }, end: { line: 58, column: 23 } }, { start: { line: 58, column: 27 }, end: { line: 58, column: 56 } }], line: 58 }, '17': { loc: { start: { line: 67, column: 2 }, end: { line: 69, column: 3 } }, type: 'if', locations: [{ start: { line: 67, column: 2 }, end: { line: 69, column: 3 } }, { start: { line: 67, column: 2 }, end: { line: 69, column: 3 } }], line: 67 }, '18': { loc: { start: { line: 70, column: 2 }, end: { line: 72, column: 3 } }, type: 'if', locations: [{ start: { line: 70, column: 2 }, end: { line: 72, column: 3 } }, { start: { line: 70, column: 2 }, end: { line: 72, column: 3 } }], line: 70 }, '19': { loc: { start: { line: 84, column: 2 }, end: { line: 86, column: 3 } }, type: 'if', locations: [{ start: { line: 84, column: 2 }, end: { line: 86, column: 3 } }, { start: { line: 84, column: 2 }, end: { line: 86, column: 3 } }], line: 84 }, '20': { loc: { start: { line: 84, column: 6 }, end: { line: 84, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 84, column: 6 }, end: { line: 84, column: 14 } }, { start: { line: 84, column: 18 }, end: { line: 84, column: 35 } }], line: 84 }, '21': { loc: { start: { line: 87, column: 2 }, end: { line: 89, column: 3 } }, type: 'if', locations: [{ start: { line: 87, column: 2 }, end: { line: 89, column: 3 } }, { start: { line: 87, column: 2 }, end: { line: 89, column: 3 } }], line: 87 }, '22': { loc: { start: { line: 94, column: 4 }, end: { line: 98, column: 5 } }, type: 'if', locations: [{ start: { line: 94, column: 4 }, end: { line: 98, column: 5 } }, { start: { line: 94, column: 4 }, end: { line: 98, column: 5 } }], line: 94 }, '23': { loc: { start: { line: 94, column: 8 }, end: { line: 94, column: 105 } }, type: 'binary-expr', locations: [{ start: { line: 94, column: 8 }, end: { line: 94, column: 75 } }, { start: { line: 94, column: 79 }, end: { line: 94, column: 105 } }], line: 94 }, '24': { loc: { start: { line: 96, column: 11 }, end: { line: 98, column: 5 } }, type: 'if', locations: [{ start: { line: 96, column: 11 }, end: { line: 98, column: 5 } }, { start: { line: 96, column: 11 }, end: { line: 98, column: 5 } }], line: 96 }, '25': { loc: { start: { line: 105, column: 2 }, end: { line: 107, column: 3 } }, type: 'if', locations: [{ start: { line: 105, column: 2 }, end: { line: 107, column: 3 } }, { start: { line: 105, column: 2 }, end: { line: 107, column: 3 } }], line: 105 }, '26': { loc: { start: { line: 108, column: 2 }, end: { line: 110, column: 3 } }, type: 'if', locations: [{ start: { line: 108, column: 2 }, end: { line: 110, column: 3 } }, { start: { line: 108, column: 2 }, end: { line: 110, column: 3 } }], line: 108 }, '27': { loc: { start: { line: 122, column: 2 }, end: { line: 124, column: 3 } }, type: 'if', locations: [{ start: { line: 122, column: 2 }, end: { line: 124, column: 3 } }, { start: { line: 122, column: 2 }, end: { line: 124, column: 3 } }], line: 122 }, '28': { loc: { start: { line: 122, column: 6 }, end: { line: 122, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 122, column: 6 }, end: { line: 122, column: 14 } }, { start: { line: 122, column: 18 }, end: { line: 122, column: 35 } }], line: 122 }, '29': { loc: { start: { line: 125, column: 2 }, end: { line: 127, column: 3 } }, type: 'if', locations: [{ start: { line: 125, column: 2 }, end: { line: 127, column: 3 } }, { start: { line: 125, column: 2 }, end: { line: 127, column: 3 } }], line: 125 }, '30': { loc: { start: { line: 133, column: 4 }, end: { line: 135, column: 5 } }, type: 'if', locations: [{ start: { line: 133, column: 4 }, end: { line: 135, column: 5 } }, { start: { line: 133, column: 4 }, end: { line: 135, column: 5 } }], line: 133 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0], '22': [0, 0], '23': [0, 0], '24': [0, 0], '25': [0, 0], '26': [0, 0], '27': [0, 0], '28': [0, 0], '29': [0, 0], '30': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2726 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2727 | return coverage[path];
|
2728 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2729 | }();function collectChildrenDiffFilter(context) {
|
2730 | cov_14lky13xfg.f[0]++;cov_14lky13xfg.s[0]++;if ((cov_14lky13xfg.b[1][0]++, !context) || (cov_14lky13xfg.b[1][1]++, !context.children)) {
|
2731 | cov_14lky13xfg.b[0][0]++;cov_14lky13xfg.s[1]++;return;
|
2732 | } else {
|
2733 | cov_14lky13xfg.b[0][1]++;
|
2734 | }var length = (cov_14lky13xfg.s[2]++, context.children.length);var child = (cov_14lky13xfg.s[3]++, void 0);var result = (cov_14lky13xfg.s[4]++, context.result);cov_14lky13xfg.s[5]++;for (var index = 0; index < length; index++) {
|
2735 | cov_14lky13xfg.s[6]++;child = context.children[index];cov_14lky13xfg.s[7]++;if (typeof child.result === 'undefined') {
|
2736 | cov_14lky13xfg.b[2][0]++;cov_14lky13xfg.s[8]++;continue;
|
2737 | } else {
|
2738 | cov_14lky13xfg.b[2][1]++;
|
2739 | }cov_14lky13xfg.s[9]++;result = (cov_14lky13xfg.b[3][0]++, result) || (cov_14lky13xfg.b[3][1]++, {});cov_14lky13xfg.s[10]++;result[child.childName] = child.result;
|
2740 | }cov_14lky13xfg.s[11]++;if ((cov_14lky13xfg.b[5][0]++, result) && (cov_14lky13xfg.b[5][1]++, context.leftIsArray)) {
|
2741 | cov_14lky13xfg.b[4][0]++;cov_14lky13xfg.s[12]++;result._t = 'a';
|
2742 | } else {
|
2743 | cov_14lky13xfg.b[4][1]++;
|
2744 | }cov_14lky13xfg.s[13]++;context.setResult(result).exit();
|
2745 | }cov_14lky13xfg.s[14]++;collectChildrenDiffFilter.filterName = 'collectChildren';function objectsDiffFilter(context) {
|
2746 | cov_14lky13xfg.f[1]++;cov_14lky13xfg.s[15]++;if ((cov_14lky13xfg.b[7][0]++, context.leftIsArray) || (cov_14lky13xfg.b[7][1]++, context.leftType !== 'object')) {
|
2747 | cov_14lky13xfg.b[6][0]++;cov_14lky13xfg.s[16]++;return;
|
2748 | } else {
|
2749 | cov_14lky13xfg.b[6][1]++;
|
2750 | }var name = (cov_14lky13xfg.s[17]++, void 0);var child = (cov_14lky13xfg.s[18]++, void 0);var propertyFilter = (cov_14lky13xfg.s[19]++, context.options.propertyFilter);cov_14lky13xfg.s[20]++;for (name in context.left) {
|
2751 | cov_14lky13xfg.s[21]++;if (!Object.prototype.hasOwnProperty.call(context.left, name)) {
|
2752 | cov_14lky13xfg.b[8][0]++;cov_14lky13xfg.s[22]++;continue;
|
2753 | } else {
|
2754 | cov_14lky13xfg.b[8][1]++;
|
2755 | }cov_14lky13xfg.s[23]++;if ((cov_14lky13xfg.b[10][0]++, propertyFilter) && (cov_14lky13xfg.b[10][1]++, !propertyFilter(name, context))) {
|
2756 | cov_14lky13xfg.b[9][0]++;cov_14lky13xfg.s[24]++;continue;
|
2757 | } else {
|
2758 | cov_14lky13xfg.b[9][1]++;
|
2759 | }cov_14lky13xfg.s[25]++;child = new DiffContext(context.left[name], context.right[name]);cov_14lky13xfg.s[26]++;context.push(child, name);
|
2760 | }cov_14lky13xfg.s[27]++;for (name in context.right) {
|
2761 | cov_14lky13xfg.s[28]++;if (!Object.prototype.hasOwnProperty.call(context.right, name)) {
|
2762 | cov_14lky13xfg.b[11][0]++;cov_14lky13xfg.s[29]++;continue;
|
2763 | } else {
|
2764 | cov_14lky13xfg.b[11][1]++;
|
2765 | }cov_14lky13xfg.s[30]++;if ((cov_14lky13xfg.b[13][0]++, propertyFilter) && (cov_14lky13xfg.b[13][1]++, !propertyFilter(name, context))) {
|
2766 | cov_14lky13xfg.b[12][0]++;cov_14lky13xfg.s[31]++;continue;
|
2767 | } else {
|
2768 | cov_14lky13xfg.b[12][1]++;
|
2769 | }cov_14lky13xfg.s[32]++;if (typeof context.left[name] === 'undefined') {
|
2770 | cov_14lky13xfg.b[14][0]++;cov_14lky13xfg.s[33]++;child = new DiffContext(undefined, context.right[name]);cov_14lky13xfg.s[34]++;context.push(child, name);
|
2771 | } else {
|
2772 | cov_14lky13xfg.b[14][1]++;
|
2773 | }
|
2774 | }cov_14lky13xfg.s[35]++;if ((cov_14lky13xfg.b[16][0]++, !context.children) || (cov_14lky13xfg.b[16][1]++, context.children.length === 0)) {
|
2775 | cov_14lky13xfg.b[15][0]++;cov_14lky13xfg.s[36]++;context.setResult(undefined).exit();cov_14lky13xfg.s[37]++;return;
|
2776 | } else {
|
2777 | cov_14lky13xfg.b[15][1]++;
|
2778 | }cov_14lky13xfg.s[38]++;context.exit();
|
2779 | }cov_14lky13xfg.s[39]++;objectsDiffFilter.filterName = 'objects';cov_14lky13xfg.s[40]++;var patchFilter$1 = function nestedPatchFilter(context) {
|
2780 | cov_14lky13xfg.f[2]++;cov_14lky13xfg.s[41]++;if (!context.nested) {
|
2781 | cov_14lky13xfg.b[17][0]++;cov_14lky13xfg.s[42]++;return;
|
2782 | } else {
|
2783 | cov_14lky13xfg.b[17][1]++;
|
2784 | }cov_14lky13xfg.s[43]++;if (context.delta._t) {
|
2785 | cov_14lky13xfg.b[18][0]++;cov_14lky13xfg.s[44]++;return;
|
2786 | } else {
|
2787 | cov_14lky13xfg.b[18][1]++;
|
2788 | }var name = (cov_14lky13xfg.s[45]++, void 0);var child = (cov_14lky13xfg.s[46]++, void 0);cov_14lky13xfg.s[47]++;for (name in context.delta) {
|
2789 | cov_14lky13xfg.s[48]++;child = new PatchContext(context.left[name], context.delta[name]);cov_14lky13xfg.s[49]++;context.push(child, name);
|
2790 | }cov_14lky13xfg.s[50]++;context.exit();
|
2791 | };cov_14lky13xfg.s[51]++;patchFilter$1.filterName = 'objects';cov_14lky13xfg.s[52]++;var collectChildrenPatchFilter = function collectChildrenPatchFilter(context) {
|
2792 | cov_14lky13xfg.f[3]++;cov_14lky13xfg.s[53]++;if ((cov_14lky13xfg.b[20][0]++, !context) || (cov_14lky13xfg.b[20][1]++, !context.children)) {
|
2793 | cov_14lky13xfg.b[19][0]++;cov_14lky13xfg.s[54]++;return;
|
2794 | } else {
|
2795 | cov_14lky13xfg.b[19][1]++;
|
2796 | }cov_14lky13xfg.s[55]++;if (context.delta._t) {
|
2797 | cov_14lky13xfg.b[21][0]++;cov_14lky13xfg.s[56]++;return;
|
2798 | } else {
|
2799 | cov_14lky13xfg.b[21][1]++;
|
2800 | }var length = (cov_14lky13xfg.s[57]++, context.children.length);var child = (cov_14lky13xfg.s[58]++, void 0);cov_14lky13xfg.s[59]++;for (var index = 0; index < length; index++) {
|
2801 | cov_14lky13xfg.s[60]++;child = context.children[index];cov_14lky13xfg.s[61]++;if ((cov_14lky13xfg.b[23][0]++, Object.prototype.hasOwnProperty.call(context.left, child.childName)) && (cov_14lky13xfg.b[23][1]++, child.result === undefined)) {
|
2802 | cov_14lky13xfg.b[22][0]++;cov_14lky13xfg.s[62]++;delete context.left[child.childName];
|
2803 | } else {
|
2804 | cov_14lky13xfg.b[22][1]++;cov_14lky13xfg.s[63]++;if (context.left[child.childName] !== child.result) {
|
2805 | cov_14lky13xfg.b[24][0]++;cov_14lky13xfg.s[64]++;context.left[child.childName] = child.result;
|
2806 | } else {
|
2807 | cov_14lky13xfg.b[24][1]++;
|
2808 | }
|
2809 | }
|
2810 | }cov_14lky13xfg.s[65]++;context.setResult(context.left).exit();
|
2811 | };cov_14lky13xfg.s[66]++;collectChildrenPatchFilter.filterName = 'collectChildren';cov_14lky13xfg.s[67]++;var reverseFilter$1 = function nestedReverseFilter(context) {
|
2812 | cov_14lky13xfg.f[4]++;cov_14lky13xfg.s[68]++;if (!context.nested) {
|
2813 | cov_14lky13xfg.b[25][0]++;cov_14lky13xfg.s[69]++;return;
|
2814 | } else {
|
2815 | cov_14lky13xfg.b[25][1]++;
|
2816 | }cov_14lky13xfg.s[70]++;if (context.delta._t) {
|
2817 | cov_14lky13xfg.b[26][0]++;cov_14lky13xfg.s[71]++;return;
|
2818 | } else {
|
2819 | cov_14lky13xfg.b[26][1]++;
|
2820 | }var name = (cov_14lky13xfg.s[72]++, void 0);var child = (cov_14lky13xfg.s[73]++, void 0);cov_14lky13xfg.s[74]++;for (name in context.delta) {
|
2821 | cov_14lky13xfg.s[75]++;child = new ReverseContext(context.delta[name]);cov_14lky13xfg.s[76]++;context.push(child, name);
|
2822 | }cov_14lky13xfg.s[77]++;context.exit();
|
2823 | };cov_14lky13xfg.s[78]++;reverseFilter$1.filterName = 'objects';function collectChildrenReverseFilter(context) {
|
2824 | cov_14lky13xfg.f[5]++;cov_14lky13xfg.s[79]++;if ((cov_14lky13xfg.b[28][0]++, !context) || (cov_14lky13xfg.b[28][1]++, !context.children)) {
|
2825 | cov_14lky13xfg.b[27][0]++;cov_14lky13xfg.s[80]++;return;
|
2826 | } else {
|
2827 | cov_14lky13xfg.b[27][1]++;
|
2828 | }cov_14lky13xfg.s[81]++;if (context.delta._t) {
|
2829 | cov_14lky13xfg.b[29][0]++;cov_14lky13xfg.s[82]++;return;
|
2830 | } else {
|
2831 | cov_14lky13xfg.b[29][1]++;
|
2832 | }var length = (cov_14lky13xfg.s[83]++, context.children.length);var child = (cov_14lky13xfg.s[84]++, void 0);var delta = (cov_14lky13xfg.s[85]++, {});cov_14lky13xfg.s[86]++;for (var index = 0; index < length; index++) {
|
2833 | cov_14lky13xfg.s[87]++;child = context.children[index];cov_14lky13xfg.s[88]++;if (delta[child.childName] !== child.result) {
|
2834 | cov_14lky13xfg.b[30][0]++;cov_14lky13xfg.s[89]++;delta[child.childName] = child.result;
|
2835 | } else {
|
2836 | cov_14lky13xfg.b[30][1]++;
|
2837 | }
|
2838 | }cov_14lky13xfg.s[90]++;context.setResult(delta).exit();
|
2839 | }cov_14lky13xfg.s[91]++;collectChildrenReverseFilter.filterName = 'collectChildren';
|
2840 |
|
2841 | var cov_i0rcratvd = function () {
|
2842 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/lcs.js',
|
2843 | hash = '0a025babc40e5e4f97d1b86f1987ef7201496109',
|
2844 | global = new Function('return this')(),
|
2845 | gcv = '__coverage__',
|
2846 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/lcs.js', statementMap: { '0': { start: { line: 9, column: 19 }, end: { line: 11, column: 1 } }, '1': { start: { line: 10, column: 2 }, end: { line: 10, column: 43 } }, '2': { start: { line: 13, column: 19 }, end: { line: 39, column: 1 } }, '3': { start: { line: 14, column: 13 }, end: { line: 14, column: 26 } }, '4': { start: { line: 15, column: 13 }, end: { line: 15, column: 26 } }, '5': { start: { line: 16, column: 10 }, end: { line: 16, column: 16 } }, '6': { start: { line: 17, column: 10 }, end: { line: 17, column: 16 } }, '7': { start: { line: 20, column: 15 }, end: { line: 20, column: 25 } }, '8': { start: { line: 21, column: 2 }, end: { line: 26, column: 3 } }, '9': { start: { line: 22, column: 4 }, end: { line: 22, column: 27 } }, '10': { start: { line: 23, column: 4 }, end: { line: 25, column: 5 } }, '11': { start: { line: 24, column: 6 }, end: { line: 24, column: 23 } }, '12': { start: { line: 27, column: 2 }, end: { line: 27, column: 23 } }, '13': { start: { line: 29, column: 2 }, end: { line: 37, column: 3 } }, '14': { start: { line: 30, column: 4 }, end: { line: 36, column: 5 } }, '15': { start: { line: 31, column: 6 }, end: { line: 35, column: 7 } }, '16': { start: { line: 32, column: 8 }, end: { line: 32, column: 48 } }, '17': { start: { line: 34, column: 8 }, end: { line: 34, column: 68 } }, '18': { start: { line: 38, column: 2 }, end: { line: 38, column: 16 } }, '19': { start: { line: 41, column: 16 }, end: { line: 63, column: 1 } }, '20': { start: { line: 42, column: 2 }, end: { line: 48, column: 3 } }, '21': { start: { line: 43, column: 4 }, end: { line: 47, column: 6 } }, '22': { start: { line: 50, column: 2 }, end: { line: 56, column: 3 } }, '23': { start: { line: 51, column: 22 }, end: { line: 51, column: 88 } }, '24': { start: { line: 52, column: 4 }, end: { line: 52, column: 50 } }, '25': { start: { line: 53, column: 4 }, end: { line: 53, column: 42 } }, '26': { start: { line: 54, column: 4 }, end: { line: 54, column: 42 } }, '27': { start: { line: 55, column: 4 }, end: { line: 55, column: 23 } }, '28': { start: { line: 58, column: 2 }, end: { line: 62, column: 3 } }, '29': { start: { line: 59, column: 4 }, end: { line: 59, column: 74 } }, '30': { start: { line: 61, column: 4 }, end: { line: 61, column: 74 } }, '31': { start: { line: 65, column: 10 }, end: { line: 73, column: 1 } }, '32': { start: { line: 66, column: 21 }, end: { line: 66, column: 34 } }, '33': { start: { line: 67, column: 15 }, end: { line: 67, column: 80 } }, '34': { start: { line: 68, column: 15 }, end: { line: 68, column: 92 } }, '35': { start: { line: 69, column: 2 }, end: { line: 71, column: 3 } }, '36': { start: { line: 70, column: 4 }, end: { line: 70, column: 47 } }, '37': { start: { line: 72, column: 2 }, end: { line: 72, column: 16 } } }, fnMap: { '0': { name: 'defaultMatch', decl: { start: { line: 9, column: 28 }, end: { line: 9, column: 40 } }, loc: { start: { line: 9, column: 73 }, end: { line: 11, column: 1 } }, line: 9 }, '1': { name: 'lengthMatrix', decl: { start: { line: 13, column: 28 }, end: { line: 13, column: 40 } }, loc: { start: { line: 13, column: 73 }, end: { line: 39, column: 1 } }, line: 13 }, '2': { name: 'backtrack', decl: { start: { line: 41, column: 25 }, end: { line: 41, column: 34 } }, loc: { start: { line: 41, column: 84 }, end: { line: 63, column: 1 } }, line: 41 }, '3': { name: 'get', decl: { start: { line: 65, column: 19 }, end: { line: 65, column: 22 } }, loc: { start: { line: 65, column: 55 }, end: { line: 73, column: 1 } }, line: 65 } }, branchMap: { '0': { loc: { start: { line: 31, column: 6 }, end: { line: 35, column: 7 } }, type: 'if', locations: [{ start: { line: 31, column: 6 }, end: { line: 35, column: 7 } }, { start: { line: 31, column: 6 }, end: { line: 35, column: 7 } }], line: 31 }, '1': { loc: { start: { line: 42, column: 2 }, end: { line: 48, column: 3 } }, type: 'if', locations: [{ start: { line: 42, column: 2 }, end: { line: 48, column: 3 } }, { start: { line: 42, column: 2 }, end: { line: 48, column: 3 } }], line: 42 }, '2': { loc: { start: { line: 42, column: 6 }, end: { line: 42, column: 34 } }, type: 'binary-expr', locations: [{ start: { line: 42, column: 6 }, end: { line: 42, column: 18 } }, { start: { line: 42, column: 22 }, end: { line: 42, column: 34 } }], line: 42 }, '3': { loc: { start: { line: 50, column: 2 }, end: { line: 56, column: 3 } }, type: 'if', locations: [{ start: { line: 50, column: 2 }, end: { line: 56, column: 3 } }, { start: { line: 50, column: 2 }, end: { line: 56, column: 3 } }], line: 50 }, '4': { loc: { start: { line: 58, column: 2 }, end: { line: 62, column: 3 } }, type: 'if', locations: [{ start: { line: 58, column: 2 }, end: { line: 62, column: 3 } }, { start: { line: 58, column: 2 }, end: { line: 62, column: 3 } }], line: 58 }, '5': { loc: { start: { line: 66, column: 21 }, end: { line: 66, column: 34 } }, type: 'binary-expr', locations: [{ start: { line: 66, column: 21 }, end: { line: 66, column: 28 } }, { start: { line: 66, column: 32 }, end: { line: 66, column: 34 } }], line: 66 }, '6': { loc: { start: { line: 67, column: 44 }, end: { line: 67, column: 65 } }, type: 'binary-expr', locations: [{ start: { line: 67, column: 44 }, end: { line: 67, column: 49 } }, { start: { line: 67, column: 53 }, end: { line: 67, column: 65 } }], line: 67 }, '7': { loc: { start: { line: 69, column: 2 }, end: { line: 71, column: 3 } }, type: 'if', locations: [{ start: { line: 69, column: 2 }, end: { line: 71, column: 3 } }, { start: { line: 69, column: 2 }, end: { line: 71, column: 3 } }], line: 69 }, '8': { loc: { start: { line: 69, column: 6 }, end: { line: 69, column: 62 } }, type: 'binary-expr', locations: [{ start: { line: 69, column: 6 }, end: { line: 69, column: 32 } }, { start: { line: 69, column: 36 }, end: { line: 69, column: 62 } }], line: 69 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2847 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2848 | return coverage[path];
|
2849 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2850 | }();cov_i0rcratvd.s[0]++; |
2851 |
|
2852 |
|
2853 | var defaultMatch = function defaultMatch(array1, array2, index1, index2) {
|
2854 | cov_i0rcratvd.f[0]++;cov_i0rcratvd.s[1]++;return array1[index1] === array2[index2];
|
2855 | };cov_i0rcratvd.s[2]++;var lengthMatrix = function lengthMatrix(array1, array2, match, context) {
|
2856 | cov_i0rcratvd.f[1]++;var len1 = (cov_i0rcratvd.s[3]++, array1.length);var len2 = (cov_i0rcratvd.s[4]++, array2.length);var x = (cov_i0rcratvd.s[5]++, void 0),
|
2857 | y = (cov_i0rcratvd.s[6]++, void 0);
|
2858 | var matrix = (cov_i0rcratvd.s[7]++, [len1 + 1]);cov_i0rcratvd.s[8]++;for (x = 0; x < len1 + 1; x++) {
|
2859 | cov_i0rcratvd.s[9]++;matrix[x] = [len2 + 1];cov_i0rcratvd.s[10]++;for (y = 0; y < len2 + 1; y++) {
|
2860 | cov_i0rcratvd.s[11]++;matrix[x][y] = 0;
|
2861 | }
|
2862 | }cov_i0rcratvd.s[12]++;matrix.match = match;
|
2863 | cov_i0rcratvd.s[13]++;for (x = 1; x < len1 + 1; x++) {
|
2864 | cov_i0rcratvd.s[14]++;for (y = 1; y < len2 + 1; y++) {
|
2865 | cov_i0rcratvd.s[15]++;if (match(array1, array2, x - 1, y - 1, context)) {
|
2866 | cov_i0rcratvd.b[0][0]++;cov_i0rcratvd.s[16]++;matrix[x][y] = matrix[x - 1][y - 1] + 1;
|
2867 | } else {
|
2868 | cov_i0rcratvd.b[0][1]++;cov_i0rcratvd.s[17]++;matrix[x][y] = Math.max(matrix[x - 1][y], matrix[x][y - 1]);
|
2869 | }
|
2870 | }
|
2871 | }cov_i0rcratvd.s[18]++;return matrix;
|
2872 | };cov_i0rcratvd.s[19]++;var backtrack = function backtrack(matrix, array1, array2, index1, index2, context) {
|
2873 | cov_i0rcratvd.f[2]++;cov_i0rcratvd.s[20]++;if ((cov_i0rcratvd.b[2][0]++, index1 === 0) || (cov_i0rcratvd.b[2][1]++, index2 === 0)) {
|
2874 | cov_i0rcratvd.b[1][0]++;cov_i0rcratvd.s[21]++;return { sequence: [], indices1: [], indices2: [] };
|
2875 | } else {
|
2876 | cov_i0rcratvd.b[1][1]++;
|
2877 | }cov_i0rcratvd.s[22]++;if (matrix.match(array1, array2, index1 - 1, index2 - 1, context)) {
|
2878 | cov_i0rcratvd.b[3][0]++;var subsequence = (cov_i0rcratvd.s[23]++, backtrack(matrix, array1, array2, index1 - 1, index2 - 1, context));cov_i0rcratvd.s[24]++;subsequence.sequence.push(array1[index1 - 1]);cov_i0rcratvd.s[25]++;subsequence.indices1.push(index1 - 1);cov_i0rcratvd.s[26]++;subsequence.indices2.push(index2 - 1);cov_i0rcratvd.s[27]++;return subsequence;
|
2879 | } else {
|
2880 | cov_i0rcratvd.b[3][1]++;
|
2881 | }cov_i0rcratvd.s[28]++;if (matrix[index1][index2 - 1] > matrix[index1 - 1][index2]) {
|
2882 | cov_i0rcratvd.b[4][0]++;cov_i0rcratvd.s[29]++;return backtrack(matrix, array1, array2, index1, index2 - 1, context);
|
2883 | } else {
|
2884 | cov_i0rcratvd.b[4][1]++;cov_i0rcratvd.s[30]++;return backtrack(matrix, array1, array2, index1 - 1, index2, context);
|
2885 | }
|
2886 | };cov_i0rcratvd.s[31]++;var get$1$1 = function get$$1(array1, array2, match, context) {
|
2887 | cov_i0rcratvd.f[3]++;var innerContext = (cov_i0rcratvd.s[32]++, (cov_i0rcratvd.b[5][0]++, context) || (cov_i0rcratvd.b[5][1]++, {}));var matrix = (cov_i0rcratvd.s[33]++, lengthMatrix(array1, array2, (cov_i0rcratvd.b[6][0]++, match) || (cov_i0rcratvd.b[6][1]++, defaultMatch), innerContext));var result = (cov_i0rcratvd.s[34]++, backtrack(matrix, array1, array2, array1.length, array2.length, innerContext));cov_i0rcratvd.s[35]++;if ((cov_i0rcratvd.b[8][0]++, typeof array1 === 'string') && (cov_i0rcratvd.b[8][1]++, typeof array2 === 'string')) {
|
2888 | cov_i0rcratvd.b[7][0]++;cov_i0rcratvd.s[36]++;result.sequence = result.sequence.join('');
|
2889 | } else {
|
2890 | cov_i0rcratvd.b[7][1]++;
|
2891 | }cov_i0rcratvd.s[37]++;return result;
|
2892 | };var lcs = { get: get$1$1 };
|
2893 |
|
2894 | var cov_g15fjodrd = function () {
|
2895 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/arrays.js',
|
2896 | hash = 'a4fb2848fb44c24307acdebe417f136230c14c6f',
|
2897 | global = new Function('return this')(),
|
2898 | gcv = '__coverage__',
|
2899 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/arrays.js', statementMap: { '0': { start: { line: 7, column: 17 }, end: { line: 7, column: 18 } }, '1': { start: { line: 9, column: 14 }, end: { line: 11, column: 1 } }, '2': { start: { line: 10, column: 2 }, end: { line: 10, column: 28 } }, '3': { start: { line: 13, column: 19 }, end: { line: 23, column: 1 } }, '4': { start: { line: 14, column: 2 }, end: { line: 14, column: 29 } }, '5': { start: { line: 16, column: 15 }, end: { line: 16, column: 27 } }, '6': { start: { line: 17, column: 2 }, end: { line: 21, column: 3 } }, '7': { start: { line: 18, column: 4 }, end: { line: 20, column: 5 } }, '8': { start: { line: 19, column: 6 }, end: { line: 19, column: 15 } }, '9': { start: { line: 22, column: 2 }, end: { line: 22, column: 12 } }, '10': { start: { line: 26, column: 2 }, end: { line: 34, column: 3 } }, '11': { start: { line: 27, column: 15 }, end: { line: 27, column: 29 } }, '12': { start: { line: 28, column: 4 }, end: { line: 33, column: 5 } }, '13': { start: { line: 29, column: 17 }, end: { line: 29, column: 31 } }, '14': { start: { line: 30, column: 6 }, end: { line: 32, column: 7 } }, '15': { start: { line: 31, column: 8 }, end: { line: 31, column: 20 } }, '16': { start: { line: 38, column: 15 }, end: { line: 38, column: 29 } }, '17': { start: { line: 39, column: 15 }, end: { line: 39, column: 29 } }, '18': { start: { line: 40, column: 2 }, end: { line: 42, column: 3 } }, '19': { start: { line: 41, column: 4 }, end: { line: 41, column: 16 } }, '20': { start: { line: 43, column: 2 }, end: { line: 45, column: 3 } }, '21': { start: { line: 44, column: 4 }, end: { line: 44, column: 17 } }, '22': { start: { line: 46, column: 19 }, end: { line: 46, column: 37 } }, '23': { start: { line: 47, column: 2 }, end: { line: 50, column: 3 } }, '24': { start: { line: 49, column: 4 }, end: { line: 49, column: 56 } }, '25': { start: { line: 51, column: 14 }, end: { line: 51, column: 20 } }, '26': { start: { line: 52, column: 14 }, end: { line: 52, column: 20 } }, '27': { start: { line: 53, column: 2 }, end: { line: 61, column: 3 } }, '28': { start: { line: 54, column: 4 }, end: { line: 54, column: 50 } }, '29': { start: { line: 55, column: 4 }, end: { line: 55, column: 39 } }, '30': { start: { line: 56, column: 4 }, end: { line: 58, column: 5 } }, '31': { start: { line: 57, column: 6 }, end: { line: 57, column: 70 } }, '32': { start: { line: 60, column: 4 }, end: { line: 60, column: 31 } }, '33': { start: { line: 62, column: 2 }, end: { line: 64, column: 3 } }, '34': { start: { line: 63, column: 4 }, end: { line: 63, column: 17 } }, '35': { start: { line: 65, column: 2 }, end: { line: 73, column: 3 } }, '36': { start: { line: 66, column: 4 }, end: { line: 66, column: 50 } }, '37': { start: { line: 67, column: 4 }, end: { line: 67, column: 39 } }, '38': { start: { line: 68, column: 4 }, end: { line: 70, column: 5 } }, '39': { start: { line: 69, column: 6 }, end: { line: 69, column: 70 } }, '40': { start: { line: 72, column: 4 }, end: { line: 72, column: 31 } }, '41': { start: { line: 74, column: 2 }, end: { line: 76, column: 3 } }, '42': { start: { line: 75, column: 4 }, end: { line: 75, column: 17 } }, '43': { start: { line: 77, column: 2 }, end: { line: 77, column: 25 } }, '44': { start: { line: 80, column: 24 }, end: { line: 217, column: 1 } }, '45': { start: { line: 81, column: 2 }, end: { line: 83, column: 3 } }, '46': { start: { line: 82, column: 4 }, end: { line: 82, column: 11 } }, '47': { start: { line: 85, column: 21 }, end: { line: 88, column: 3 } }, '48': { start: { line: 89, column: 19 }, end: { line: 89, column: 20 } }, '49': { start: { line: 90, column: 19 }, end: { line: 90, column: 20 } }, '50': { start: { line: 91, column: 14 }, end: { line: 91, column: 20 } }, '51': { start: { line: 92, column: 15 }, end: { line: 92, column: 21 } }, '52': { start: { line: 93, column: 15 }, end: { line: 93, column: 21 } }, '53': { start: { line: 94, column: 15 }, end: { line: 94, column: 27 } }, '54': { start: { line: 95, column: 15 }, end: { line: 95, column: 28 } }, '55': { start: { line: 96, column: 13 }, end: { line: 96, column: 26 } }, '56': { start: { line: 97, column: 13 }, end: { line: 97, column: 26 } }, '57': { start: { line: 99, column: 14 }, end: { line: 99, column: 20 } }, '58': { start: { line: 101, column: 2 }, end: { line: 103, column: 3 } }, '59': { start: { line: 102, column: 4 }, end: { line: 102, column: 85 } }, '60': { start: { line: 106, column: 2 }, end: { line: 111, column: 3 } }, '61': { start: { line: 107, column: 4 }, end: { line: 107, column: 23 } }, '62': { start: { line: 108, column: 4 }, end: { line: 108, column: 71 } }, '63': { start: { line: 109, column: 4 }, end: { line: 109, column: 31 } }, '64': { start: { line: 110, column: 4 }, end: { line: 110, column: 17 } }, '65': { start: { line: 113, column: 2 }, end: { line: 119, column: 3 } }, '66': { start: { line: 114, column: 4 }, end: { line: 114, column: 35 } }, '67': { start: { line: 115, column: 4 }, end: { line: 115, column: 35 } }, '68': { start: { line: 116, column: 4 }, end: { line: 116, column: 73 } }, '69': { start: { line: 117, column: 4 }, end: { line: 117, column: 32 } }, '70': { start: { line: 118, column: 4 }, end: { line: 118, column: 17 } }, '71': { start: { line: 120, column: 15 }, end: { line: 120, column: 21 } }, '72': { start: { line: 121, column: 2 }, end: { line: 136, column: 3 } }, '73': { start: { line: 122, column: 4 }, end: { line: 126, column: 5 } }, '74': { start: { line: 124, column: 6 }, end: { line: 124, column: 42 } }, '75': { start: { line: 125, column: 6 }, end: { line: 125, column: 13 } }, '76': { start: { line: 128, column: 4 }, end: { line: 130, column: 6 } }, '77': { start: { line: 131, column: 4 }, end: { line: 133, column: 5 } }, '78': { start: { line: 132, column: 6 }, end: { line: 132, column: 38 } }, '79': { start: { line: 134, column: 4 }, end: { line: 134, column: 37 } }, '80': { start: { line: 135, column: 4 }, end: { line: 135, column: 11 } }, '81': { start: { line: 137, column: 2 }, end: { line: 147, column: 3 } }, '82': { start: { line: 139, column: 4 }, end: { line: 141, column: 6 } }, '83': { start: { line: 142, column: 4 }, end: { line: 144, column: 5 } }, '84': { start: { line: 143, column: 6 }, end: { line: 143, column: 50 } }, '85': { start: { line: 145, column: 4 }, end: { line: 145, column: 37 } }, '86': { start: { line: 146, column: 4 }, end: { line: 146, column: 11 } }, '87': { start: { line: 149, column: 2 }, end: { line: 149, column: 33 } }, '88': { start: { line: 150, column: 2 }, end: { line: 150, column: 33 } }, '89': { start: { line: 153, column: 17 }, end: { line: 153, column: 60 } }, '90': { start: { line: 154, column: 17 }, end: { line: 154, column: 60 } }, '91': { start: { line: 155, column: 12 }, end: { line: 155, column: 65 } }, '92': { start: { line: 156, column: 21 }, end: { line: 156, column: 23 } }, '93': { start: { line: 157, column: 2 }, end: { line: 159, column: 4 } }, '94': { start: { line: 160, column: 2 }, end: { line: 166, column: 3 } }, '95': { start: { line: 161, column: 4 }, end: { line: 165, column: 5 } }, '96': { start: { line: 163, column: 6 }, end: { line: 163, column: 50 } }, '97': { start: { line: 164, column: 6 }, end: { line: 164, column: 31 } }, '98': { start: { line: 168, column: 19 }, end: { line: 168, column: 23 } }, '99': { start: { line: 169, column: 2 }, end: { line: 171, column: 3 } }, '100': { start: { line: 170, column: 4 }, end: { line: 170, column: 23 } }, '101': { start: { line: 172, column: 27 }, end: { line: 172, column: 32 } }, '102': { start: { line: 173, column: 2 }, end: { line: 175, column: 3 } }, '103': { start: { line: 174, column: 4 }, end: { line: 174, column: 30 } }, '104': { start: { line: 177, column: 27 }, end: { line: 177, column: 46 } }, '105': { start: { line: 178, column: 2 }, end: { line: 214, column: 3 } }, '106': { start: { line: 179, column: 24 }, end: { line: 179, column: 70 } }, '107': { start: { line: 180, column: 4 }, end: { line: 213, column: 5 } }, '108': { start: { line: 182, column: 19 }, end: { line: 182, column: 24 } }, '109': { start: { line: 183, column: 6 }, end: { line: 202, column: 7 } }, '110': { start: { line: 184, column: 8 }, end: { line: 201, column: 9 } }, '111': { start: { line: 185, column: 10 }, end: { line: 185, column: 50 } }, '112': { start: { line: 186, column: 10 }, end: { line: 200, column: 11 } }, '113': { start: { line: 188, column: 12 }, end: { line: 188, column: 65 } }, '114': { start: { line: 189, column: 12 }, end: { line: 192, column: 13 } }, '115': { start: { line: 191, column: 14 }, end: { line: 191, column: 43 } }, '116': { start: { line: 194, column: 12 }, end: { line: 194, column: 27 } }, '117': { start: { line: 195, column: 12 }, end: { line: 195, column: 81 } }, '118': { start: { line: 196, column: 12 }, end: { line: 196, column: 40 } }, '119': { start: { line: 197, column: 12 }, end: { line: 197, column: 53 } }, '120': { start: { line: 198, column: 12 }, end: { line: 198, column: 26 } }, '121': { start: { line: 199, column: 12 }, end: { line: 199, column: 18 } }, '122': { start: { line: 203, column: 6 }, end: { line: 206, column: 7 } }, '123': { start: { line: 205, column: 8 }, end: { line: 205, column: 40 } }, '124': { start: { line: 209, column: 6 }, end: { line: 209, column: 56 } }, '125': { start: { line: 210, column: 6 }, end: { line: 210, column: 56 } }, '126': { start: { line: 211, column: 6 }, end: { line: 211, column: 75 } }, '127': { start: { line: 212, column: 6 }, end: { line: 212, column: 34 } }, '128': { start: { line: 216, column: 2 }, end: { line: 216, column: 35 } }, '129': { start: { line: 218, column: 0 }, end: { line: 218, column: 33 } }, '130': { start: { line: 220, column: 14 }, end: { line: 229, column: 1 } }, '131': { start: { line: 222, column: 4 }, end: { line: 222, column: 17 } }, '132': { start: { line: 225, column: 4 }, end: { line: 227, column: 6 } }, '133': { start: { line: 226, column: 6 }, end: { line: 226, column: 31 } }, '134': { start: { line: 231, column: 25 }, end: { line: 314, column: 1 } }, '135': { start: { line: 232, column: 2 }, end: { line: 234, column: 3 } }, '136': { start: { line: 233, column: 4 }, end: { line: 233, column: 11 } }, '137': { start: { line: 235, column: 2 }, end: { line: 237, column: 3 } }, '138': { start: { line: 236, column: 4 }, end: { line: 236, column: 11 } }, '139': { start: { line: 238, column: 14 }, end: { line: 238, column: 20 } }, '140': { start: { line: 239, column: 15 }, end: { line: 239, column: 21 } }, '141': { start: { line: 241, column: 14 }, end: { line: 241, column: 27 } }, '142': { start: { line: 242, column: 14 }, end: { line: 242, column: 26 } }, '143': { start: { line: 245, column: 17 }, end: { line: 245, column: 19 } }, '144': { start: { line: 246, column: 17 }, end: { line: 246, column: 19 } }, '145': { start: { line: 247, column: 17 }, end: { line: 247, column: 19 } }, '146': { start: { line: 248, column: 2 }, end: { line: 273, column: 3 } }, '147': { start: { line: 249, column: 4 }, end: { line: 272, column: 5 } }, '148': { start: { line: 250, column: 6 }, end: { line: 271, column: 7 } }, '149': { start: { line: 252, column: 8 }, end: { line: 256, column: 9 } }, '150': { start: { line: 253, column: 10 }, end: { line: 253, column: 54 } }, '151': { start: { line: 255, column: 10 }, end: { line: 255, column: 137 } }, '152': { start: { line: 258, column: 8 }, end: { line: 270, column: 9 } }, '153': { start: { line: 260, column: 10 }, end: { line: 263, column: 13 } }, '154': { start: { line: 266, column: 10 }, end: { line: 269, column: 13 } }, '155': { start: { line: 276, column: 2 }, end: { line: 276, column: 48 } }, '156': { start: { line: 277, column: 2 }, end: { line: 288, column: 3 } }, '157': { start: { line: 278, column: 4 }, end: { line: 278, column: 29 } }, '158': { start: { line: 279, column: 20 }, end: { line: 279, column: 39 } }, '159': { start: { line: 280, column: 23 }, end: { line: 280, column: 49 } }, '160': { start: { line: 281, column: 4 }, end: { line: 287, column: 5 } }, '161': { start: { line: 283, column: 6 }, end: { line: 286, column: 9 } }, '162': { start: { line: 291, column: 2 }, end: { line: 291, column: 59 } }, '163': { start: { line: 292, column: 23 }, end: { line: 292, column: 38 } }, '164': { start: { line: 293, column: 2 }, end: { line: 296, column: 3 } }, '165': { start: { line: 294, column: 20 }, end: { line: 294, column: 35 } }, '166': { start: { line: 295, column: 4 }, end: { line: 295, column: 54 } }, '167': { start: { line: 299, column: 23 }, end: { line: 299, column: 38 } }, '168': { start: { line: 300, column: 14 }, end: { line: 300, column: 20 } }, '169': { start: { line: 301, column: 2 }, end: { line: 307, column: 3 } }, '170': { start: { line: 302, column: 4 }, end: { line: 306, column: 5 } }, '171': { start: { line: 303, column: 25 }, end: { line: 303, column: 40 } }, '172': { start: { line: 304, column: 6 }, end: { line: 304, column: 85 } }, '173': { start: { line: 305, column: 6 }, end: { line: 305, column: 46 } }, '174': { start: { line: 309, column: 2 }, end: { line: 312, column: 3 } }, '175': { start: { line: 310, column: 4 }, end: { line: 310, column: 43 } }, '176': { start: { line: 311, column: 4 }, end: { line: 311, column: 11 } }, '177': { start: { line: 313, column: 2 }, end: { line: 313, column: 17 } }, '178': { start: { line: 315, column: 0 }, end: { line: 315, column: 34 } }, '179': { start: { line: 317, column: 40 }, end: { line: 331, column: 1 } }, '180': { start: { line: 318, column: 2 }, end: { line: 320, column: 3 } }, '181': { start: { line: 319, column: 4 }, end: { line: 319, column: 11 } }, '182': { start: { line: 321, column: 2 }, end: { line: 323, column: 3 } }, '183': { start: { line: 322, column: 4 }, end: { line: 322, column: 11 } }, '184': { start: { line: 324, column: 15 }, end: { line: 324, column: 38 } }, '185': { start: { line: 325, column: 14 }, end: { line: 325, column: 20 } }, '186': { start: { line: 326, column: 2 }, end: { line: 329, column: 3 } }, '187': { start: { line: 327, column: 4 }, end: { line: 327, column: 36 } }, '188': { start: { line: 328, column: 4 }, end: { line: 328, column: 49 } }, '189': { start: { line: 330, column: 2 }, end: { line: 330, column: 41 } }, '190': { start: { line: 332, column: 0 }, end: { line: 332, column: 64 } }, '191': { start: { line: 334, column: 27 }, end: { line: 355, column: 1 } }, '192': { start: { line: 335, column: 2 }, end: { line: 341, column: 3 } }, '193': { start: { line: 336, column: 4 }, end: { line: 339, column: 5 } }, '194': { start: { line: 337, column: 6 }, end: { line: 337, column: 47 } }, '195': { start: { line: 338, column: 6 }, end: { line: 338, column: 106 } }, '196': { start: { line: 340, column: 4 }, end: { line: 340, column: 11 } }, '197': { start: { line: 342, column: 2 }, end: { line: 344, column: 3 } }, '198': { start: { line: 343, column: 4 }, end: { line: 343, column: 11 } }, '199': { start: { line: 345, column: 13 }, end: { line: 345, column: 19 } }, '200': { start: { line: 346, column: 14 }, end: { line: 346, column: 20 } }, '201': { start: { line: 347, column: 2 }, end: { line: 353, column: 3 } }, '202': { start: { line: 348, column: 4 }, end: { line: 350, column: 5 } }, '203': { start: { line: 349, column: 6 }, end: { line: 349, column: 15 } }, '204': { start: { line: 351, column: 4 }, end: { line: 351, column: 52 } }, '205': { start: { line: 352, column: 4 }, end: { line: 352, column: 30 } }, '206': { start: { line: 354, column: 2 }, end: { line: 354, column: 17 } }, '207': { start: { line: 356, column: 0 }, end: { line: 356, column: 36 } }, '208': { start: { line: 358, column: 29 }, end: { line: 392, column: 1 } }, '209': { start: { line: 359, column: 2 }, end: { line: 363, column: 3 } }, '210': { start: { line: 360, column: 4 }, end: { line: 360, column: 41 } }, '211': { start: { line: 361, column: 9 }, end: { line: 363, column: 3 } }, '212': { start: { line: 362, column: 4 }, end: { line: 362, column: 23 } }, '213': { start: { line: 365, column: 21 }, end: { line: 365, column: 27 } }, '214': { start: { line: 366, column: 2 }, end: { line: 389, column: 3 } }, '215': { start: { line: 367, column: 20 }, end: { line: 367, column: 37 } }, '216': { start: { line: 368, column: 4 }, end: { line: 388, column: 5 } }, '217': { start: { line: 369, column: 6 }, end: { line: 387, column: 7 } }, '218': { start: { line: 370, column: 28 }, end: { line: 370, column: 62 } }, '219': { start: { line: 371, column: 26 }, end: { line: 371, column: 38 } }, '220': { start: { line: 372, column: 8 }, end: { line: 374, column: 9 } }, '221': { start: { line: 373, column: 10 }, end: { line: 373, column: 31 } }, '222': { start: { line: 375, column: 8 }, end: { line: 379, column: 9 } }, '223': { start: { line: 376, column: 10 }, end: { line: 376, column: 25 } }, '224': { start: { line: 377, column: 15 }, end: { line: 379, column: 9 } }, '225': { start: { line: 378, column: 10 }, end: { line: 378, column: 25 } }, '226': { start: { line: 380, column: 13 }, end: { line: 387, column: 7 } }, '227': { start: { line: 381, column: 26 }, end: { line: 381, column: 60 } }, '228': { start: { line: 382, column: 8 }, end: { line: 384, column: 9 } }, '229': { start: { line: 383, column: 10 }, end: { line: 383, column: 25 } }, '230': { start: { line: 385, column: 13 }, end: { line: 387, column: 7 } }, '231': { start: { line: 386, column: 8 }, end: { line: 386, column: 23 } }, '232': { start: { line: 391, column: 2 }, end: { line: 391, column: 22 } }, '233': { start: { line: 395, column: 2 }, end: { line: 397, column: 3 } }, '234': { start: { line: 396, column: 4 }, end: { line: 396, column: 11 } }, '235': { start: { line: 398, column: 2 }, end: { line: 400, column: 3 } }, '236': { start: { line: 399, column: 4 }, end: { line: 399, column: 11 } }, '237': { start: { line: 401, column: 15 }, end: { line: 401, column: 38 } }, '238': { start: { line: 402, column: 14 }, end: { line: 402, column: 20 } }, '239': { start: { line: 403, column: 14 }, end: { line: 405, column: 3 } }, '240': { start: { line: 407, column: 2 }, end: { line: 416, column: 3 } }, '241': { start: { line: 408, column: 4 }, end: { line: 408, column: 36 } }, '242': { start: { line: 409, column: 15 }, end: { line: 409, column: 28 } }, '243': { start: { line: 410, column: 4 }, end: { line: 412, column: 5 } }, '244': { start: { line: 411, column: 6 }, end: { line: 411, column: 82 } }, '245': { start: { line: 413, column: 4 }, end: { line: 415, column: 5 } }, '246': { start: { line: 414, column: 6 }, end: { line: 414, column: 33 } }, '247': { start: { line: 417, column: 2 }, end: { line: 417, column: 34 } }, '248': { start: { line: 419, column: 0 }, end: { line: 419, column: 66 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 9, column: 68 }, end: { line: 9, column: 69 } }, loc: { start: { line: 9, column: 81 }, end: { line: 11, column: 1 } }, line: 9 }, '1': { name: '(anonymous_1)', decl: { start: { line: 13, column: 67 }, end: { line: 13, column: 68 } }, loc: { start: { line: 13, column: 90 }, end: { line: 15, column: 1 } }, line: 13 }, '2': { name: '(anonymous_2)', decl: { start: { line: 15, column: 4 }, end: { line: 15, column: 5 } }, loc: { start: { line: 15, column: 27 }, end: { line: 23, column: 1 } }, line: 15 }, '3': { name: 'arraysHaveMatchByRef', decl: { start: { line: 25, column: 9 }, end: { line: 25, column: 29 } }, loc: { start: { line: 25, column: 58 }, end: { line: 35, column: 1 } }, line: 25 }, '4': { name: 'matchItems', decl: { start: { line: 37, column: 9 }, end: { line: 37, column: 19 } }, loc: { start: { line: 37, column: 61 }, end: { line: 78, column: 1 } }, line: 37 }, '5': { name: 'arraysDiffFilter', decl: { start: { line: 80, column: 33 }, end: { line: 80, column: 49 } }, loc: { start: { line: 80, column: 59 }, end: { line: 217, column: 1 } }, line: 80 }, '6': { name: 'numerically', decl: { start: { line: 221, column: 24 }, end: { line: 221, column: 35 } }, loc: { start: { line: 221, column: 42 }, end: { line: 223, column: 3 } }, line: 221 }, '7': { name: 'numericallyBy', decl: { start: { line: 224, column: 26 }, end: { line: 224, column: 39 } }, loc: { start: { line: 224, column: 46 }, end: { line: 228, column: 3 } }, line: 224 }, '8': { name: '(anonymous_8)', decl: { start: { line: 225, column: 11 }, end: { line: 225, column: 12 } }, loc: { start: { line: 225, column: 27 }, end: { line: 227, column: 5 } }, line: 225 }, '9': { name: 'nestedPatchFilter', decl: { start: { line: 231, column: 34 }, end: { line: 231, column: 51 } }, loc: { start: { line: 231, column: 61 }, end: { line: 314, column: 1 } }, line: 231 }, '10': { name: 'collectChildrenPatchFilter', decl: { start: { line: 317, column: 49 }, end: { line: 317, column: 75 } }, loc: { start: { line: 317, column: 85 }, end: { line: 331, column: 1 } }, line: 317 }, '11': { name: 'arraysReverseFilter', decl: { start: { line: 334, column: 36 }, end: { line: 334, column: 55 } }, loc: { start: { line: 334, column: 65 }, end: { line: 355, column: 1 } }, line: 334 }, '12': { name: 'reverseArrayDeltaIndex', decl: { start: { line: 358, column: 38 }, end: { line: 358, column: 60 } }, loc: { start: { line: 358, column: 86 }, end: { line: 392, column: 1 } }, line: 358 }, '13': { name: 'collectChildrenReverseFilter', decl: { start: { line: 394, column: 16 }, end: { line: 394, column: 44 } }, loc: { start: { line: 394, column: 54 }, end: { line: 418, column: 1 } }, line: 394 } }, branchMap: { '0': { loc: { start: { line: 9, column: 14 }, end: { line: 11, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 9, column: 52 }, end: { line: 9, column: 65 } }, { start: { line: 9, column: 68 }, end: { line: 11, column: 1 } }], line: 9 }, '1': { loc: { start: { line: 13, column: 19 }, end: { line: 23, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 13, column: 67 }, end: { line: 15, column: 1 } }, { start: { line: 15, column: 4 }, end: { line: 23, column: 1 } }], line: 13 }, '2': { loc: { start: { line: 18, column: 4 }, end: { line: 20, column: 5 } }, type: 'if', locations: [{ start: { line: 18, column: 4 }, end: { line: 20, column: 5 } }, { start: { line: 18, column: 4 }, end: { line: 20, column: 5 } }], line: 18 }, '3': { loc: { start: { line: 30, column: 6 }, end: { line: 32, column: 7 } }, type: 'if', locations: [{ start: { line: 30, column: 6 }, end: { line: 32, column: 7 } }, { start: { line: 30, column: 6 }, end: { line: 32, column: 7 } }], line: 30 }, '4': { loc: { start: { line: 30, column: 10 }, end: { line: 30, column: 44 } }, type: 'binary-expr', locations: [{ start: { line: 30, column: 10 }, end: { line: 30, column: 27 } }, { start: { line: 30, column: 31 }, end: { line: 30, column: 44 } }], line: 30 }, '5': { loc: { start: { line: 40, column: 2 }, end: { line: 42, column: 3 } }, type: 'if', locations: [{ start: { line: 40, column: 2 }, end: { line: 42, column: 3 } }, { start: { line: 40, column: 2 }, end: { line: 42, column: 3 } }], line: 40 }, '6': { loc: { start: { line: 43, column: 2 }, end: { line: 45, column: 3 } }, type: 'if', locations: [{ start: { line: 43, column: 2 }, end: { line: 45, column: 3 } }, { start: { line: 43, column: 2 }, end: { line: 45, column: 3 } }], line: 43 }, '7': { loc: { start: { line: 43, column: 6 }, end: { line: 43, column: 186 } }, type: 'binary-expr', locations: [{ start: { line: 43, column: 6 }, end: { line: 43, column: 94 } }, { start: { line: 43, column: 98 }, end: { line: 43, column: 186 } }], line: 43 }, '8': { loc: { start: { line: 43, column: 7 }, end: { line: 43, column: 80 } }, type: 'cond-expr', locations: [{ start: { line: 43, column: 39 }, end: { line: 43, column: 50 } }, { start: { line: 43, column: 53 }, end: { line: 43, column: 80 } }], line: 43 }, '9': { loc: { start: { line: 43, column: 99 }, end: { line: 43, column: 172 } }, type: 'cond-expr', locations: [{ start: { line: 43, column: 131 }, end: { line: 43, column: 142 } }, { start: { line: 43, column: 145 }, end: { line: 43, column: 172 } }], line: 43 }, '10': { loc: { start: { line: 47, column: 2 }, end: { line: 50, column: 3 } }, type: 'if', locations: [{ start: { line: 47, column: 2 }, end: { line: 50, column: 3 } }, { start: { line: 47, column: 2 }, end: { line: 50, column: 3 } }], line: 47 }, '11': { loc: { start: { line: 49, column: 11 }, end: { line: 49, column: 55 } }, type: 'binary-expr', locations: [{ start: { line: 49, column: 11 }, end: { line: 49, column: 34 } }, { start: { line: 49, column: 38 }, end: { line: 49, column: 55 } }], line: 49 }, '12': { loc: { start: { line: 53, column: 2 }, end: { line: 61, column: 3 } }, type: 'if', locations: [{ start: { line: 53, column: 2 }, end: { line: 61, column: 3 } }, { start: { line: 53, column: 2 }, end: { line: 61, column: 3 } }], line: 53 }, '13': { loc: { start: { line: 54, column: 25 }, end: { line: 54, column: 49 } }, type: 'binary-expr', locations: [{ start: { line: 54, column: 25 }, end: { line: 54, column: 43 } }, { start: { line: 54, column: 47 }, end: { line: 54, column: 49 } }], line: 54 }, '14': { loc: { start: { line: 56, column: 4 }, end: { line: 58, column: 5 } }, type: 'if', locations: [{ start: { line: 56, column: 4 }, end: { line: 58, column: 5 } }, { start: { line: 56, column: 4 }, end: { line: 58, column: 5 } }], line: 56 }, '15': { loc: { start: { line: 62, column: 2 }, end: { line: 64, column: 3 } }, type: 'if', locations: [{ start: { line: 62, column: 2 }, end: { line: 64, column: 3 } }, { start: { line: 62, column: 2 }, end: { line: 64, column: 3 } }], line: 62 }, '16': { loc: { start: { line: 65, column: 2 }, end: { line: 73, column: 3 } }, type: 'if', locations: [{ start: { line: 65, column: 2 }, end: { line: 73, column: 3 } }, { start: { line: 65, column: 2 }, end: { line: 73, column: 3 } }], line: 65 }, '17': { loc: { start: { line: 66, column: 25 }, end: { line: 66, column: 49 } }, type: 'binary-expr', locations: [{ start: { line: 66, column: 25 }, end: { line: 66, column: 43 } }, { start: { line: 66, column: 47 }, end: { line: 66, column: 49 } }], line: 66 }, '18': { loc: { start: { line: 68, column: 4 }, end: { line: 70, column: 5 } }, type: 'if', locations: [{ start: { line: 68, column: 4 }, end: { line: 70, column: 5 } }, { start: { line: 68, column: 4 }, end: { line: 70, column: 5 } }], line: 68 }, '19': { loc: { start: { line: 74, column: 2 }, end: { line: 76, column: 3 } }, type: 'if', locations: [{ start: { line: 74, column: 2 }, end: { line: 76, column: 3 } }, { start: { line: 74, column: 2 }, end: { line: 76, column: 3 } }], line: 74 }, '20': { loc: { start: { line: 81, column: 2 }, end: { line: 83, column: 3 } }, type: 'if', locations: [{ start: { line: 81, column: 2 }, end: { line: 83, column: 3 } }, { start: { line: 81, column: 2 }, end: { line: 83, column: 3 } }], line: 81 }, '21': { loc: { start: { line: 86, column: 16 }, end: { line: 86, column: 61 } }, type: 'binary-expr', locations: [{ start: { line: 86, column: 16 }, end: { line: 86, column: 31 } }, { start: { line: 86, column: 35 }, end: { line: 86, column: 61 } }], line: 86 }, '22': { loc: { start: { line: 87, column: 21 }, end: { line: 87, column: 71 } }, type: 'binary-expr', locations: [{ start: { line: 87, column: 21 }, end: { line: 87, column: 36 } }, { start: { line: 87, column: 40 }, end: { line: 87, column: 71 } }], line: 87 }, '23': { loc: { start: { line: 101, column: 2 }, end: { line: 103, column: 3 } }, type: 'if', locations: [{ start: { line: 101, column: 2 }, end: { line: 103, column: 3 } }, { start: { line: 101, column: 2 }, end: { line: 103, column: 3 } }], line: 101 }, '24': { loc: { start: { line: 101, column: 6 }, end: { line: 101, column: 107 } }, type: 'binary-expr', locations: [{ start: { line: 101, column: 6 }, end: { line: 101, column: 14 } }, { start: { line: 101, column: 18 }, end: { line: 101, column: 26 } }, { start: { line: 101, column: 30 }, end: { line: 101, column: 54 } }, { start: { line: 101, column: 58 }, end: { line: 101, column: 107 } }], line: 101 }, '25': { loc: { start: { line: 106, column: 9 }, end: { line: 106, column: 115 } }, type: 'binary-expr', locations: [{ start: { line: 106, column: 9 }, end: { line: 106, column: 26 } }, { start: { line: 106, column: 30 }, end: { line: 106, column: 47 } }, { start: { line: 106, column: 51 }, end: { line: 106, column: 115 } }], line: 106 }, '26': { loc: { start: { line: 113, column: 9 }, end: { line: 113, column: 163 } }, type: 'binary-expr', locations: [{ start: { line: 113, column: 9 }, end: { line: 113, column: 39 } }, { start: { line: 113, column: 43 }, end: { line: 113, column: 73 } }, { start: { line: 113, column: 77 }, end: { line: 113, column: 163 } }], line: 113 }, '27': { loc: { start: { line: 121, column: 2 }, end: { line: 136, column: 3 } }, type: 'if', locations: [{ start: { line: 121, column: 2 }, end: { line: 136, column: 3 } }, { start: { line: 121, column: 2 }, end: { line: 136, column: 3 } }], line: 121 }, '28': { loc: { start: { line: 122, column: 4 }, end: { line: 126, column: 5 } }, type: 'if', locations: [{ start: { line: 122, column: 4 }, end: { line: 126, column: 5 } }, { start: { line: 122, column: 4 }, end: { line: 126, column: 5 } }], line: 122 }, '29': { loc: { start: { line: 128, column: 13 }, end: { line: 130, column: 5 } }, type: 'binary-expr', locations: [{ start: { line: 128, column: 13 }, end: { line: 128, column: 19 } }, { start: { line: 128, column: 23 }, end: { line: 130, column: 5 } }], line: 128 }, '30': { loc: { start: { line: 137, column: 2 }, end: { line: 147, column: 3 } }, type: 'if', locations: [{ start: { line: 137, column: 2 }, end: { line: 147, column: 3 } }, { start: { line: 137, column: 2 }, end: { line: 147, column: 3 } }], line: 137 }, '31': { loc: { start: { line: 139, column: 13 }, end: { line: 141, column: 5 } }, type: 'binary-expr', locations: [{ start: { line: 139, column: 13 }, end: { line: 139, column: 19 } }, { start: { line: 139, column: 23 }, end: { line: 141, column: 5 } }], line: 139 }, '32': { loc: { start: { line: 157, column: 11 }, end: { line: 159, column: 3 } }, type: 'binary-expr', locations: [{ start: { line: 157, column: 11 }, end: { line: 157, column: 17 } }, { start: { line: 157, column: 21 }, end: { line: 159, column: 3 } }], line: 157 }, '33': { loc: { start: { line: 161, column: 4 }, end: { line: 165, column: 5 } }, type: 'if', locations: [{ start: { line: 161, column: 4 }, end: { line: 165, column: 5 } }, { start: { line: 161, column: 4 }, end: { line: 165, column: 5 } }], line: 161 }, '34': { loc: { start: { line: 169, column: 2 }, end: { line: 171, column: 3 } }, type: 'if', locations: [{ start: { line: 169, column: 2 }, end: { line: 171, column: 3 } }, { start: { line: 169, column: 2 }, end: { line: 171, column: 3 } }], line: 169 }, '35': { loc: { start: { line: 169, column: 6 }, end: { line: 169, column: 94 } }, type: 'binary-expr', locations: [{ start: { line: 169, column: 6 }, end: { line: 169, column: 21 } }, { start: { line: 169, column: 25 }, end: { line: 169, column: 47 } }, { start: { line: 169, column: 51 }, end: { line: 169, column: 94 } }], line: 169 }, '36': { loc: { start: { line: 173, column: 2 }, end: { line: 175, column: 3 } }, type: 'if', locations: [{ start: { line: 173, column: 2 }, end: { line: 175, column: 3 } }, { start: { line: 173, column: 2 }, end: { line: 175, column: 3 } }], line: 173 }, '37': { loc: { start: { line: 173, column: 6 }, end: { line: 173, column: 92 } }, type: 'binary-expr', locations: [{ start: { line: 173, column: 6 }, end: { line: 173, column: 21 } }, { start: { line: 173, column: 25 }, end: { line: 173, column: 47 } }, { start: { line: 173, column: 51 }, end: { line: 173, column: 92 } }], line: 173 }, '38': { loc: { start: { line: 180, column: 4 }, end: { line: 213, column: 5 } }, type: 'if', locations: [{ start: { line: 180, column: 4 }, end: { line: 213, column: 5 } }, { start: { line: 180, column: 4 }, end: { line: 213, column: 5 } }], line: 180 }, '39': { loc: { start: { line: 183, column: 6 }, end: { line: 202, column: 7 } }, type: 'if', locations: [{ start: { line: 183, column: 6 }, end: { line: 202, column: 7 } }, { start: { line: 183, column: 6 }, end: { line: 202, column: 7 } }], line: 183 }, '40': { loc: { start: { line: 183, column: 10 }, end: { line: 183, column: 46 } }, type: 'binary-expr', locations: [{ start: { line: 183, column: 10 }, end: { line: 183, column: 20 } }, { start: { line: 183, column: 24 }, end: { line: 183, column: 46 } }], line: 183 }, '41': { loc: { start: { line: 186, column: 10 }, end: { line: 200, column: 11 } }, type: 'if', locations: [{ start: { line: 186, column: 10 }, end: { line: 200, column: 11 } }, { start: { line: 186, column: 10 }, end: { line: 200, column: 11 } }], line: 186 }, '42': { loc: { start: { line: 189, column: 12 }, end: { line: 192, column: 13 } }, type: 'if', locations: [{ start: { line: 189, column: 12 }, end: { line: 192, column: 13 } }, { start: { line: 189, column: 12 }, end: { line: 192, column: 13 } }], line: 189 }, '43': { loc: { start: { line: 203, column: 6 }, end: { line: 206, column: 7 } }, type: 'if', locations: [{ start: { line: 203, column: 6 }, end: { line: 206, column: 7 } }, { start: { line: 203, column: 6 }, end: { line: 206, column: 7 } }], line: 203 }, '44': { loc: { start: { line: 232, column: 2 }, end: { line: 234, column: 3 } }, type: 'if', locations: [{ start: { line: 232, column: 2 }, end: { line: 234, column: 3 } }, { start: { line: 232, column: 2 }, end: { line: 234, column: 3 } }], line: 232 }, '45': { loc: { start: { line: 235, column: 2 }, end: { line: 237, column: 3 } }, type: 'if', locations: [{ start: { line: 235, column: 2 }, end: { line: 237, column: 3 } }, { start: { line: 235, column: 2 }, end: { line: 237, column: 3 } }], line: 235 }, '46': { loc: { start: { line: 249, column: 4 }, end: { line: 272, column: 5 } }, type: 'if', locations: [{ start: { line: 249, column: 4 }, end: { line: 272, column: 5 } }, { start: { line: 249, column: 4 }, end: { line: 272, column: 5 } }], line: 249 }, '47': { loc: { start: { line: 250, column: 6 }, end: { line: 271, column: 7 } }, type: 'if', locations: [{ start: { line: 250, column: 6 }, end: { line: 271, column: 7 } }, { start: { line: 250, column: 6 }, end: { line: 271, column: 7 } }], line: 250 }, '48': { loc: { start: { line: 252, column: 8 }, end: { line: 256, column: 9 } }, type: 'if', locations: [{ start: { line: 252, column: 8 }, end: { line: 256, column: 9 } }, { start: { line: 252, column: 8 }, end: { line: 256, column: 9 } }], line: 252 }, '49': { loc: { start: { line: 252, column: 12 }, end: { line: 252, column: 67 } }, type: 'binary-expr', locations: [{ start: { line: 252, column: 12 }, end: { line: 252, column: 33 } }, { start: { line: 252, column: 37 }, end: { line: 252, column: 67 } }], line: 252 }, '50': { loc: { start: { line: 258, column: 8 }, end: { line: 270, column: 9 } }, type: 'if', locations: [{ start: { line: 258, column: 8 }, end: { line: 270, column: 9 } }, { start: { line: 258, column: 8 }, end: { line: 270, column: 9 } }], line: 258 }, '51': { loc: { start: { line: 281, column: 4 }, end: { line: 287, column: 5 } }, type: 'if', locations: [{ start: { line: 281, column: 4 }, end: { line: 287, column: 5 } }, { start: { line: 281, column: 4 }, end: { line: 287, column: 5 } }], line: 281 }, '52': { loc: { start: { line: 301, column: 2 }, end: { line: 307, column: 3 } }, type: 'if', locations: [{ start: { line: 301, column: 2 }, end: { line: 307, column: 3 } }, { start: { line: 301, column: 2 }, end: { line: 307, column: 3 } }], line: 301 }, '53': { loc: { start: { line: 309, column: 2 }, end: { line: 312, column: 3 } }, type: 'if', locations: [{ start: { line: 309, column: 2 }, end: { line: 312, column: 3 } }, { start: { line: 309, column: 2 }, end: { line: 312, column: 3 } }], line: 309 }, '54': { loc: { start: { line: 318, column: 2 }, end: { line: 320, column: 3 } }, type: 'if', locations: [{ start: { line: 318, column: 2 }, end: { line: 320, column: 3 } }, { start: { line: 318, column: 2 }, end: { line: 320, column: 3 } }], line: 318 }, '55': { loc: { start: { line: 318, column: 6 }, end: { line: 318, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 318, column: 6 }, end: { line: 318, column: 14 } }, { start: { line: 318, column: 18 }, end: { line: 318, column: 35 } }], line: 318 }, '56': { loc: { start: { line: 321, column: 2 }, end: { line: 323, column: 3 } }, type: 'if', locations: [{ start: { line: 321, column: 2 }, end: { line: 323, column: 3 } }, { start: { line: 321, column: 2 }, end: { line: 323, column: 3 } }], line: 321 }, '57': { loc: { start: { line: 335, column: 2 }, end: { line: 341, column: 3 } }, type: 'if', locations: [{ start: { line: 335, column: 2 }, end: { line: 341, column: 3 } }, { start: { line: 335, column: 2 }, end: { line: 341, column: 3 } }], line: 335 }, '58': { loc: { start: { line: 336, column: 4 }, end: { line: 339, column: 5 } }, type: 'if', locations: [{ start: { line: 336, column: 4 }, end: { line: 339, column: 5 } }, { start: { line: 336, column: 4 }, end: { line: 339, column: 5 } }], line: 336 }, '59': { loc: { start: { line: 342, column: 2 }, end: { line: 344, column: 3 } }, type: 'if', locations: [{ start: { line: 342, column: 2 }, end: { line: 344, column: 3 } }, { start: { line: 342, column: 2 }, end: { line: 344, column: 3 } }], line: 342 }, '60': { loc: { start: { line: 348, column: 4 }, end: { line: 350, column: 5 } }, type: 'if', locations: [{ start: { line: 348, column: 4 }, end: { line: 350, column: 5 } }, { start: { line: 348, column: 4 }, end: { line: 350, column: 5 } }], line: 348 }, '61': { loc: { start: { line: 359, column: 2 }, end: { line: 363, column: 3 } }, type: 'if', locations: [{ start: { line: 359, column: 2 }, end: { line: 363, column: 3 } }, { start: { line: 359, column: 2 }, end: { line: 363, column: 3 } }], line: 359 }, '62': { loc: { start: { line: 359, column: 6 }, end: { line: 359, column: 51 } }, type: 'binary-expr', locations: [{ start: { line: 359, column: 6 }, end: { line: 359, column: 31 } }, { start: { line: 359, column: 35 }, end: { line: 359, column: 51 } }], line: 359 }, '63': { loc: { start: { line: 361, column: 9 }, end: { line: 363, column: 3 } }, type: 'if', locations: [{ start: { line: 361, column: 9 }, end: { line: 363, column: 3 } }, { start: { line: 361, column: 9 }, end: { line: 363, column: 3 } }], line: 361 }, '64': { loc: { start: { line: 361, column: 13 }, end: { line: 361, column: 53 } }, type: 'binary-expr', locations: [{ start: { line: 361, column: 13 }, end: { line: 361, column: 31 } }, { start: { line: 361, column: 35 }, end: { line: 361, column: 53 } }], line: 361 }, '65': { loc: { start: { line: 368, column: 4 }, end: { line: 388, column: 5 } }, type: 'if', locations: [{ start: { line: 368, column: 4 }, end: { line: 388, column: 5 } }, { start: { line: 368, column: 4 }, end: { line: 388, column: 5 } }], line: 368 }, '66': { loc: { start: { line: 369, column: 6 }, end: { line: 387, column: 7 } }, type: 'if', locations: [{ start: { line: 369, column: 6 }, end: { line: 387, column: 7 } }, { start: { line: 369, column: 6 }, end: { line: 387, column: 7 } }], line: 369 }, '67': { loc: { start: { line: 372, column: 8 }, end: { line: 374, column: 9 } }, type: 'if', locations: [{ start: { line: 372, column: 8 }, end: { line: 374, column: 9 } }, { start: { line: 372, column: 8 }, end: { line: 374, column: 9 } }], line: 372 }, '68': { loc: { start: { line: 375, column: 8 }, end: { line: 379, column: 9 } }, type: 'if', locations: [{ start: { line: 375, column: 8 }, end: { line: 379, column: 9 } }, { start: { line: 375, column: 8 }, end: { line: 379, column: 9 } }], line: 375 }, '69': { loc: { start: { line: 375, column: 12 }, end: { line: 375, column: 71 } }, type: 'binary-expr', locations: [{ start: { line: 375, column: 12 }, end: { line: 375, column: 41 } }, { start: { line: 375, column: 45 }, end: { line: 375, column: 71 } }], line: 375 }, '70': { loc: { start: { line: 377, column: 15 }, end: { line: 379, column: 9 } }, type: 'if', locations: [{ start: { line: 377, column: 15 }, end: { line: 379, column: 9 } }, { start: { line: 377, column: 15 }, end: { line: 379, column: 9 } }], line: 377 }, '71': { loc: { start: { line: 377, column: 19 }, end: { line: 377, column: 78 } }, type: 'binary-expr', locations: [{ start: { line: 377, column: 19 }, end: { line: 377, column: 48 } }, { start: { line: 377, column: 52 }, end: { line: 377, column: 78 } }], line: 377 }, '72': { loc: { start: { line: 380, column: 13 }, end: { line: 387, column: 7 } }, type: 'if', locations: [{ start: { line: 380, column: 13 }, end: { line: 387, column: 7 } }, { start: { line: 380, column: 13 }, end: { line: 387, column: 7 } }], line: 380 }, '73': { loc: { start: { line: 382, column: 8 }, end: { line: 384, column: 9 } }, type: 'if', locations: [{ start: { line: 382, column: 8 }, end: { line: 384, column: 9 } }, { start: { line: 382, column: 8 }, end: { line: 384, column: 9 } }], line: 382 }, '74': { loc: { start: { line: 385, column: 13 }, end: { line: 387, column: 7 } }, type: 'if', locations: [{ start: { line: 385, column: 13 }, end: { line: 387, column: 7 } }, { start: { line: 385, column: 13 }, end: { line: 387, column: 7 } }], line: 385 }, '75': { loc: { start: { line: 385, column: 17 }, end: { line: 385, column: 69 } }, type: 'binary-expr', locations: [{ start: { line: 385, column: 17 }, end: { line: 385, column: 39 } }, { start: { line: 385, column: 43 }, end: { line: 385, column: 69 } }], line: 385 }, '76': { loc: { start: { line: 395, column: 2 }, end: { line: 397, column: 3 } }, type: 'if', locations: [{ start: { line: 395, column: 2 }, end: { line: 397, column: 3 } }, { start: { line: 395, column: 2 }, end: { line: 397, column: 3 } }], line: 395 }, '77': { loc: { start: { line: 395, column: 6 }, end: { line: 395, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 395, column: 6 }, end: { line: 395, column: 14 } }, { start: { line: 395, column: 18 }, end: { line: 395, column: 35 } }], line: 395 }, '78': { loc: { start: { line: 398, column: 2 }, end: { line: 400, column: 3 } }, type: 'if', locations: [{ start: { line: 398, column: 2 }, end: { line: 400, column: 3 } }, { start: { line: 398, column: 2 }, end: { line: 400, column: 3 } }], line: 398 }, '79': { loc: { start: { line: 410, column: 4 }, end: { line: 412, column: 5 } }, type: 'if', locations: [{ start: { line: 410, column: 4 }, end: { line: 412, column: 5 } }, { start: { line: 410, column: 4 }, end: { line: 412, column: 5 } }], line: 410 }, '80': { loc: { start: { line: 413, column: 4 }, end: { line: 415, column: 5 } }, type: 'if', locations: [{ start: { line: 413, column: 4 }, end: { line: 415, column: 5 } }, { start: { line: 413, column: 4 }, end: { line: 415, column: 5 } }], line: 413 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0, '92': 0, '93': 0, '94': 0, '95': 0, '96': 0, '97': 0, '98': 0, '99': 0, '100': 0, '101': 0, '102': 0, '103': 0, '104': 0, '105': 0, '106': 0, '107': 0, '108': 0, '109': 0, '110': 0, '111': 0, '112': 0, '113': 0, '114': 0, '115': 0, '116': 0, '117': 0, '118': 0, '119': 0, '120': 0, '121': 0, '122': 0, '123': 0, '124': 0, '125': 0, '126': 0, '127': 0, '128': 0, '129': 0, '130': 0, '131': 0, '132': 0, '133': 0, '134': 0, '135': 0, '136': 0, '137': 0, '138': 0, '139': 0, '140': 0, '141': 0, '142': 0, '143': 0, '144': 0, '145': 0, '146': 0, '147': 0, '148': 0, '149': 0, '150': 0, '151': 0, '152': 0, '153': 0, '154': 0, '155': 0, '156': 0, '157': 0, '158': 0, '159': 0, '160': 0, '161': 0, '162': 0, '163': 0, '164': 0, '165': 0, '166': 0, '167': 0, '168': 0, '169': 0, '170': 0, '171': 0, '172': 0, '173': 0, '174': 0, '175': 0, '176': 0, '177': 0, '178': 0, '179': 0, '180': 0, '181': 0, '182': 0, '183': 0, '184': 0, '185': 0, '186': 0, '187': 0, '188': 0, '189': 0, '190': 0, '191': 0, '192': 0, '193': 0, '194': 0, '195': 0, '196': 0, '197': 0, '198': 0, '199': 0, '200': 0, '201': 0, '202': 0, '203': 0, '204': 0, '205': 0, '206': 0, '207': 0, '208': 0, '209': 0, '210': 0, '211': 0, '212': 0, '213': 0, '214': 0, '215': 0, '216': 0, '217': 0, '218': 0, '219': 0, '220': 0, '221': 0, '222': 0, '223': 0, '224': 0, '225': 0, '226': 0, '227': 0, '228': 0, '229': 0, '230': 0, '231': 0, '232': 0, '233': 0, '234': 0, '235': 0, '236': 0, '237': 0, '238': 0, '239': 0, '240': 0, '241': 0, '242': 0, '243': 0, '244': 0, '245': 0, '246': 0, '247': 0, '248': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0], '22': [0, 0], '23': [0, 0], '24': [0, 0, 0, 0], '25': [0, 0, 0], '26': [0, 0, 0], '27': [0, 0], '28': [0, 0], '29': [0, 0], '30': [0, 0], '31': [0, 0], '32': [0, 0], '33': [0, 0], '34': [0, 0], '35': [0, 0, 0], '36': [0, 0], '37': [0, 0, 0], '38': [0, 0], '39': [0, 0], '40': [0, 0], '41': [0, 0], '42': [0, 0], '43': [0, 0], '44': [0, 0], '45': [0, 0], '46': [0, 0], '47': [0, 0], '48': [0, 0], '49': [0, 0], '50': [0, 0], '51': [0, 0], '52': [0, 0], '53': [0, 0], '54': [0, 0], '55': [0, 0], '56': [0, 0], '57': [0, 0], '58': [0, 0], '59': [0, 0], '60': [0, 0], '61': [0, 0], '62': [0, 0], '63': [0, 0], '64': [0, 0], '65': [0, 0], '66': [0, 0], '67': [0, 0], '68': [0, 0], '69': [0, 0], '70': [0, 0], '71': [0, 0], '72': [0, 0], '73': [0, 0], '74': [0, 0], '75': [0, 0], '76': [0, 0], '77': [0, 0], '78': [0, 0], '79': [0, 0], '80': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
2900 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
2901 | return coverage[path];
|
2902 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
2903 | }();var ARRAY_MOVE = (cov_g15fjodrd.s[0]++, 3);var isArray$2 = (cov_g15fjodrd.s[1]++, typeof Array.isArray === 'function' ? (cov_g15fjodrd.b[0][0]++, Array.isArray) : (cov_g15fjodrd.b[0][1]++, function (a) {
|
2904 | cov_g15fjodrd.f[0]++;cov_g15fjodrd.s[2]++;return a instanceof Array;
|
2905 | }));var arrayIndexOf = (cov_g15fjodrd.s[3]++, typeof Array.prototype.indexOf === 'function' ? (cov_g15fjodrd.b[1][0]++, function (array, item) {
|
2906 | cov_g15fjodrd.f[1]++;cov_g15fjodrd.s[4]++;return array.indexOf(item);
|
2907 | }) : (cov_g15fjodrd.b[1][1]++, function (array, item) {
|
2908 | cov_g15fjodrd.f[2]++;var length = (cov_g15fjodrd.s[5]++, array.length);cov_g15fjodrd.s[6]++;for (var i = 0; i < length; i++) {
|
2909 | cov_g15fjodrd.s[7]++;if (array[i] === item) {
|
2910 | cov_g15fjodrd.b[2][0]++;cov_g15fjodrd.s[8]++;return i;
|
2911 | } else {
|
2912 | cov_g15fjodrd.b[2][1]++;
|
2913 | }
|
2914 | }cov_g15fjodrd.s[9]++;return -1;
|
2915 | }));function arraysHaveMatchByRef(array1, array2, len1, len2) {
|
2916 | cov_g15fjodrd.f[3]++;cov_g15fjodrd.s[10]++;for (var index1 = 0; index1 < len1; index1++) {
|
2917 | var val1 = (cov_g15fjodrd.s[11]++, array1[index1]);cov_g15fjodrd.s[12]++;for (var index2 = 0; index2 < len2; index2++) {
|
2918 | var val2 = (cov_g15fjodrd.s[13]++, array2[index2]);cov_g15fjodrd.s[14]++;if ((cov_g15fjodrd.b[4][0]++, index1 !== index2) && (cov_g15fjodrd.b[4][1]++, val1 === val2)) {
|
2919 | cov_g15fjodrd.b[3][0]++;cov_g15fjodrd.s[15]++;return true;
|
2920 | } else {
|
2921 | cov_g15fjodrd.b[3][1]++;
|
2922 | }
|
2923 | }
|
2924 | }
|
2925 | }function matchItems(array1, array2, index1, index2, context) {
|
2926 | cov_g15fjodrd.f[4]++;var value1 = (cov_g15fjodrd.s[16]++, array1[index1]);var value2 = (cov_g15fjodrd.s[17]++, array2[index2]);cov_g15fjodrd.s[18]++;if (value1 === value2) {
|
2927 | cov_g15fjodrd.b[5][0]++;cov_g15fjodrd.s[19]++;return true;
|
2928 | } else {
|
2929 | cov_g15fjodrd.b[5][1]++;
|
2930 | }cov_g15fjodrd.s[20]++;if ((cov_g15fjodrd.b[7][0]++, (typeof value1 === 'undefined' ? (cov_g15fjodrd.b[8][0]++, 'undefined') : (cov_g15fjodrd.b[8][1]++, _typeof$1(value1))) !== 'object') || (cov_g15fjodrd.b[7][1]++, (typeof value2 === 'undefined' ? (cov_g15fjodrd.b[9][0]++, 'undefined') : (cov_g15fjodrd.b[9][1]++, _typeof$1(value2))) !== 'object')) {
|
2931 | cov_g15fjodrd.b[6][0]++;cov_g15fjodrd.s[21]++;return false;
|
2932 | } else {
|
2933 | cov_g15fjodrd.b[6][1]++;
|
2934 | }var objectHash = (cov_g15fjodrd.s[22]++, context.objectHash);cov_g15fjodrd.s[23]++;if (!objectHash) {
|
2935 | cov_g15fjodrd.b[10][0]++;cov_g15fjodrd.s[24]++;
|
2936 | return (cov_g15fjodrd.b[11][0]++, context.matchByPosition) && (cov_g15fjodrd.b[11][1]++, index1 === index2);
|
2937 | } else {
|
2938 | cov_g15fjodrd.b[10][1]++;
|
2939 | }var hash1 = (cov_g15fjodrd.s[25]++, void 0);var hash2 = (cov_g15fjodrd.s[26]++, void 0);cov_g15fjodrd.s[27]++;if (typeof index1 === 'number') {
|
2940 | cov_g15fjodrd.b[12][0]++;cov_g15fjodrd.s[28]++;context.hashCache1 = (cov_g15fjodrd.b[13][0]++, context.hashCache1) || (cov_g15fjodrd.b[13][1]++, []);cov_g15fjodrd.s[29]++;hash1 = context.hashCache1[index1];cov_g15fjodrd.s[30]++;if (typeof hash1 === 'undefined') {
|
2941 | cov_g15fjodrd.b[14][0]++;cov_g15fjodrd.s[31]++;context.hashCache1[index1] = hash1 = objectHash(value1, index1);
|
2942 | } else {
|
2943 | cov_g15fjodrd.b[14][1]++;
|
2944 | }
|
2945 | } else {
|
2946 | cov_g15fjodrd.b[12][1]++;cov_g15fjodrd.s[32]++;hash1 = objectHash(value1);
|
2947 | }cov_g15fjodrd.s[33]++;if (typeof hash1 === 'undefined') {
|
2948 | cov_g15fjodrd.b[15][0]++;cov_g15fjodrd.s[34]++;return false;
|
2949 | } else {
|
2950 | cov_g15fjodrd.b[15][1]++;
|
2951 | }cov_g15fjodrd.s[35]++;if (typeof index2 === 'number') {
|
2952 | cov_g15fjodrd.b[16][0]++;cov_g15fjodrd.s[36]++;context.hashCache2 = (cov_g15fjodrd.b[17][0]++, context.hashCache2) || (cov_g15fjodrd.b[17][1]++, []);cov_g15fjodrd.s[37]++;hash2 = context.hashCache2[index2];cov_g15fjodrd.s[38]++;if (typeof hash2 === 'undefined') {
|
2953 | cov_g15fjodrd.b[18][0]++;cov_g15fjodrd.s[39]++;context.hashCache2[index2] = hash2 = objectHash(value2, index2);
|
2954 | } else {
|
2955 | cov_g15fjodrd.b[18][1]++;
|
2956 | }
|
2957 | } else {
|
2958 | cov_g15fjodrd.b[16][1]++;cov_g15fjodrd.s[40]++;hash2 = objectHash(value2);
|
2959 | }cov_g15fjodrd.s[41]++;if (typeof hash2 === 'undefined') {
|
2960 | cov_g15fjodrd.b[19][0]++;cov_g15fjodrd.s[42]++;return false;
|
2961 | } else {
|
2962 | cov_g15fjodrd.b[19][1]++;
|
2963 | }cov_g15fjodrd.s[43]++;return hash1 === hash2;
|
2964 | }cov_g15fjodrd.s[44]++;var diffFilter$1 = function arraysDiffFilter(context) {
|
2965 | cov_g15fjodrd.f[5]++;cov_g15fjodrd.s[45]++;if (!context.leftIsArray) {
|
2966 | cov_g15fjodrd.b[20][0]++;cov_g15fjodrd.s[46]++;return;
|
2967 | } else {
|
2968 | cov_g15fjodrd.b[20][1]++;
|
2969 | }var matchContext = (cov_g15fjodrd.s[47]++, { objectHash: (cov_g15fjodrd.b[21][0]++, context.options) && (cov_g15fjodrd.b[21][1]++, context.options.objectHash), matchByPosition: (cov_g15fjodrd.b[22][0]++, context.options) && (cov_g15fjodrd.b[22][1]++, context.options.matchByPosition) });var commonHead = (cov_g15fjodrd.s[48]++, 0);var commonTail = (cov_g15fjodrd.s[49]++, 0);var index = (cov_g15fjodrd.s[50]++, void 0);var index1 = (cov_g15fjodrd.s[51]++, void 0);var index2 = (cov_g15fjodrd.s[52]++, void 0);var array1 = (cov_g15fjodrd.s[53]++, context.left);var array2 = (cov_g15fjodrd.s[54]++, context.right);var len1 = (cov_g15fjodrd.s[55]++, array1.length);var len2 = (cov_g15fjodrd.s[56]++, array2.length);var child = (cov_g15fjodrd.s[57]++, void 0);cov_g15fjodrd.s[58]++;if ((cov_g15fjodrd.b[24][0]++, len1 > 0) && (cov_g15fjodrd.b[24][1]++, len2 > 0) && (cov_g15fjodrd.b[24][2]++, !matchContext.objectHash) && (cov_g15fjodrd.b[24][3]++, typeof matchContext.matchByPosition !== 'boolean')) {
|
2970 | cov_g15fjodrd.b[23][0]++;cov_g15fjodrd.s[59]++;matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
|
2971 | } else {
|
2972 | cov_g15fjodrd.b[23][1]++;
|
2973 | }
|
2974 | cov_g15fjodrd.s[60]++;while ((cov_g15fjodrd.b[25][0]++, commonHead < len1) && (cov_g15fjodrd.b[25][1]++, commonHead < len2) && (cov_g15fjodrd.b[25][2]++, matchItems(array1, array2, commonHead, commonHead, matchContext))) {
|
2975 | cov_g15fjodrd.s[61]++;index = commonHead;cov_g15fjodrd.s[62]++;child = new DiffContext(context.left[index], context.right[index]);cov_g15fjodrd.s[63]++;context.push(child, index);cov_g15fjodrd.s[64]++;commonHead++;
|
2976 | }
|
2977 | cov_g15fjodrd.s[65]++;while ((cov_g15fjodrd.b[26][0]++, commonTail + commonHead < len1) && (cov_g15fjodrd.b[26][1]++, commonTail + commonHead < len2) && (cov_g15fjodrd.b[26][2]++, matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext))) {
|
2978 | cov_g15fjodrd.s[66]++;index1 = len1 - 1 - commonTail;cov_g15fjodrd.s[67]++;index2 = len2 - 1 - commonTail;cov_g15fjodrd.s[68]++;child = new DiffContext(context.left[index1], context.right[index2]);cov_g15fjodrd.s[69]++;context.push(child, index2);cov_g15fjodrd.s[70]++;commonTail++;
|
2979 | }var result = (cov_g15fjodrd.s[71]++, void 0);cov_g15fjodrd.s[72]++;if (commonHead + commonTail === len1) {
|
2980 | cov_g15fjodrd.b[27][0]++;cov_g15fjodrd.s[73]++;if (len1 === len2) {
|
2981 | cov_g15fjodrd.b[28][0]++;cov_g15fjodrd.s[74]++;
|
2982 | context.setResult(undefined).exit();cov_g15fjodrd.s[75]++;return;
|
2983 | } else {
|
2984 | cov_g15fjodrd.b[28][1]++;
|
2985 | }
|
2986 | cov_g15fjodrd.s[76]++;result = (cov_g15fjodrd.b[29][0]++, result) || (cov_g15fjodrd.b[29][1]++, { _t: 'a' });cov_g15fjodrd.s[77]++;for (index = commonHead; index < len2 - commonTail; index++) {
|
2987 | cov_g15fjodrd.s[78]++;result[index] = [array2[index]];
|
2988 | }cov_g15fjodrd.s[79]++;context.setResult(result).exit();cov_g15fjodrd.s[80]++;return;
|
2989 | } else {
|
2990 | cov_g15fjodrd.b[27][1]++;
|
2991 | }cov_g15fjodrd.s[81]++;if (commonHead + commonTail === len2) {
|
2992 | cov_g15fjodrd.b[30][0]++;cov_g15fjodrd.s[82]++;
|
2993 | result = (cov_g15fjodrd.b[31][0]++, result) || (cov_g15fjodrd.b[31][1]++, { _t: 'a' });cov_g15fjodrd.s[83]++;for (index = commonHead; index < len1 - commonTail; index++) {
|
2994 | cov_g15fjodrd.s[84]++;result['_' + index] = [array1[index], 0, 0];
|
2995 | }cov_g15fjodrd.s[85]++;context.setResult(result).exit();cov_g15fjodrd.s[86]++;return;
|
2996 | } else {
|
2997 | cov_g15fjodrd.b[30][1]++;
|
2998 | }
|
2999 | cov_g15fjodrd.s[87]++;delete matchContext.hashCache1;cov_g15fjodrd.s[88]++;delete matchContext.hashCache2;
|
3000 | var trimmed1 = (cov_g15fjodrd.s[89]++, array1.slice(commonHead, len1 - commonTail));var trimmed2 = (cov_g15fjodrd.s[90]++, array2.slice(commonHead, len2 - commonTail));var seq = (cov_g15fjodrd.s[91]++, lcs.get(trimmed1, trimmed2, matchItems, matchContext));var removedItems = (cov_g15fjodrd.s[92]++, []);cov_g15fjodrd.s[93]++;result = (cov_g15fjodrd.b[32][0]++, result) || (cov_g15fjodrd.b[32][1]++, { _t: 'a' });cov_g15fjodrd.s[94]++;for (index = commonHead; index < len1 - commonTail; index++) {
|
3001 | cov_g15fjodrd.s[95]++;if (arrayIndexOf(seq.indices1, index - commonHead) < 0) {
|
3002 | cov_g15fjodrd.b[33][0]++;cov_g15fjodrd.s[96]++;
|
3003 | result['_' + index] = [array1[index], 0, 0];cov_g15fjodrd.s[97]++;removedItems.push(index);
|
3004 | } else {
|
3005 | cov_g15fjodrd.b[33][1]++;
|
3006 | }
|
3007 | }var detectMove = (cov_g15fjodrd.s[98]++, true);cov_g15fjodrd.s[99]++;if ((cov_g15fjodrd.b[35][0]++, context.options) && (cov_g15fjodrd.b[35][1]++, context.options.arrays) && (cov_g15fjodrd.b[35][2]++, context.options.arrays.detectMove === false)) {
|
3008 | cov_g15fjodrd.b[34][0]++;cov_g15fjodrd.s[100]++;detectMove = false;
|
3009 | } else {
|
3010 | cov_g15fjodrd.b[34][1]++;
|
3011 | }var includeValueOnMove = (cov_g15fjodrd.s[101]++, false);cov_g15fjodrd.s[102]++;if ((cov_g15fjodrd.b[37][0]++, context.options) && (cov_g15fjodrd.b[37][1]++, context.options.arrays) && (cov_g15fjodrd.b[37][2]++, context.options.arrays.includeValueOnMove)) {
|
3012 | cov_g15fjodrd.b[36][0]++;cov_g15fjodrd.s[103]++;includeValueOnMove = true;
|
3013 | } else {
|
3014 | cov_g15fjodrd.b[36][1]++;
|
3015 | }var removedItemsLength = (cov_g15fjodrd.s[104]++, removedItems.length);cov_g15fjodrd.s[105]++;for (index = commonHead; index < len2 - commonTail; index++) {
|
3016 | var indexOnArray2 = (cov_g15fjodrd.s[106]++, arrayIndexOf(seq.indices2, index - commonHead));cov_g15fjodrd.s[107]++;if (indexOnArray2 < 0) {
|
3017 | cov_g15fjodrd.b[38][0]++;
|
3018 | var isMove = (cov_g15fjodrd.s[108]++, false);cov_g15fjodrd.s[109]++;if ((cov_g15fjodrd.b[40][0]++, detectMove) && (cov_g15fjodrd.b[40][1]++, removedItemsLength > 0)) {
|
3019 | cov_g15fjodrd.b[39][0]++;cov_g15fjodrd.s[110]++;for (var removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
|
3020 | cov_g15fjodrd.s[111]++;index1 = removedItems[removeItemIndex1];cov_g15fjodrd.s[112]++;if (matchItems(trimmed1, trimmed2, index1 - commonHead, index - commonHead, matchContext)) {
|
3021 | cov_g15fjodrd.b[41][0]++;cov_g15fjodrd.s[113]++;
|
3022 | result['_' + index1].splice(1, 2, index, ARRAY_MOVE);cov_g15fjodrd.s[114]++;if (!includeValueOnMove) {
|
3023 | cov_g15fjodrd.b[42][0]++;cov_g15fjodrd.s[115]++;
|
3024 | result['_' + index1][0] = '';
|
3025 | } else {
|
3026 | cov_g15fjodrd.b[42][1]++;
|
3027 | }cov_g15fjodrd.s[116]++;index2 = index;cov_g15fjodrd.s[117]++;child = new DiffContext(context.left[index1], context.right[index2]);cov_g15fjodrd.s[118]++;context.push(child, index2);cov_g15fjodrd.s[119]++;removedItems.splice(removeItemIndex1, 1);cov_g15fjodrd.s[120]++;isMove = true;cov_g15fjodrd.s[121]++;break;
|
3028 | } else {
|
3029 | cov_g15fjodrd.b[41][1]++;
|
3030 | }
|
3031 | }
|
3032 | } else {
|
3033 | cov_g15fjodrd.b[39][1]++;
|
3034 | }cov_g15fjodrd.s[122]++;if (!isMove) {
|
3035 | cov_g15fjodrd.b[43][0]++;cov_g15fjodrd.s[123]++;
|
3036 | result[index] = [array2[index]];
|
3037 | } else {
|
3038 | cov_g15fjodrd.b[43][1]++;
|
3039 | }
|
3040 | } else {
|
3041 | cov_g15fjodrd.b[38][1]++;cov_g15fjodrd.s[124]++;
|
3042 | index1 = seq.indices1[indexOnArray2] + commonHead;cov_g15fjodrd.s[125]++;index2 = seq.indices2[indexOnArray2] + commonHead;cov_g15fjodrd.s[126]++;child = new DiffContext(context.left[index1], context.right[index2]);cov_g15fjodrd.s[127]++;context.push(child, index2);
|
3043 | }
|
3044 | }cov_g15fjodrd.s[128]++;context.setResult(result).exit();
|
3045 | };cov_g15fjodrd.s[129]++;diffFilter$1.filterName = 'arrays';var compare = (cov_g15fjodrd.s[130]++, { numerically: function numerically(a, b) {
|
3046 | cov_g15fjodrd.f[6]++;cov_g15fjodrd.s[131]++;return a - b;
|
3047 | }, numericallyBy: function numericallyBy(name) {
|
3048 | cov_g15fjodrd.f[7]++;cov_g15fjodrd.s[132]++;return function (a, b) {
|
3049 | cov_g15fjodrd.f[8]++;cov_g15fjodrd.s[133]++;return a[name] - b[name];
|
3050 | };
|
3051 | } });cov_g15fjodrd.s[134]++;var patchFilter$2 = function nestedPatchFilter(context) {
|
3052 | cov_g15fjodrd.f[9]++;cov_g15fjodrd.s[135]++;if (!context.nested) {
|
3053 | cov_g15fjodrd.b[44][0]++;cov_g15fjodrd.s[136]++;return;
|
3054 | } else {
|
3055 | cov_g15fjodrd.b[44][1]++;
|
3056 | }cov_g15fjodrd.s[137]++;if (context.delta._t !== 'a') {
|
3057 | cov_g15fjodrd.b[45][0]++;cov_g15fjodrd.s[138]++;return;
|
3058 | } else {
|
3059 | cov_g15fjodrd.b[45][1]++;
|
3060 | }var index = (cov_g15fjodrd.s[139]++, void 0);var index1 = (cov_g15fjodrd.s[140]++, void 0);var delta = (cov_g15fjodrd.s[141]++, context.delta);var array = (cov_g15fjodrd.s[142]++, context.left);
|
3061 | var toRemove = (cov_g15fjodrd.s[143]++, []);var toInsert = (cov_g15fjodrd.s[144]++, []);var toModify = (cov_g15fjodrd.s[145]++, []);cov_g15fjodrd.s[146]++;for (index in delta) {
|
3062 | cov_g15fjodrd.s[147]++;if (index !== '_t') {
|
3063 | cov_g15fjodrd.b[46][0]++;cov_g15fjodrd.s[148]++;if (index[0] === '_') {
|
3064 | cov_g15fjodrd.b[47][0]++;cov_g15fjodrd.s[149]++;
|
3065 | if ((cov_g15fjodrd.b[49][0]++, delta[index][2] === 0) || (cov_g15fjodrd.b[49][1]++, delta[index][2] === ARRAY_MOVE)) {
|
3066 | cov_g15fjodrd.b[48][0]++;cov_g15fjodrd.s[150]++;toRemove.push(parseInt(index.slice(1), 10));
|
3067 | } else {
|
3068 | cov_g15fjodrd.b[48][1]++;cov_g15fjodrd.s[151]++;throw new Error('only removal or move can be applied at original array indices,' + (' invalid diff type: ' + delta[index][2]));
|
3069 | }
|
3070 | } else {
|
3071 | cov_g15fjodrd.b[47][1]++;cov_g15fjodrd.s[152]++;if (delta[index].length === 1) {
|
3072 | cov_g15fjodrd.b[50][0]++;cov_g15fjodrd.s[153]++;
|
3073 | toInsert.push({ index: parseInt(index, 10), value: delta[index][0] });
|
3074 | } else {
|
3075 | cov_g15fjodrd.b[50][1]++;cov_g15fjodrd.s[154]++;
|
3076 | toModify.push({ index: parseInt(index, 10), delta: delta[index] });
|
3077 | }
|
3078 | }
|
3079 | } else {
|
3080 | cov_g15fjodrd.b[46][1]++;
|
3081 | }
|
3082 | }
|
3083 | cov_g15fjodrd.s[155]++;toRemove = toRemove.sort(compare.numerically);cov_g15fjodrd.s[156]++;for (index = toRemove.length - 1; index >= 0; index--) {
|
3084 | cov_g15fjodrd.s[157]++;index1 = toRemove[index];var indexDiff = (cov_g15fjodrd.s[158]++, delta['_' + index1]);var removedValue = (cov_g15fjodrd.s[159]++, array.splice(index1, 1)[0]);cov_g15fjodrd.s[160]++;if (indexDiff[2] === ARRAY_MOVE) {
|
3085 | cov_g15fjodrd.b[51][0]++;cov_g15fjodrd.s[161]++;
|
3086 | toInsert.push({ index: indexDiff[1], value: removedValue });
|
3087 | } else {
|
3088 | cov_g15fjodrd.b[51][1]++;
|
3089 | }
|
3090 | }
|
3091 | cov_g15fjodrd.s[162]++;toInsert = toInsert.sort(compare.numericallyBy('index'));var toInsertLength = (cov_g15fjodrd.s[163]++, toInsert.length);cov_g15fjodrd.s[164]++;for (index = 0; index < toInsertLength; index++) {
|
3092 | var insertion = (cov_g15fjodrd.s[165]++, toInsert[index]);cov_g15fjodrd.s[166]++;array.splice(insertion.index, 0, insertion.value);
|
3093 | }
|
3094 | var toModifyLength = (cov_g15fjodrd.s[167]++, toModify.length);var child = (cov_g15fjodrd.s[168]++, void 0);cov_g15fjodrd.s[169]++;if (toModifyLength > 0) {
|
3095 | cov_g15fjodrd.b[52][0]++;cov_g15fjodrd.s[170]++;for (index = 0; index < toModifyLength; index++) {
|
3096 | var modification = (cov_g15fjodrd.s[171]++, toModify[index]);cov_g15fjodrd.s[172]++;child = new PatchContext(context.left[modification.index], modification.delta);cov_g15fjodrd.s[173]++;context.push(child, modification.index);
|
3097 | }
|
3098 | } else {
|
3099 | cov_g15fjodrd.b[52][1]++;
|
3100 | }cov_g15fjodrd.s[174]++;if (!context.children) {
|
3101 | cov_g15fjodrd.b[53][0]++;cov_g15fjodrd.s[175]++;context.setResult(context.left).exit();cov_g15fjodrd.s[176]++;return;
|
3102 | } else {
|
3103 | cov_g15fjodrd.b[53][1]++;
|
3104 | }cov_g15fjodrd.s[177]++;context.exit();
|
3105 | };cov_g15fjodrd.s[178]++;patchFilter$2.filterName = 'arrays';cov_g15fjodrd.s[179]++;var collectChildrenPatchFilter$1 = function collectChildrenPatchFilter(context) {
|
3106 | cov_g15fjodrd.f[10]++;cov_g15fjodrd.s[180]++;if ((cov_g15fjodrd.b[55][0]++, !context) || (cov_g15fjodrd.b[55][1]++, !context.children)) {
|
3107 | cov_g15fjodrd.b[54][0]++;cov_g15fjodrd.s[181]++;return;
|
3108 | } else {
|
3109 | cov_g15fjodrd.b[54][1]++;
|
3110 | }cov_g15fjodrd.s[182]++;if (context.delta._t !== 'a') {
|
3111 | cov_g15fjodrd.b[56][0]++;cov_g15fjodrd.s[183]++;return;
|
3112 | } else {
|
3113 | cov_g15fjodrd.b[56][1]++;
|
3114 | }var length = (cov_g15fjodrd.s[184]++, context.children.length);var child = (cov_g15fjodrd.s[185]++, void 0);cov_g15fjodrd.s[186]++;for (var index = 0; index < length; index++) {
|
3115 | cov_g15fjodrd.s[187]++;child = context.children[index];cov_g15fjodrd.s[188]++;context.left[child.childName] = child.result;
|
3116 | }cov_g15fjodrd.s[189]++;context.setResult(context.left).exit();
|
3117 | };cov_g15fjodrd.s[190]++;collectChildrenPatchFilter$1.filterName = 'arraysCollectChildren';cov_g15fjodrd.s[191]++;var reverseFilter$2 = function arraysReverseFilter(context) {
|
3118 | cov_g15fjodrd.f[11]++;cov_g15fjodrd.s[192]++;if (!context.nested) {
|
3119 | cov_g15fjodrd.b[57][0]++;cov_g15fjodrd.s[193]++;if (context.delta[2] === ARRAY_MOVE) {
|
3120 | cov_g15fjodrd.b[58][0]++;cov_g15fjodrd.s[194]++;context.newName = '_' + context.delta[1];cov_g15fjodrd.s[195]++;context.setResult([context.delta[0], parseInt(context.childName.substr(1), 10), ARRAY_MOVE]).exit();
|
3121 | } else {
|
3122 | cov_g15fjodrd.b[58][1]++;
|
3123 | }cov_g15fjodrd.s[196]++;return;
|
3124 | } else {
|
3125 | cov_g15fjodrd.b[57][1]++;
|
3126 | }cov_g15fjodrd.s[197]++;if (context.delta._t !== 'a') {
|
3127 | cov_g15fjodrd.b[59][0]++;cov_g15fjodrd.s[198]++;return;
|
3128 | } else {
|
3129 | cov_g15fjodrd.b[59][1]++;
|
3130 | }var name = (cov_g15fjodrd.s[199]++, void 0);var child = (cov_g15fjodrd.s[200]++, void 0);cov_g15fjodrd.s[201]++;for (name in context.delta) {
|
3131 | cov_g15fjodrd.s[202]++;if (name === '_t') {
|
3132 | cov_g15fjodrd.b[60][0]++;cov_g15fjodrd.s[203]++;continue;
|
3133 | } else {
|
3134 | cov_g15fjodrd.b[60][1]++;
|
3135 | }cov_g15fjodrd.s[204]++;child = new ReverseContext(context.delta[name]);cov_g15fjodrd.s[205]++;context.push(child, name);
|
3136 | }cov_g15fjodrd.s[206]++;context.exit();
|
3137 | };cov_g15fjodrd.s[207]++;reverseFilter$2.filterName = 'arrays';cov_g15fjodrd.s[208]++;var reverseArrayDeltaIndex = function reverseArrayDeltaIndex(delta, index, itemDelta) {
|
3138 | cov_g15fjodrd.f[12]++;cov_g15fjodrd.s[209]++;if ((cov_g15fjodrd.b[62][0]++, typeof index === 'string') && (cov_g15fjodrd.b[62][1]++, index[0] === '_')) {
|
3139 | cov_g15fjodrd.b[61][0]++;cov_g15fjodrd.s[210]++;return parseInt(index.substr(1), 10);
|
3140 | } else {
|
3141 | cov_g15fjodrd.b[61][1]++;cov_g15fjodrd.s[211]++;if ((cov_g15fjodrd.b[64][0]++, isArray$2(itemDelta)) && (cov_g15fjodrd.b[64][1]++, itemDelta[2] === 0)) {
|
3142 | cov_g15fjodrd.b[63][0]++;cov_g15fjodrd.s[212]++;return '_' + index;
|
3143 | } else {
|
3144 | cov_g15fjodrd.b[63][1]++;
|
3145 | }
|
3146 | }var reverseIndex = (cov_g15fjodrd.s[213]++, +index);cov_g15fjodrd.s[214]++;for (var deltaIndex in delta) {
|
3147 | var deltaItem = (cov_g15fjodrd.s[215]++, delta[deltaIndex]);cov_g15fjodrd.s[216]++;if (isArray$2(deltaItem)) {
|
3148 | cov_g15fjodrd.b[65][0]++;cov_g15fjodrd.s[217]++;if (deltaItem[2] === ARRAY_MOVE) {
|
3149 | cov_g15fjodrd.b[66][0]++;var moveFromIndex = (cov_g15fjodrd.s[218]++, parseInt(deltaIndex.substr(1), 10));var moveToIndex = (cov_g15fjodrd.s[219]++, deltaItem[1]);cov_g15fjodrd.s[220]++;if (moveToIndex === +index) {
|
3150 | cov_g15fjodrd.b[67][0]++;cov_g15fjodrd.s[221]++;return moveFromIndex;
|
3151 | } else {
|
3152 | cov_g15fjodrd.b[67][1]++;
|
3153 | }cov_g15fjodrd.s[222]++;if ((cov_g15fjodrd.b[69][0]++, moveFromIndex <= reverseIndex) && (cov_g15fjodrd.b[69][1]++, moveToIndex > reverseIndex)) {
|
3154 | cov_g15fjodrd.b[68][0]++;cov_g15fjodrd.s[223]++;reverseIndex++;
|
3155 | } else {
|
3156 | cov_g15fjodrd.b[68][1]++;cov_g15fjodrd.s[224]++;if ((cov_g15fjodrd.b[71][0]++, moveFromIndex >= reverseIndex) && (cov_g15fjodrd.b[71][1]++, moveToIndex < reverseIndex)) {
|
3157 | cov_g15fjodrd.b[70][0]++;cov_g15fjodrd.s[225]++;reverseIndex--;
|
3158 | } else {
|
3159 | cov_g15fjodrd.b[70][1]++;
|
3160 | }
|
3161 | }
|
3162 | } else {
|
3163 | cov_g15fjodrd.b[66][1]++;cov_g15fjodrd.s[226]++;if (deltaItem[2] === 0) {
|
3164 | cov_g15fjodrd.b[72][0]++;var deleteIndex = (cov_g15fjodrd.s[227]++, parseInt(deltaIndex.substr(1), 10));cov_g15fjodrd.s[228]++;if (deleteIndex <= reverseIndex) {
|
3165 | cov_g15fjodrd.b[73][0]++;cov_g15fjodrd.s[229]++;reverseIndex++;
|
3166 | } else {
|
3167 | cov_g15fjodrd.b[73][1]++;
|
3168 | }
|
3169 | } else {
|
3170 | cov_g15fjodrd.b[72][1]++;cov_g15fjodrd.s[230]++;if ((cov_g15fjodrd.b[75][0]++, deltaItem.length === 1) && (cov_g15fjodrd.b[75][1]++, deltaIndex <= reverseIndex)) {
|
3171 | cov_g15fjodrd.b[74][0]++;cov_g15fjodrd.s[231]++;reverseIndex--;
|
3172 | } else {
|
3173 | cov_g15fjodrd.b[74][1]++;
|
3174 | }
|
3175 | }
|
3176 | }
|
3177 | } else {
|
3178 | cov_g15fjodrd.b[65][1]++;
|
3179 | }
|
3180 | }cov_g15fjodrd.s[232]++;return reverseIndex;
|
3181 | };function collectChildrenReverseFilter$1(context) {
|
3182 | cov_g15fjodrd.f[13]++;cov_g15fjodrd.s[233]++;if ((cov_g15fjodrd.b[77][0]++, !context) || (cov_g15fjodrd.b[77][1]++, !context.children)) {
|
3183 | cov_g15fjodrd.b[76][0]++;cov_g15fjodrd.s[234]++;return;
|
3184 | } else {
|
3185 | cov_g15fjodrd.b[76][1]++;
|
3186 | }cov_g15fjodrd.s[235]++;if (context.delta._t !== 'a') {
|
3187 | cov_g15fjodrd.b[78][0]++;cov_g15fjodrd.s[236]++;return;
|
3188 | } else {
|
3189 | cov_g15fjodrd.b[78][1]++;
|
3190 | }var length = (cov_g15fjodrd.s[237]++, context.children.length);var child = (cov_g15fjodrd.s[238]++, void 0);var delta = (cov_g15fjodrd.s[239]++, { _t: 'a' });cov_g15fjodrd.s[240]++;for (var index = 0; index < length; index++) {
|
3191 | cov_g15fjodrd.s[241]++;child = context.children[index];var name = (cov_g15fjodrd.s[242]++, child.newName);cov_g15fjodrd.s[243]++;if (typeof name === 'undefined') {
|
3192 | cov_g15fjodrd.b[79][0]++;cov_g15fjodrd.s[244]++;name = reverseArrayDeltaIndex(context.delta, child.childName, child.result);
|
3193 | } else {
|
3194 | cov_g15fjodrd.b[79][1]++;
|
3195 | }cov_g15fjodrd.s[245]++;if (delta[name] !== child.result) {
|
3196 | cov_g15fjodrd.b[80][0]++;cov_g15fjodrd.s[246]++;delta[name] = child.result;
|
3197 | } else {
|
3198 | cov_g15fjodrd.b[80][1]++;
|
3199 | }
|
3200 | }cov_g15fjodrd.s[247]++;context.setResult(delta).exit();
|
3201 | }cov_g15fjodrd.s[248]++;collectChildrenReverseFilter$1.filterName = 'arraysCollectChildren';
|
3202 |
|
3203 | var cov_3rnqyacq6 = function () {
|
3204 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/dates.js',
|
3205 | hash = 'bbdf9d46e1ad60b363a5eb94ba7cef1d35ba0b6d',
|
3206 | global = new Function('return this')(),
|
3207 | gcv = '__coverage__',
|
3208 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/dates.js', statementMap: { '0': { start: { line: 1, column: 24 }, end: { line: 16, column: 1 } }, '1': { start: { line: 2, column: 2 }, end: { line: 15, column: 3 } }, '2': { start: { line: 3, column: 4 }, end: { line: 11, column: 5 } }, '3': { start: { line: 4, column: 6 }, end: { line: 8, column: 7 } }, '4': { start: { line: 5, column: 8 }, end: { line: 5, column: 57 } }, '5': { start: { line: 7, column: 8 }, end: { line: 7, column: 37 } }, '6': { start: { line: 10, column: 6 }, end: { line: 10, column: 55 } }, '7': { start: { line: 12, column: 4 }, end: { line: 12, column: 19 } }, '8': { start: { line: 13, column: 9 }, end: { line: 15, column: 3 } }, '9': { start: { line: 14, column: 4 }, end: { line: 14, column: 60 } }, '10': { start: { line: 17, column: 0 }, end: { line: 17, column: 32 } } }, fnMap: { '0': { name: 'datesDiffFilter', decl: { start: { line: 1, column: 33 }, end: { line: 1, column: 48 } }, loc: { start: { line: 1, column: 58 }, end: { line: 16, column: 1 } }, line: 1 } }, branchMap: { '0': { loc: { start: { line: 2, column: 2 }, end: { line: 15, column: 3 } }, type: 'if', locations: [{ start: { line: 2, column: 2 }, end: { line: 15, column: 3 } }, { start: { line: 2, column: 2 }, end: { line: 15, column: 3 } }], line: 2 }, '1': { loc: { start: { line: 3, column: 4 }, end: { line: 11, column: 5 } }, type: 'if', locations: [{ start: { line: 3, column: 4 }, end: { line: 11, column: 5 } }, { start: { line: 3, column: 4 }, end: { line: 11, column: 5 } }], line: 3 }, '2': { loc: { start: { line: 4, column: 6 }, end: { line: 8, column: 7 } }, type: 'if', locations: [{ start: { line: 4, column: 6 }, end: { line: 8, column: 7 } }, { start: { line: 4, column: 6 }, end: { line: 8, column: 7 } }], line: 4 }, '3': { loc: { start: { line: 13, column: 9 }, end: { line: 15, column: 3 } }, type: 'if', locations: [{ start: { line: 13, column: 9 }, end: { line: 15, column: 3 } }, { start: { line: 13, column: 9 }, end: { line: 15, column: 3 } }], line: 13 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0 }, f: { '0': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3209 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3210 | return coverage[path];
|
3211 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3212 | }();cov_3rnqyacq6.s[0]++;var diffFilter$2 = function datesDiffFilter(context) {
|
3213 | cov_3rnqyacq6.f[0]++;cov_3rnqyacq6.s[1]++;if (context.left instanceof Date) {
|
3214 | cov_3rnqyacq6.b[0][0]++;cov_3rnqyacq6.s[2]++;if (context.right instanceof Date) {
|
3215 | cov_3rnqyacq6.b[1][0]++;cov_3rnqyacq6.s[3]++;if (context.left.getTime() !== context.right.getTime()) {
|
3216 | cov_3rnqyacq6.b[2][0]++;cov_3rnqyacq6.s[4]++;context.setResult([context.left, context.right]);
|
3217 | } else {
|
3218 | cov_3rnqyacq6.b[2][1]++;cov_3rnqyacq6.s[5]++;context.setResult(undefined);
|
3219 | }
|
3220 | } else {
|
3221 | cov_3rnqyacq6.b[1][1]++;cov_3rnqyacq6.s[6]++;context.setResult([context.left, context.right]);
|
3222 | }cov_3rnqyacq6.s[7]++;context.exit();
|
3223 | } else {
|
3224 | cov_3rnqyacq6.b[0][1]++;cov_3rnqyacq6.s[8]++;if (context.right instanceof Date) {
|
3225 | cov_3rnqyacq6.b[3][0]++;cov_3rnqyacq6.s[9]++;context.setResult([context.left, context.right]).exit();
|
3226 | } else {
|
3227 | cov_3rnqyacq6.b[3][1]++;
|
3228 | }
|
3229 | }
|
3230 | };cov_3rnqyacq6.s[10]++;diffFilter$2.filterName = 'dates';
|
3231 |
|
3232 | var cov_270vbx2d41 = function () {
|
3233 | var path = '/Users/benja/proj/jsondiffpatch/src/filters/texts.js',
|
3234 | hash = '59929f1555c4391f2e3d74f8d1151ee41dfa1702',
|
3235 | global = new Function('return this')(),
|
3236 | gcv = '__coverage__',
|
3237 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/filters/texts.js', statementMap: { '0': { start: { line: 4, column: 16 }, end: { line: 4, column: 17 } }, '1': { start: { line: 5, column: 25 }, end: { line: 5, column: 27 } }, '2': { start: { line: 6, column: 22 }, end: { line: 6, column: 26 } }, '3': { start: { line: 8, column: 24 }, end: { line: 51, column: 1 } }, '4': { start: { line: 11, column: 2 }, end: { line: 49, column: 3 } }, '5': { start: { line: 12, column: 19 }, end: { line: 12, column: 25 } }, '6': { start: { line: 14, column: 4 }, end: { line: 23, column: 5 } }, '7': { start: { line: 16, column: 6 }, end: { line: 16, column: 123 } }, '8': { start: { line: 17, column: 11 }, end: { line: 23, column: 5 } }, '9': { start: { line: 18, column: 6 }, end: { line: 22, column: 7 } }, '10': { start: { line: 19, column: 8 }, end: { line: 19, column: 36 } }, '11': { start: { line: 21, column: 8 }, end: { line: 21, column: 24 } }, '12': { start: { line: 25, column: 4 }, end: { line: 33, column: 5 } }, '13': { start: { line: 26, column: 6 }, end: { line: 28, column: 7 } }, '14': { start: { line: 27, column: 8 }, end: { line: 27, column: 20 } }, '15': { start: { line: 29, column: 18 }, end: { line: 29, column: 70 } }, '16': { start: { line: 31, column: 6 }, end: { line: 31, column: 46 } }, '17': { start: { line: 32, column: 6 }, end: { line: 32, column: 18 } }, '18': { start: { line: 34, column: 4 }, end: { line: 48, column: 6 } }, '19': { start: { line: 36, column: 8 }, end: { line: 36, column: 70 } }, '20': { start: { line: 39, column: 22 }, end: { line: 39, column: 81 } }, '21': { start: { line: 40, column: 8 }, end: { line: 45, column: 9 } }, '22': { start: { line: 41, column: 10 }, end: { line: 44, column: 11 } }, '23': { start: { line: 42, column: 25 }, end: { line: 42, column: 55 } }, '24': { start: { line: 43, column: 12 }, end: { line: 43, column: 42 } }, '25': { start: { line: 46, column: 8 }, end: { line: 46, column: 26 } }, '26': { start: { line: 50, column: 2 }, end: { line: 50, column: 25 } }, '27': { start: { line: 53, column: 24 }, end: { line: 72, column: 1 } }, '28': { start: { line: 54, column: 2 }, end: { line: 56, column: 3 } }, '29': { start: { line: 55, column: 4 }, end: { line: 55, column: 11 } }, '30': { start: { line: 57, column: 18 }, end: { line: 57, column: 121 } }, '31': { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, '32': { start: { line: 59, column: 4 }, end: { line: 59, column: 60 } }, '33': { start: { line: 60, column: 4 }, end: { line: 60, column: 11 } }, '34': { start: { line: 63, column: 23 }, end: { line: 63, column: 42 } }, '35': { start: { line: 64, column: 2 }, end: { line: 69, column: 3 } }, '36': { start: { line: 67, column: 4 }, end: { line: 67, column: 60 } }, '37': { start: { line: 68, column: 4 }, end: { line: 68, column: 11 } }, '38': { start: { line: 70, column: 13 }, end: { line: 70, column: 32 } }, '39': { start: { line: 71, column: 2 }, end: { line: 71, column: 78 } }, '40': { start: { line: 73, column: 0 }, end: { line: 73, column: 32 } }, '41': { start: { line: 75, column: 25 }, end: { line: 86, column: 1 } }, '42': { start: { line: 76, column: 2 }, end: { line: 78, column: 3 } }, '43': { start: { line: 77, column: 4 }, end: { line: 77, column: 11 } }, '44': { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, '45': { start: { line: 80, column: 4 }, end: { line: 80, column: 11 } }, '46': { start: { line: 84, column: 14 }, end: { line: 84, column: 43 } }, '47': { start: { line: 85, column: 2 }, end: { line: 85, column: 66 } }, '48': { start: { line: 87, column: 0 }, end: { line: 87, column: 33 } }, '49': { start: { line: 89, column: 23 }, end: { line: 121, column: 1 } }, '50': { start: { line: 90, column: 10 }, end: { line: 90, column: 16 } }, '51': { start: { line: 91, column: 10 }, end: { line: 91, column: 16 } }, '52': { start: { line: 92, column: 14 }, end: { line: 92, column: 20 } }, '53': { start: { line: 93, column: 13 }, end: { line: 93, column: 19 } }, '54': { start: { line: 94, column: 16 }, end: { line: 94, column: 22 } }, '55': { start: { line: 95, column: 15 }, end: { line: 95, column: 19 } }, '56': { start: { line: 96, column: 20 }, end: { line: 96, column: 59 } }, '57': { start: { line: 97, column: 19 }, end: { line: 97, column: 25 } }, '58': { start: { line: 98, column: 2 }, end: { line: 98, column: 28 } }, '59': { start: { line: 99, column: 2 }, end: { line: 119, column: 3 } }, '60': { start: { line: 100, column: 4 }, end: { line: 100, column: 20 } }, '61': { start: { line: 101, column: 20 }, end: { line: 101, column: 36 } }, '62': { start: { line: 102, column: 4 }, end: { line: 118, column: 5 } }, '63': { start: { line: 103, column: 6 }, end: { line: 103, column: 38 } }, '64': { start: { line: 104, column: 6 }, end: { line: 104, column: 21 } }, '65': { start: { line: 107, column: 6 }, end: { line: 107, column: 108 } }, '66': { start: { line: 108, column: 11 }, end: { line: 118, column: 5 } }, '67': { start: { line: 109, column: 6 }, end: { line: 109, column: 41 } }, '68': { start: { line: 110, column: 6 }, end: { line: 115, column: 7 } }, '69': { start: { line: 112, column: 8 }, end: { line: 112, column: 27 } }, '70': { start: { line: 113, column: 8 }, end: { line: 113, column: 32 } }, '71': { start: { line: 114, column: 8 }, end: { line: 114, column: 31 } }, '72': { start: { line: 116, column: 11 }, end: { line: 118, column: 5 } }, '73': { start: { line: 117, column: 6 }, end: { line: 117, column: 41 } }, '74': { start: { line: 120, column: 2 }, end: { line: 120, column: 26 } }, '75': { start: { line: 123, column: 27 }, end: { line: 133, column: 1 } }, '76': { start: { line: 124, column: 2 }, end: { line: 126, column: 3 } }, '77': { start: { line: 125, column: 4 }, end: { line: 125, column: 11 } }, '78': { start: { line: 127, column: 2 }, end: { line: 129, column: 3 } }, '79': { start: { line: 128, column: 4 }, end: { line: 128, column: 11 } }, '80': { start: { line: 132, column: 2 }, end: { line: 132, column: 79 } }, '81': { start: { line: 134, column: 0 }, end: { line: 134, column: 35 } } }, fnMap: { '0': { name: 'getDiffMatchPatch', decl: { start: { line: 8, column: 33 }, end: { line: 8, column: 50 } }, loc: { start: { line: 8, column: 61 }, end: { line: 51, column: 1 } }, line: 8 }, '1': { name: 'diff', decl: { start: { line: 35, column: 21 }, end: { line: 35, column: 25 } }, loc: { start: { line: 35, column: 38 }, end: { line: 37, column: 7 } }, line: 35 }, '2': { name: 'patch', decl: { start: { line: 38, column: 22 }, end: { line: 38, column: 27 } }, loc: { start: { line: 38, column: 42 }, end: { line: 47, column: 7 } }, line: 38 }, '3': { name: 'textsDiffFilter', decl: { start: { line: 53, column: 33 }, end: { line: 53, column: 48 } }, loc: { start: { line: 53, column: 58 }, end: { line: 72, column: 1 } }, line: 53 }, '4': { name: 'textsPatchFilter', decl: { start: { line: 75, column: 34 }, end: { line: 75, column: 50 } }, loc: { start: { line: 75, column: 60 }, end: { line: 86, column: 1 } }, line: 75 }, '5': { name: 'textDeltaReverse', decl: { start: { line: 89, column: 32 }, end: { line: 89, column: 48 } }, loc: { start: { line: 89, column: 56 }, end: { line: 121, column: 1 } }, line: 89 }, '6': { name: 'textsReverseFilter', decl: { start: { line: 123, column: 36 }, end: { line: 123, column: 54 } }, loc: { start: { line: 123, column: 64 }, end: { line: 133, column: 1 } }, line: 123 } }, branchMap: { '0': { loc: { start: { line: 11, column: 2 }, end: { line: 49, column: 3 } }, type: 'if', locations: [{ start: { line: 11, column: 2 }, end: { line: 49, column: 3 } }, { start: { line: 11, column: 2 }, end: { line: 49, column: 3 } }], line: 11 }, '1': { loc: { start: { line: 14, column: 4 }, end: { line: 23, column: 5 } }, type: 'if', locations: [{ start: { line: 14, column: 4 }, end: { line: 23, column: 5 } }, { start: { line: 14, column: 4 }, end: { line: 23, column: 5 } }], line: 14 }, '2': { loc: { start: { line: 16, column: 17 }, end: { line: 16, column: 122 } }, type: 'cond-expr', locations: [{ start: { line: 16, column: 58 }, end: { line: 16, column: 80 } }, { start: { line: 16, column: 83 }, end: { line: 16, column: 122 } }], line: 16 }, '3': { loc: { start: { line: 17, column: 11 }, end: { line: 23, column: 5 } }, type: 'if', locations: [{ start: { line: 17, column: 11 }, end: { line: 23, column: 5 } }, { start: { line: 17, column: 11 }, end: { line: 23, column: 5 } }], line: 17 }, '4': { loc: { start: { line: 19, column: 19 }, end: { line: 19, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 19, column: 19 }, end: { line: 19, column: 22 } }, { start: { line: 19, column: 26 }, end: { line: 19, column: 35 } }], line: 19 }, '5': { loc: { start: { line: 25, column: 4 }, end: { line: 33, column: 5 } }, type: 'if', locations: [{ start: { line: 25, column: 4 }, end: { line: 33, column: 5 } }, { start: { line: 25, column: 4 }, end: { line: 33, column: 5 } }], line: 25 }, '6': { loc: { start: { line: 26, column: 6 }, end: { line: 28, column: 7 } }, type: 'if', locations: [{ start: { line: 26, column: 6 }, end: { line: 28, column: 7 } }, { start: { line: 26, column: 6 }, end: { line: 28, column: 7 } }], line: 26 }, '7': { loc: { start: { line: 41, column: 10 }, end: { line: 44, column: 11 } }, type: 'if', locations: [{ start: { line: 41, column: 10 }, end: { line: 44, column: 11 } }, { start: { line: 41, column: 10 }, end: { line: 44, column: 11 } }], line: 41 }, '8': { loc: { start: { line: 54, column: 2 }, end: { line: 56, column: 3 } }, type: 'if', locations: [{ start: { line: 54, column: 2 }, end: { line: 56, column: 3 } }, { start: { line: 54, column: 2 }, end: { line: 56, column: 3 } }], line: 54 }, '9': { loc: { start: { line: 57, column: 18 }, end: { line: 57, column: 121 } }, type: 'binary-expr', locations: [{ start: { line: 57, column: 18 }, end: { line: 57, column: 33 } }, { start: { line: 57, column: 37 }, end: { line: 57, column: 61 } }, { start: { line: 57, column: 65 }, end: { line: 57, column: 99 } }, { start: { line: 57, column: 103 }, end: { line: 57, column: 121 } }], line: 57 }, '10': { loc: { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, type: 'if', locations: [{ start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }, { start: { line: 58, column: 2 }, end: { line: 61, column: 3 } }], line: 58 }, '11': { loc: { start: { line: 58, column: 6 }, end: { line: 58, column: 73 } }, type: 'binary-expr', locations: [{ start: { line: 58, column: 6 }, end: { line: 58, column: 37 } }, { start: { line: 58, column: 41 }, end: { line: 58, column: 73 } }], line: 58 }, '12': { loc: { start: { line: 64, column: 2 }, end: { line: 69, column: 3 } }, type: 'if', locations: [{ start: { line: 64, column: 2 }, end: { line: 69, column: 3 } }, { start: { line: 64, column: 2 }, end: { line: 69, column: 3 } }], line: 64 }, '13': { loc: { start: { line: 76, column: 2 }, end: { line: 78, column: 3 } }, type: 'if', locations: [{ start: { line: 76, column: 2 }, end: { line: 78, column: 3 } }, { start: { line: 76, column: 2 }, end: { line: 78, column: 3 } }], line: 76 }, '14': { loc: { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, type: 'if', locations: [{ start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }, { start: { line: 79, column: 2 }, end: { line: 81, column: 3 } }], line: 79 }, '15': { loc: { start: { line: 102, column: 4 }, end: { line: 118, column: 5 } }, type: 'if', locations: [{ start: { line: 102, column: 4 }, end: { line: 118, column: 5 } }, { start: { line: 102, column: 4 }, end: { line: 118, column: 5 } }], line: 102 }, '16': { loc: { start: { line: 108, column: 11 }, end: { line: 118, column: 5 } }, type: 'if', locations: [{ start: { line: 108, column: 11 }, end: { line: 118, column: 5 } }, { start: { line: 108, column: 11 }, end: { line: 118, column: 5 } }], line: 108 }, '17': { loc: { start: { line: 110, column: 6 }, end: { line: 115, column: 7 } }, type: 'if', locations: [{ start: { line: 110, column: 6 }, end: { line: 115, column: 7 } }, { start: { line: 110, column: 6 }, end: { line: 115, column: 7 } }], line: 110 }, '18': { loc: { start: { line: 116, column: 11 }, end: { line: 118, column: 5 } }, type: 'if', locations: [{ start: { line: 116, column: 11 }, end: { line: 118, column: 5 } }, { start: { line: 116, column: 11 }, end: { line: 118, column: 5 } }], line: 116 }, '19': { loc: { start: { line: 124, column: 2 }, end: { line: 126, column: 3 } }, type: 'if', locations: [{ start: { line: 124, column: 2 }, end: { line: 126, column: 3 } }, { start: { line: 124, column: 2 }, end: { line: 126, column: 3 } }], line: 124 }, '20': { loc: { start: { line: 127, column: 2 }, end: { line: 129, column: 3 } }, type: 'if', locations: [{ start: { line: 127, column: 2 }, end: { line: 129, column: 3 } }, { start: { line: 127, column: 2 }, end: { line: 129, column: 3 } }], line: 127 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0, 0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3238 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3239 | return coverage[path];
|
3240 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3241 | }(); var TEXT_DIFF = (cov_270vbx2d41.s[0]++, 2);var DEFAULT_MIN_LENGTH = (cov_270vbx2d41.s[1]++, 60);var cachedDiffPatch = (cov_270vbx2d41.s[2]++, null);cov_270vbx2d41.s[3]++;var getDiffMatchPatch = function getDiffMatchPatch(required) {
|
3242 | cov_270vbx2d41.f[0]++;cov_270vbx2d41.s[4]++; if (!cachedDiffPatch) {
|
3243 | cov_270vbx2d41.b[0][0]++;var instance = (cov_270vbx2d41.s[5]++, void 0); cov_270vbx2d41.s[6]++;if (typeof diff_match_patch !== 'undefined') {
|
3244 | cov_270vbx2d41.b[1][0]++;cov_270vbx2d41.s[7]++;
|
3245 | instance = typeof diff_match_patch === 'function' ? (cov_270vbx2d41.b[2][0]++, new diff_match_patch()) : (cov_270vbx2d41.b[2][1]++, new diff_match_patch.diff_match_patch());
|
3246 | } else {
|
3247 | cov_270vbx2d41.b[1][1]++;cov_270vbx2d41.s[8]++;if (diffMatchPatch) {
|
3248 | cov_270vbx2d41.b[3][0]++;cov_270vbx2d41.s[9]++;try {
|
3249 | cov_270vbx2d41.s[10]++;instance = (cov_270vbx2d41.b[4][0]++, diffMatchPatch) && (cov_270vbx2d41.b[4][1]++, new diffMatchPatch());
|
3250 | } catch (err) {
|
3251 | cov_270vbx2d41.s[11]++;instance = null;
|
3252 | }
|
3253 | } else {
|
3254 | cov_270vbx2d41.b[3][1]++;
|
3255 | }
|
3256 | } cov_270vbx2d41.s[12]++;if (!instance) {
|
3257 | cov_270vbx2d41.b[5][0]++;cov_270vbx2d41.s[13]++;if (!required) {
|
3258 | cov_270vbx2d41.b[6][0]++;cov_270vbx2d41.s[14]++;return null;
|
3259 | } else {
|
3260 | cov_270vbx2d41.b[6][1]++;
|
3261 | }var error = (cov_270vbx2d41.s[15]++, new Error('text diff_match_patch library not found'));
|
3262 | cov_270vbx2d41.s[16]++;error.diff_match_patch_not_found = true;cov_270vbx2d41.s[17]++;throw error;
|
3263 | } else {
|
3264 | cov_270vbx2d41.b[5][1]++;
|
3265 | }cov_270vbx2d41.s[18]++;cachedDiffPatch = { diff: function diff(txt1, txt2) {
|
3266 | cov_270vbx2d41.f[1]++;cov_270vbx2d41.s[19]++;return instance.patch_toText(instance.patch_make(txt1, txt2));
|
3267 | }, patch: function patch(txt1, _patch) {
|
3268 | cov_270vbx2d41.f[2]++;var results = (cov_270vbx2d41.s[20]++, instance.patch_apply(instance.patch_fromText(_patch), txt1));cov_270vbx2d41.s[21]++;for (var i = 0; i < results[1].length; i++) {
|
3269 | cov_270vbx2d41.s[22]++;if (!results[1][i]) {
|
3270 | cov_270vbx2d41.b[7][0]++;var _error = (cov_270vbx2d41.s[23]++, new Error('text patch failed'));cov_270vbx2d41.s[24]++;_error.textPatchFailed = true;
|
3271 | } else {
|
3272 | cov_270vbx2d41.b[7][1]++;
|
3273 | }
|
3274 | }cov_270vbx2d41.s[25]++;return results[0];
|
3275 | } };
|
3276 | } else {
|
3277 | cov_270vbx2d41.b[0][1]++;
|
3278 | }cov_270vbx2d41.s[26]++;return cachedDiffPatch;
|
3279 | };cov_270vbx2d41.s[27]++;var diffFilter$3 = function textsDiffFilter(context) {
|
3280 | cov_270vbx2d41.f[3]++;cov_270vbx2d41.s[28]++;if (context.leftType !== 'string') {
|
3281 | cov_270vbx2d41.b[8][0]++;cov_270vbx2d41.s[29]++;return;
|
3282 | } else {
|
3283 | cov_270vbx2d41.b[8][1]++;
|
3284 | }var minLength = (cov_270vbx2d41.s[30]++, (cov_270vbx2d41.b[9][0]++, context.options) && (cov_270vbx2d41.b[9][1]++, context.options.textDiff) && (cov_270vbx2d41.b[9][2]++, context.options.textDiff.minLength) || (cov_270vbx2d41.b[9][3]++, DEFAULT_MIN_LENGTH));cov_270vbx2d41.s[31]++;if ((cov_270vbx2d41.b[11][0]++, context.left.length < minLength) || (cov_270vbx2d41.b[11][1]++, context.right.length < minLength)) {
|
3285 | cov_270vbx2d41.b[10][0]++;cov_270vbx2d41.s[32]++;context.setResult([context.left, context.right]).exit();cov_270vbx2d41.s[33]++;return;
|
3286 | } else {
|
3287 | cov_270vbx2d41.b[10][1]++;
|
3288 | }
|
3289 | var diffMatchPatch$$1 = (cov_270vbx2d41.s[34]++, getDiffMatchPatch());cov_270vbx2d41.s[35]++;if (!diffMatchPatch$$1) {
|
3290 | cov_270vbx2d41.b[12][0]++;cov_270vbx2d41.s[36]++;
|
3291 |
|
3292 | context.setResult([context.left, context.right]).exit();cov_270vbx2d41.s[37]++;return;
|
3293 | } else {
|
3294 | cov_270vbx2d41.b[12][1]++;
|
3295 | }var diff = (cov_270vbx2d41.s[38]++, diffMatchPatch$$1.diff);cov_270vbx2d41.s[39]++;context.setResult([diff(context.left, context.right), 0, TEXT_DIFF]).exit();
|
3296 | };cov_270vbx2d41.s[40]++;diffFilter$3.filterName = 'texts';cov_270vbx2d41.s[41]++;var patchFilter$3 = function textsPatchFilter(context) {
|
3297 | cov_270vbx2d41.f[4]++;cov_270vbx2d41.s[42]++;if (context.nested) {
|
3298 | cov_270vbx2d41.b[13][0]++;cov_270vbx2d41.s[43]++;return;
|
3299 | } else {
|
3300 | cov_270vbx2d41.b[13][1]++;
|
3301 | }cov_270vbx2d41.s[44]++;if (context.delta[2] !== TEXT_DIFF) {
|
3302 | cov_270vbx2d41.b[14][0]++;cov_270vbx2d41.s[45]++;return;
|
3303 | } else {
|
3304 | cov_270vbx2d41.b[14][1]++;
|
3305 | }
|
3306 | var patch = (cov_270vbx2d41.s[46]++, getDiffMatchPatch(true).patch);cov_270vbx2d41.s[47]++;context.setResult(patch(context.left, context.delta[0])).exit();
|
3307 | };cov_270vbx2d41.s[48]++;patchFilter$3.filterName = 'texts';cov_270vbx2d41.s[49]++;var textDeltaReverse = function textDeltaReverse(delta) {
|
3308 | cov_270vbx2d41.f[5]++;var i = (cov_270vbx2d41.s[50]++, void 0);var l = (cov_270vbx2d41.s[51]++, void 0);var lines = (cov_270vbx2d41.s[52]++, void 0);var line = (cov_270vbx2d41.s[53]++, void 0);var lineTmp = (cov_270vbx2d41.s[54]++, void 0);var header = (cov_270vbx2d41.s[55]++, null);var headerRegex = (cov_270vbx2d41.s[56]++, /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/);var lineHeader = (cov_270vbx2d41.s[57]++, void 0);cov_270vbx2d41.s[58]++;lines = delta.split('\n');cov_270vbx2d41.s[59]++;for (i = 0, l = lines.length; i < l; i++) {
|
3309 | cov_270vbx2d41.s[60]++;line = lines[i];var lineStart = (cov_270vbx2d41.s[61]++, line.slice(0, 1));cov_270vbx2d41.s[62]++;if (lineStart === '@') {
|
3310 | cov_270vbx2d41.b[15][0]++;cov_270vbx2d41.s[63]++;header = headerRegex.exec(line);cov_270vbx2d41.s[64]++;lineHeader = i;
|
3311 | cov_270vbx2d41.s[65]++;lines[lineHeader] = '@@ -' + header[3] + ',' + header[4] + ' +' + header[1] + ',' + header[2] + ' @@';
|
3312 | } else {
|
3313 | cov_270vbx2d41.b[15][1]++;cov_270vbx2d41.s[66]++;if (lineStart === '+') {
|
3314 | cov_270vbx2d41.b[16][0]++;cov_270vbx2d41.s[67]++;lines[i] = '-' + lines[i].slice(1);cov_270vbx2d41.s[68]++;if (lines[i - 1].slice(0, 1) === '+') {
|
3315 | cov_270vbx2d41.b[17][0]++;cov_270vbx2d41.s[69]++;
|
3316 | lineTmp = lines[i];cov_270vbx2d41.s[70]++;lines[i] = lines[i - 1];cov_270vbx2d41.s[71]++;lines[i - 1] = lineTmp;
|
3317 | } else {
|
3318 | cov_270vbx2d41.b[17][1]++;
|
3319 | }
|
3320 | } else {
|
3321 | cov_270vbx2d41.b[16][1]++;cov_270vbx2d41.s[72]++;if (lineStart === '-') {
|
3322 | cov_270vbx2d41.b[18][0]++;cov_270vbx2d41.s[73]++;lines[i] = '+' + lines[i].slice(1);
|
3323 | } else {
|
3324 | cov_270vbx2d41.b[18][1]++;
|
3325 | }
|
3326 | }
|
3327 | }
|
3328 | }cov_270vbx2d41.s[74]++;return lines.join('\n');
|
3329 | };cov_270vbx2d41.s[75]++;var reverseFilter$3 = function textsReverseFilter(context) {
|
3330 | cov_270vbx2d41.f[6]++;cov_270vbx2d41.s[76]++;if (context.nested) {
|
3331 | cov_270vbx2d41.b[19][0]++;cov_270vbx2d41.s[77]++;return;
|
3332 | } else {
|
3333 | cov_270vbx2d41.b[19][1]++;
|
3334 | }cov_270vbx2d41.s[78]++;if (context.delta[2] !== TEXT_DIFF) {
|
3335 | cov_270vbx2d41.b[20][0]++;cov_270vbx2d41.s[79]++;return;
|
3336 | } else {
|
3337 | cov_270vbx2d41.b[20][1]++;
|
3338 | }
|
3339 | cov_270vbx2d41.s[80]++;context.setResult([textDeltaReverse(context.delta[0]), 0, TEXT_DIFF]).exit();
|
3340 | };cov_270vbx2d41.s[81]++;reverseFilter$3.filterName = 'texts';
|
3341 |
|
3342 | var cov_1oxpk51fyz = function () {
|
3343 | var path = '/Users/benja/proj/jsondiffpatch/src/diffpatcher.js',
|
3344 | hash = 'afb73d8bb84427cf6d05cac032da70bc57baca2b',
|
3345 | global = new Function('return this')(),
|
3346 | gcv = '__coverage__',
|
3347 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/diffpatcher.js', statementMap: { '0': { start: { line: 14, column: 18 }, end: { line: 58, column: 3 } }, '1': { start: { line: 16, column: 4 }, end: { line: 16, column: 51 } }, '2': { start: { line: 18, column: 4 }, end: { line: 18, column: 44 } }, '3': { start: { line: 19, column: 4 }, end: { line: 19, column: 203 } }, '4': { start: { line: 20, column: 4 }, end: { line: 20, column: 219 } }, '5': { start: { line: 21, column: 4 }, end: { line: 21, column: 233 } }, '6': { start: { line: 24, column: 2 }, end: { line: 56, column: 6 } }, '7': { start: { line: 29, column: 6 }, end: { line: 29, column: 80 } }, '8': { start: { line: 34, column: 6 }, end: { line: 34, column: 66 } }, '9': { start: { line: 39, column: 6 }, end: { line: 39, column: 67 } }, '10': { start: { line: 44, column: 6 }, end: { line: 44, column: 63 } }, '11': { start: { line: 49, column: 6 }, end: { line: 49, column: 52 } }, '12': { start: { line: 54, column: 6 }, end: { line: 54, column: 27 } }, '13': { start: { line: 57, column: 2 }, end: { line: 57, column: 21 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 14, column: 18 }, end: { line: 14, column: 19 } }, loc: { start: { line: 14, column: 30 }, end: { line: 58, column: 1 } }, line: 14 }, '1': { name: 'DiffPatcher', decl: { start: { line: 15, column: 11 }, end: { line: 15, column: 22 } }, loc: { start: { line: 15, column: 32 }, end: { line: 22, column: 3 } }, line: 15 }, '2': { name: 'options', decl: { start: { line: 26, column: 20 }, end: { line: 26, column: 27 } }, loc: { start: { line: 26, column: 30 }, end: { line: 30, column: 5 } }, line: 26 }, '3': { name: 'diff', decl: { start: { line: 33, column: 20 }, end: { line: 33, column: 24 } }, loc: { start: { line: 33, column: 38 }, end: { line: 35, column: 5 } }, line: 33 }, '4': { name: 'patch', decl: { start: { line: 38, column: 20 }, end: { line: 38, column: 25 } }, loc: { start: { line: 38, column: 39 }, end: { line: 40, column: 5 } }, line: 38 }, '5': { name: 'reverse', decl: { start: { line: 43, column: 20 }, end: { line: 43, column: 27 } }, loc: { start: { line: 43, column: 35 }, end: { line: 45, column: 5 } }, line: 43 }, '6': { name: 'unpatch', decl: { start: { line: 48, column: 20 }, end: { line: 48, column: 27 } }, loc: { start: { line: 48, column: 42 }, end: { line: 50, column: 5 } }, line: 48 }, '7': { name: 'clone', decl: { start: { line: 53, column: 20 }, end: { line: 53, column: 25 } }, loc: { start: { line: 53, column: 33 }, end: { line: 55, column: 5 } }, line: 53 } }, branchMap: {}, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0 }, b: {}, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3348 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3349 | return coverage[path];
|
3350 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3351 | }();var DiffPatcher = (cov_1oxpk51fyz.s[0]++, function () {
|
3352 | cov_1oxpk51fyz.f[0]++;function DiffPatcher(options) {
|
3353 | cov_1oxpk51fyz.f[1]++;cov_1oxpk51fyz.s[1]++;classCallCheck$1(this, DiffPatcher);cov_1oxpk51fyz.s[2]++;this.processor = new Processor(options);cov_1oxpk51fyz.s[3]++;this.processor.pipe(new Pipe('diff').append(collectChildrenDiffFilter, diffFilter, diffFilter$2, diffFilter$3, objectsDiffFilter, diffFilter$1).shouldHaveResult());cov_1oxpk51fyz.s[4]++;this.processor.pipe(new Pipe('patch').append(collectChildrenPatchFilter, collectChildrenPatchFilter$1, patchFilter, patchFilter$3, patchFilter$1, patchFilter$2).shouldHaveResult());cov_1oxpk51fyz.s[5]++;this.processor.pipe(new Pipe('reverse').append(collectChildrenReverseFilter, collectChildrenReverseFilter$1, reverseFilter, reverseFilter$3, reverseFilter$1, reverseFilter$2).shouldHaveResult());
|
3354 | }cov_1oxpk51fyz.s[6]++;createClass$1(DiffPatcher, [{ key: 'options', value: function options() {
|
3355 | cov_1oxpk51fyz.f[2]++;var _processor;cov_1oxpk51fyz.s[7]++;return (_processor = this.processor).options.apply(_processor, arguments);
|
3356 | } }, { key: 'diff', value: function diff(left, right) {
|
3357 | cov_1oxpk51fyz.f[3]++;cov_1oxpk51fyz.s[8]++;return this.processor.process(new DiffContext(left, right));
|
3358 | } }, { key: 'patch', value: function patch(left, delta) {
|
3359 | cov_1oxpk51fyz.f[4]++;cov_1oxpk51fyz.s[9]++;return this.processor.process(new PatchContext(left, delta));
|
3360 | } }, { key: 'reverse', value: function reverse(delta) {
|
3361 | cov_1oxpk51fyz.f[5]++;cov_1oxpk51fyz.s[10]++;return this.processor.process(new ReverseContext(delta));
|
3362 | } }, { key: 'unpatch', value: function unpatch(right, delta) {
|
3363 | cov_1oxpk51fyz.f[6]++;cov_1oxpk51fyz.s[11]++;return this.patch(right, this.reverse(delta));
|
3364 | } }, { key: 'clone', value: function clone$$1(value) {
|
3365 | cov_1oxpk51fyz.f[7]++;cov_1oxpk51fyz.s[12]++;return clone(value);
|
3366 | } }]);cov_1oxpk51fyz.s[13]++;return DiffPatcher;
|
3367 | }());
|
3368 |
|
3369 | var cov_1ac9yxw2a1 = function () {
|
3370 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/base.js',
|
3371 | hash = '9122c1b3145bac8ced2066a881aa40d08fca69c2',
|
3372 | global = new Function('return this')(),
|
3373 | gcv = '__coverage__',
|
3374 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/base.js', statementMap: { '0': { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, '1': { start: { line: 2, column: 2 }, end: { line: 2, column: 28 } }, '2': { start: { line: 5, column: 20 }, end: { line: 15, column: 1 } }, '3': { start: { line: 6, column: 2 }, end: { line: 6, column: 26 } }, '4': { start: { line: 8, column: 14 }, end: { line: 8, column: 16 } }, '5': { start: { line: 9, column: 2 }, end: { line: 13, column: 3 } }, '6': { start: { line: 10, column: 4 }, end: { line: 12, column: 5 } }, '7': { start: { line: 11, column: 6 }, end: { line: 11, column: 27 } }, '8': { start: { line: 14, column: 2 }, end: { line: 14, column: 15 } }, '9': { start: { line: 17, column: 21 }, end: { line: 22, column: 1 } }, '10': { start: { line: 18, column: 2 }, end: { line: 20, column: 3 } }, '11': { start: { line: 19, column: 4 }, end: { line: 19, column: 24 } }, '12': { start: { line: 21, column: 2 }, end: { line: 21, column: 13 } }, '13': { start: { line: 24, column: 27 }, end: { line: 34, column: 1 } }, '14': { start: { line: 25, column: 2 }, end: { line: 33, column: 3 } }, '15': { start: { line: 26, column: 4 }, end: { line: 26, column: 14 } }, '16': { start: { line: 28, column: 4 }, end: { line: 32, column: 5 } }, '17': { start: { line: 29, column: 6 }, end: { line: 29, column: 40 } }, '18': { start: { line: 31, column: 6 }, end: { line: 31, column: 37 } }, '19': { start: { line: 36, column: 23 }, end: { line: 38, column: 1 } }, '20': { start: { line: 37, column: 2 }, end: { line: 37, column: 65 } }, '21': { start: { line: 40, column: 20 }, end: { line: 242, column: 3 } }, '22': { start: { line: 42, column: 4 }, end: { line: 42, column: 53 } }, '23': { start: { line: 45, column: 2 }, end: { line: 240, column: 6 } }, '24': { start: { line: 48, column: 20 }, end: { line: 48, column: 22 } }, '25': { start: { line: 49, column: 6 }, end: { line: 49, column: 35 } }, '26': { start: { line: 50, column: 6 }, end: { line: 50, column: 41 } }, '27': { start: { line: 51, column: 6 }, end: { line: 51, column: 36 } }, '28': { start: { line: 56, column: 6 }, end: { line: 56, column: 26 } }, '29': { start: { line: 57, column: 6 }, end: { line: 61, column: 8 } }, '30': { start: { line: 60, column: 8 }, end: { line: 60, column: 63 } }, '31': { start: { line: 66, column: 6 }, end: { line: 66, column: 64 } }, '32': { start: { line: 71, column: 6 }, end: { line: 71, column: 28 } }, '33': { start: { line: 76, column: 19 }, end: { line: 76, column: 30 } }, '34': { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, '35': { start: { line: 79, column: 8 }, end: { line: 79, column: 31 } }, '36': { start: { line: 85, column: 30 }, end: { line: 85, column: 48 } }, '37': { start: { line: 86, column: 22 }, end: { line: 86, column: 64 } }, '38': { start: { line: 88, column: 6 }, end: { line: 90, column: 7 } }, '39': { start: { line: 89, column: 8 }, end: { line: 89, column: 25 } }, '40': { start: { line: 92, column: 17 }, end: { line: 92, column: 52 } }, '41': { start: { line: 93, column: 21 }, end: { line: 93, column: 81 } }, '42': { start: { line: 95, column: 6 }, end: { line: 99, column: 7 } }, '43': { start: { line: 96, column: 8 }, end: { line: 96, column: 70 } }, '44': { start: { line: 98, column: 8 }, end: { line: 98, column: 48 } }, '45': { start: { line: 101, column: 27 }, end: { line: 101, column: 33 } }, '46': { start: { line: 102, column: 6 }, end: { line: 110, column: 7 } }, '47': { start: { line: 103, column: 8 }, end: { line: 103, column: 94 } }, '48': { start: { line: 104, column: 8 }, end: { line: 104, column: 86 } }, '49': { start: { line: 106, column: 8 }, end: { line: 106, column: 99 } }, '50': { start: { line: 107, column: 8 }, end: { line: 109, column: 9 } }, '51': { start: { line: 108, column: 10 }, end: { line: 108, column: 35 } }, '52': { start: { line: 112, column: 6 }, end: { line: 116, column: 7 } }, '53': { start: { line: 113, column: 8 }, end: { line: 113, column: 68 } }, '54': { start: { line: 115, column: 8 }, end: { line: 115, column: 46 } }, '55': { start: { line: 121, column: 17 }, end: { line: 121, column: 21 } }, '56': { start: { line: 122, column: 6 }, end: { line: 124, column: 9 } }, '57': { start: { line: 123, column: 8 }, end: { line: 123, column: 109 } }, '58': { start: { line: 129, column: 17 }, end: { line: 129, column: 37 } }, '59': { start: { line: 130, column: 22 }, end: { line: 130, column: 38 } }, '60': { start: { line: 131, column: 29 }, end: { line: 131, column: 31 } }, '61': { start: { line: 132, column: 17 }, end: { line: 132, column: 23 } }, '62': { start: { line: 133, column: 6 }, end: { line: 141, column: 7 } }, '63': { start: { line: 134, column: 8 }, end: { line: 140, column: 9 } }, '64': { start: { line: 135, column: 10 }, end: { line: 139, column: 11 } }, '65': { start: { line: 136, column: 12 }, end: { line: 138, column: 13 } }, '66': { start: { line: 137, column: 14 }, end: { line: 137, column: 30 } }, '67': { start: { line: 143, column: 6 }, end: { line: 158, column: 7 } }, '68': { start: { line: 144, column: 8 }, end: { line: 157, column: 9 } }, '69': { start: { line: 145, column: 22 }, end: { line: 145, column: 33 } }, '70': { start: { line: 146, column: 10 }, end: { line: 156, column: 11 } }, '71': { start: { line: 147, column: 12 }, end: { line: 150, column: 14 } }, '72': { start: { line: 151, column: 12 }, end: { line: 155, column: 13 } }, '73': { start: { line: 152, column: 14 }, end: { line: 154, column: 15 } }, '74': { start: { line: 153, column: 16 }, end: { line: 153, column: 47 } }, '75': { start: { line: 159, column: 6 }, end: { line: 163, column: 7 } }, '76': { start: { line: 160, column: 8 }, end: { line: 160, column: 36 } }, '77': { start: { line: 162, column: 8 }, end: { line: 162, column: 20 } }, '78': { start: { line: 164, column: 6 }, end: { line: 172, column: 7 } }, '79': { start: { line: 165, column: 18 }, end: { line: 165, column: 29 } }, '80': { start: { line: 166, column: 8 }, end: { line: 168, column: 9 } }, '81': { start: { line: 167, column: 10 }, end: { line: 167, column: 19 } }, '82': { start: { line: 169, column: 22 }, end: { line: 169, column: 105 } }, '83': { start: { line: 170, column: 21 }, end: { line: 170, column: 41 } }, '84': { start: { line: 171, column: 8 }, end: { line: 171, column: 60 } }, '85': { start: { line: 177, column: 6 }, end: { line: 182, column: 7 } }, '86': { start: { line: 178, column: 8 }, end: { line: 180, column: 9 } }, '87': { start: { line: 179, column: 10 }, end: { line: 179, column: 35 } }, '88': { start: { line: 181, column: 8 }, end: { line: 181, column: 27 } }, '89': { start: { line: 183, column: 6 }, end: { line: 201, column: 7 } }, '90': { start: { line: 184, column: 8 }, end: { line: 186, column: 9 } }, '91': { start: { line: 185, column: 10 }, end: { line: 185, column: 25 } }, '92': { start: { line: 187, column: 8 }, end: { line: 189, column: 9 } }, '93': { start: { line: 188, column: 10 }, end: { line: 188, column: 28 } }, '94': { start: { line: 190, column: 8 }, end: { line: 192, column: 9 } }, '95': { start: { line: 191, column: 10 }, end: { line: 191, column: 27 } }, '96': { start: { line: 193, column: 8 }, end: { line: 195, column: 9 } }, '97': { start: { line: 194, column: 10 }, end: { line: 194, column: 28 } }, '98': { start: { line: 196, column: 8 }, end: { line: 198, column: 9 } }, '99': { start: { line: 197, column: 10 }, end: { line: 197, column: 25 } }, '100': { start: { line: 199, column: 13 }, end: { line: 201, column: 7 } }, '101': { start: { line: 200, column: 8 }, end: { line: 200, column: 22 } }, '102': { start: { line: 202, column: 6 }, end: { line: 202, column: 23 } }, '103': { start: { line: 207, column: 19 }, end: { line: 207, column: 21 } }, '104': { start: { line: 208, column: 18 }, end: { line: 208, column: 38 } }, '105': { start: { line: 209, column: 6 }, end: { line: 237, column: 7 } }, '106': { start: { line: 210, column: 19 }, end: { line: 210, column: 27 } }, '107': { start: { line: 211, column: 25 }, end: { line: 213, column: 9 } }, '108': { start: { line: 214, column: 23 }, end: { line: 214, column: 70 } }, '109': { start: { line: 215, column: 8 }, end: { line: 218, column: 10 } }, '110': { start: { line: 219, column: 21 }, end: { line: 219, column: 46 } }, '111': { start: { line: 220, column: 8 }, end: { line: 235, column: 9 } }, '112': { start: { line: 221, column: 22 }, end: { line: 221, column: 40 } }, '113': { start: { line: 222, column: 10 }, end: { line: 224, column: 11 } }, '114': { start: { line: 223, column: 12 }, end: { line: 223, column: 21 } }, '115': { start: { line: 225, column: 28 }, end: { line: 227, column: 11 } }, '116': { start: { line: 228, column: 10 }, end: { line: 232, column: 11 } }, '117': { start: { line: 229, column: 12 }, end: { line: 229, column: 39 } }, '118': { start: { line: 230, column: 17 }, end: { line: 232, column: 11 } }, '119': { start: { line: 231, column: 12 }, end: { line: 231, column: 41 } }, '120': { start: { line: 233, column: 10 }, end: { line: 233, column: 44 } }, '121': { start: { line: 234, column: 10 }, end: { line: 234, column: 46 } }, '122': { start: { line: 236, column: 8 }, end: { line: 236, column: 32 } }, '123': { start: { line: 238, column: 6 }, end: { line: 238, column: 20 } }, '124': { start: { line: 241, column: 2 }, end: { line: 241, column: 23 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 1, column: 68 }, end: { line: 1, column: 69 } }, loc: { start: { line: 1, column: 81 }, end: { line: 3, column: 1 } }, line: 1 }, '1': { name: '(anonymous_1)', decl: { start: { line: 5, column: 56 }, end: { line: 5, column: 57 } }, loc: { start: { line: 5, column: 71 }, end: { line: 7, column: 1 } }, line: 5 }, '2': { name: '(anonymous_2)', decl: { start: { line: 7, column: 4 }, end: { line: 7, column: 5 } }, loc: { start: { line: 7, column: 19 }, end: { line: 15, column: 1 } }, line: 7 }, '3': { name: 'trimUnderscore', decl: { start: { line: 17, column: 30 }, end: { line: 17, column: 44 } }, loc: { start: { line: 17, column: 50 }, end: { line: 22, column: 1 } }, line: 17 }, '4': { name: 'arrayKeyToSortNumber', decl: { start: { line: 24, column: 36 }, end: { line: 24, column: 56 } }, loc: { start: { line: 24, column: 62 }, end: { line: 34, column: 1 } }, line: 24 }, '5': { name: 'arrayKeyComparer', decl: { start: { line: 36, column: 32 }, end: { line: 36, column: 48 } }, loc: { start: { line: 36, column: 61 }, end: { line: 38, column: 1 } }, line: 36 }, '6': { name: '(anonymous_6)', decl: { start: { line: 40, column: 20 }, end: { line: 40, column: 21 } }, loc: { start: { line: 40, column: 32 }, end: { line: 242, column: 1 } }, line: 40 }, '7': { name: 'BaseFormatter', decl: { start: { line: 41, column: 11 }, end: { line: 41, column: 24 } }, loc: { start: { line: 41, column: 27 }, end: { line: 43, column: 3 } }, line: 41 }, '8': { name: 'format', decl: { start: { line: 47, column: 20 }, end: { line: 47, column: 26 } }, loc: { start: { line: 47, column: 40 }, end: { line: 52, column: 5 } }, line: 47 }, '9': { name: 'prepareContext', decl: { start: { line: 55, column: 20 }, end: { line: 55, column: 34 } }, loc: { start: { line: 55, column: 44 }, end: { line: 62, column: 5 } }, line: 55 }, '10': { name: '(anonymous_10)', decl: { start: { line: 57, column: 20 }, end: { line: 57, column: 21 } }, loc: { start: { line: 57, column: 32 }, end: { line: 61, column: 7 } }, line: 57 }, '11': { name: 'typeFormattterNotFound', decl: { start: { line: 65, column: 20 }, end: { line: 65, column: 42 } }, loc: { start: { line: 65, column: 63 }, end: { line: 67, column: 5 } }, line: 65 }, '12': { name: 'typeFormattterErrorFormatter', decl: { start: { line: 70, column: 20 }, end: { line: 70, column: 48 } }, loc: { start: { line: 70, column: 63 }, end: { line: 72, column: 5 } }, line: 70 }, '13': { name: 'finalize', decl: { start: { line: 75, column: 20 }, end: { line: 75, column: 28 } }, loc: { start: { line: 75, column: 35 }, end: { line: 81, column: 5 } }, line: 75 }, '14': { name: 'recurse', decl: { start: { line: 84, column: 20 }, end: { line: 84, column: 27 } }, loc: { start: { line: 84, column: 83 }, end: { line: 117, column: 5 } }, line: 84 }, '15': { name: 'formatDeltaChildren', decl: { start: { line: 120, column: 20 }, end: { line: 120, column: 39 } }, loc: { start: { line: 120, column: 62 }, end: { line: 125, column: 5 } }, line: 120 }, '16': { name: '(anonymous_16)', decl: { start: { line: 122, column: 40 }, end: { line: 122, column: 41 } }, loc: { start: { line: 122, column: 83 }, end: { line: 124, column: 7 } }, line: 122 }, '17': { name: 'forEachDeltaKey', decl: { start: { line: 128, column: 20 }, end: { line: 128, column: 35 } }, loc: { start: { line: 128, column: 53 }, end: { line: 173, column: 5 } }, line: 128 }, '18': { name: 'getDeltaType', decl: { start: { line: 176, column: 20 }, end: { line: 176, column: 32 } }, loc: { start: { line: 176, column: 51 }, end: { line: 203, column: 5 } }, line: 176 }, '19': { name: 'parseTextDiff', decl: { start: { line: 206, column: 20 }, end: { line: 206, column: 33 } }, loc: { start: { line: 206, column: 41 }, end: { line: 239, column: 5 } }, line: 206 } }, branchMap: { '0': { loc: { start: { line: 1, column: 14 }, end: { line: 3, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 1, column: 52 }, end: { line: 1, column: 65 } }, { start: { line: 1, column: 68 }, end: { line: 3, column: 1 } }], line: 1 }, '1': { loc: { start: { line: 5, column: 20 }, end: { line: 15, column: 1 } }, type: 'cond-expr', locations: [{ start: { line: 5, column: 56 }, end: { line: 7, column: 1 } }, { start: { line: 7, column: 4 }, end: { line: 15, column: 1 } }], line: 5 }, '2': { loc: { start: { line: 10, column: 4 }, end: { line: 12, column: 5 } }, type: 'if', locations: [{ start: { line: 10, column: 4 }, end: { line: 12, column: 5 } }, { start: { line: 10, column: 4 }, end: { line: 12, column: 5 } }], line: 10 }, '3': { loc: { start: { line: 18, column: 2 }, end: { line: 20, column: 3 } }, type: 'if', locations: [{ start: { line: 18, column: 2 }, end: { line: 20, column: 3 } }, { start: { line: 18, column: 2 }, end: { line: 20, column: 3 } }], line: 18 }, '4': { loc: { start: { line: 25, column: 2 }, end: { line: 33, column: 3 } }, type: 'if', locations: [{ start: { line: 25, column: 2 }, end: { line: 33, column: 3 } }, { start: { line: 25, column: 2 }, end: { line: 33, column: 3 } }], line: 25 }, '5': { loc: { start: { line: 28, column: 4 }, end: { line: 32, column: 5 } }, type: 'if', locations: [{ start: { line: 28, column: 4 }, end: { line: 32, column: 5 } }, { start: { line: 28, column: 4 }, end: { line: 32, column: 5 } }], line: 28 }, '6': { loc: { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, type: 'if', locations: [{ start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }], line: 78 }, '7': { loc: { start: { line: 85, column: 30 }, end: { line: 85, column: 48 } }, type: 'binary-expr', locations: [{ start: { line: 85, column: 30 }, end: { line: 85, column: 35 } }, { start: { line: 85, column: 39 }, end: { line: 85, column: 48 } }], line: 85 }, '8': { loc: { start: { line: 86, column: 22 }, end: { line: 86, column: 64 } }, type: 'cond-expr', locations: [{ start: { line: 86, column: 42 }, end: { line: 86, column: 57 } }, { start: { line: 86, column: 60 }, end: { line: 86, column: 64 } }], line: 86 }, '9': { loc: { start: { line: 88, column: 6 }, end: { line: 90, column: 7 } }, type: 'if', locations: [{ start: { line: 88, column: 6 }, end: { line: 90, column: 7 } }, { start: { line: 88, column: 6 }, end: { line: 90, column: 7 } }], line: 88 }, '10': { loc: { start: { line: 88, column: 10 }, end: { line: 88, column: 68 } }, type: 'binary-expr', locations: [{ start: { line: 88, column: 10 }, end: { line: 88, column: 38 } }, { start: { line: 88, column: 42 }, end: { line: 88, column: 68 } }], line: 88 }, '11': { loc: { start: { line: 93, column: 21 }, end: { line: 93, column: 81 } }, type: 'cond-expr', locations: [{ start: { line: 93, column: 39 }, end: { line: 93, column: 76 } }, { start: { line: 93, column: 79 }, end: { line: 93, column: 81 } }], line: 93 }, '12': { loc: { start: { line: 93, column: 39 }, end: { line: 93, column: 76 } }, type: 'cond-expr', locations: [{ start: { line: 93, column: 58 }, end: { line: 93, column: 65 } }, { start: { line: 93, column: 68 }, end: { line: 93, column: 76 } }], line: 93 }, '13': { loc: { start: { line: 95, column: 6 }, end: { line: 99, column: 7 } }, type: 'if', locations: [{ start: { line: 95, column: 6 }, end: { line: 99, column: 7 } }, { start: { line: 95, column: 6 }, end: { line: 99, column: 7 } }], line: 95 }, '14': { loc: { start: { line: 103, column: 25 }, end: { line: 103, column: 93 } }, type: 'binary-expr', locations: [{ start: { line: 103, column: 25 }, end: { line: 103, column: 47 } }, { start: { line: 103, column: 51 }, end: { line: 103, column: 93 } }], line: 103 }, '15': { loc: { start: { line: 107, column: 8 }, end: { line: 109, column: 9 } }, type: 'if', locations: [{ start: { line: 107, column: 8 }, end: { line: 109, column: 9 } }, { start: { line: 107, column: 8 }, end: { line: 109, column: 9 } }], line: 107 }, '16': { loc: { start: { line: 107, column: 12 }, end: { line: 107, column: 59 } }, type: 'binary-expr', locations: [{ start: { line: 107, column: 12 }, end: { line: 107, column: 42 } }, { start: { line: 107, column: 46 }, end: { line: 107, column: 59 } }], line: 107 }, '17': { loc: { start: { line: 112, column: 6 }, end: { line: 116, column: 7 } }, type: 'if', locations: [{ start: { line: 112, column: 6 }, end: { line: 116, column: 7 } }, { start: { line: 112, column: 6 }, end: { line: 116, column: 7 } }], line: 112 }, '18': { loc: { start: { line: 123, column: 42 }, end: { line: 123, column: 74 } }, type: 'cond-expr', locations: [{ start: { line: 123, column: 49 }, end: { line: 123, column: 62 } }, { start: { line: 123, column: 65 }, end: { line: 123, column: 74 } }], line: 123 }, '19': { loc: { start: { line: 133, column: 6 }, end: { line: 141, column: 7 } }, type: 'if', locations: [{ start: { line: 133, column: 6 }, end: { line: 141, column: 7 } }, { start: { line: 133, column: 6 }, end: { line: 141, column: 7 } }], line: 133 }, '20': { loc: { start: { line: 135, column: 10 }, end: { line: 139, column: 11 } }, type: 'if', locations: [{ start: { line: 135, column: 10 }, end: { line: 139, column: 11 } }, { start: { line: 135, column: 10 }, end: { line: 139, column: 11 } }], line: 135 }, '21': { loc: { start: { line: 136, column: 12 }, end: { line: 138, column: 13 } }, type: 'if', locations: [{ start: { line: 136, column: 12 }, end: { line: 138, column: 13 } }, { start: { line: 136, column: 12 }, end: { line: 138, column: 13 } }], line: 136 }, '22': { loc: { start: { line: 136, column: 16 }, end: { line: 136, column: 110 } }, type: 'binary-expr', locations: [{ start: { line: 136, column: 16 }, end: { line: 136, column: 50 } }, { start: { line: 136, column: 55 }, end: { line: 136, column: 65 } }, { start: { line: 136, column: 69 }, end: { line: 136, column: 109 } }], line: 136 }, '23': { loc: { start: { line: 144, column: 8 }, end: { line: 157, column: 9 } }, type: 'if', locations: [{ start: { line: 144, column: 8 }, end: { line: 157, column: 9 } }, { start: { line: 144, column: 8 }, end: { line: 157, column: 9 } }], line: 144 }, '24': { loc: { start: { line: 146, column: 10 }, end: { line: 156, column: 11 } }, type: 'if', locations: [{ start: { line: 146, column: 10 }, end: { line: 156, column: 11 } }, { start: { line: 146, column: 10 }, end: { line: 156, column: 11 } }], line: 146 }, '25': { loc: { start: { line: 146, column: 14 }, end: { line: 146, column: 46 } }, type: 'binary-expr', locations: [{ start: { line: 146, column: 14 }, end: { line: 146, column: 28 } }, { start: { line: 146, column: 32 }, end: { line: 146, column: 46 } }], line: 146 }, '26': { loc: { start: { line: 149, column: 21 }, end: { line: 149, column: 59 } }, type: 'binary-expr', locations: [{ start: { line: 149, column: 21 }, end: { line: 149, column: 25 } }, { start: { line: 149, column: 29 }, end: { line: 149, column: 59 } }], line: 149 }, '27': { loc: { start: { line: 151, column: 12 }, end: { line: 155, column: 13 } }, type: 'if', locations: [{ start: { line: 151, column: 12 }, end: { line: 155, column: 13 } }, { start: { line: 151, column: 12 }, end: { line: 155, column: 13 } }], line: 151 }, '28': { loc: { start: { line: 152, column: 14 }, end: { line: 154, column: 15 } }, type: 'if', locations: [{ start: { line: 152, column: 14 }, end: { line: 154, column: 15 } }, { start: { line: 152, column: 14 }, end: { line: 154, column: 15 } }], line: 152 }, '29': { loc: { start: { line: 152, column: 18 }, end: { line: 152, column: 87 } }, type: 'binary-expr', locations: [{ start: { line: 152, column: 18 }, end: { line: 152, column: 45 } }, { start: { line: 152, column: 49 }, end: { line: 152, column: 87 } }], line: 152 }, '30': { loc: { start: { line: 159, column: 6 }, end: { line: 163, column: 7 } }, type: 'if', locations: [{ start: { line: 159, column: 6 }, end: { line: 163, column: 7 } }, { start: { line: 159, column: 6 }, end: { line: 163, column: 7 } }], line: 159 }, '31': { loc: { start: { line: 166, column: 8 }, end: { line: 168, column: 9 } }, type: 'if', locations: [{ start: { line: 166, column: 8 }, end: { line: 168, column: 9 } }, { start: { line: 166, column: 8 }, end: { line: 168, column: 9 } }], line: 166 }, '32': { loc: { start: { line: 166, column: 12 }, end: { line: 166, column: 37 } }, type: 'binary-expr', locations: [{ start: { line: 166, column: 12 }, end: { line: 166, column: 21 } }, { start: { line: 166, column: 25 }, end: { line: 166, column: 37 } }], line: 166 }, '33': { loc: { start: { line: 169, column: 22 }, end: { line: 169, column: 105 } }, type: 'cond-expr', locations: [{ start: { line: 169, column: 34 }, end: { line: 169, column: 99 } }, { start: { line: 169, column: 102 }, end: { line: 169, column: 105 } }], line: 169 }, '34': { loc: { start: { line: 169, column: 34 }, end: { line: 169, column: 99 } }, type: 'cond-expr', locations: [{ start: { line: 169, column: 60 }, end: { line: 169, column: 63 } }, { start: { line: 169, column: 66 }, end: { line: 169, column: 99 } }], line: 169 }, '35': { loc: { start: { line: 177, column: 6 }, end: { line: 182, column: 7 } }, type: 'if', locations: [{ start: { line: 177, column: 6 }, end: { line: 182, column: 7 } }, { start: { line: 177, column: 6 }, end: { line: 182, column: 7 } }], line: 177 }, '36': { loc: { start: { line: 178, column: 8 }, end: { line: 180, column: 9 } }, type: 'if', locations: [{ start: { line: 178, column: 8 }, end: { line: 180, column: 9 } }, { start: { line: 178, column: 8 }, end: { line: 180, column: 9 } }], line: 178 }, '37': { loc: { start: { line: 183, column: 6 }, end: { line: 201, column: 7 } }, type: 'if', locations: [{ start: { line: 183, column: 6 }, end: { line: 201, column: 7 } }, { start: { line: 183, column: 6 }, end: { line: 201, column: 7 } }], line: 183 }, '38': { loc: { start: { line: 184, column: 8 }, end: { line: 186, column: 9 } }, type: 'if', locations: [{ start: { line: 184, column: 8 }, end: { line: 186, column: 9 } }, { start: { line: 184, column: 8 }, end: { line: 186, column: 9 } }], line: 184 }, '39': { loc: { start: { line: 187, column: 8 }, end: { line: 189, column: 9 } }, type: 'if', locations: [{ start: { line: 187, column: 8 }, end: { line: 189, column: 9 } }, { start: { line: 187, column: 8 }, end: { line: 189, column: 9 } }], line: 187 }, '40': { loc: { start: { line: 190, column: 8 }, end: { line: 192, column: 9 } }, type: 'if', locations: [{ start: { line: 190, column: 8 }, end: { line: 192, column: 9 } }, { start: { line: 190, column: 8 }, end: { line: 192, column: 9 } }], line: 190 }, '41': { loc: { start: { line: 190, column: 12 }, end: { line: 190, column: 48 } }, type: 'binary-expr', locations: [{ start: { line: 190, column: 12 }, end: { line: 190, column: 30 } }, { start: { line: 190, column: 34 }, end: { line: 190, column: 48 } }], line: 190 }, '42': { loc: { start: { line: 193, column: 8 }, end: { line: 195, column: 9 } }, type: 'if', locations: [{ start: { line: 193, column: 8 }, end: { line: 195, column: 9 } }, { start: { line: 193, column: 8 }, end: { line: 195, column: 9 } }], line: 193 }, '43': { loc: { start: { line: 193, column: 12 }, end: { line: 193, column: 48 } }, type: 'binary-expr', locations: [{ start: { line: 193, column: 12 }, end: { line: 193, column: 30 } }, { start: { line: 193, column: 34 }, end: { line: 193, column: 48 } }], line: 193 }, '44': { loc: { start: { line: 196, column: 8 }, end: { line: 198, column: 9 } }, type: 'if', locations: [{ start: { line: 196, column: 8 }, end: { line: 198, column: 9 } }, { start: { line: 196, column: 8 }, end: { line: 198, column: 9 } }], line: 196 }, '45': { loc: { start: { line: 196, column: 12 }, end: { line: 196, column: 48 } }, type: 'binary-expr', locations: [{ start: { line: 196, column: 12 }, end: { line: 196, column: 30 } }, { start: { line: 196, column: 34 }, end: { line: 196, column: 48 } }], line: 196 }, '46': { loc: { start: { line: 199, column: 13 }, end: { line: 201, column: 7 } }, type: 'if', locations: [{ start: { line: 199, column: 13 }, end: { line: 201, column: 7 } }, { start: { line: 199, column: 13 }, end: { line: 201, column: 7 } }], line: 199 }, '47': { loc: { start: { line: 199, column: 18 }, end: { line: 199, column: 89 } }, type: 'cond-expr', locations: [{ start: { line: 199, column: 49 }, end: { line: 199, column: 60 } }, { start: { line: 199, column: 63 }, end: { line: 199, column: 89 } }], line: 199 }, '48': { loc: { start: { line: 222, column: 10 }, end: { line: 224, column: 11 } }, type: 'if', locations: [{ start: { line: 222, column: 10 }, end: { line: 224, column: 11 } }, { start: { line: 222, column: 10 }, end: { line: 224, column: 11 } }], line: 222 }, '49': { loc: { start: { line: 228, column: 10 }, end: { line: 232, column: 11 } }, type: 'if', locations: [{ start: { line: 228, column: 10 }, end: { line: 232, column: 11 } }, { start: { line: 228, column: 10 }, end: { line: 232, column: 11 } }], line: 228 }, '50': { loc: { start: { line: 230, column: 17 }, end: { line: 232, column: 11 } }, type: 'if', locations: [{ start: { line: 230, column: 17 }, end: { line: 232, column: 11 } }, { start: { line: 230, column: 17 }, end: { line: 232, column: 11 } }], line: 230 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0, '92': 0, '93': 0, '94': 0, '95': 0, '96': 0, '97': 0, '98': 0, '99': 0, '100': 0, '101': 0, '102': 0, '103': 0, '104': 0, '105': 0, '106': 0, '107': 0, '108': 0, '109': 0, '110': 0, '111': 0, '112': 0, '113': 0, '114': 0, '115': 0, '116': 0, '117': 0, '118': 0, '119': 0, '120': 0, '121': 0, '122': 0, '123': 0, '124': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0], '22': [0, 0, 0], '23': [0, 0], '24': [0, 0], '25': [0, 0], '26': [0, 0], '27': [0, 0], '28': [0, 0], '29': [0, 0], '30': [0, 0], '31': [0, 0], '32': [0, 0], '33': [0, 0], '34': [0, 0], '35': [0, 0], '36': [0, 0], '37': [0, 0], '38': [0, 0], '39': [0, 0], '40': [0, 0], '41': [0, 0], '42': [0, 0], '43': [0, 0], '44': [0, 0], '45': [0, 0], '46': [0, 0], '47': [0, 0], '48': [0, 0], '49': [0, 0], '50': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3375 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3376 | return coverage[path];
|
3377 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3378 | }();var isArray$3 = (cov_1ac9yxw2a1.s[0]++, typeof Array.isArray === 'function' ? (cov_1ac9yxw2a1.b[0][0]++, Array.isArray) : (cov_1ac9yxw2a1.b[0][1]++, function (a) {
|
3379 | cov_1ac9yxw2a1.f[0]++;cov_1ac9yxw2a1.s[1]++;return a instanceof Array;
|
3380 | }));var getObjectKeys = (cov_1ac9yxw2a1.s[2]++, typeof Object.keys === 'function' ? (cov_1ac9yxw2a1.b[1][0]++, function (obj) {
|
3381 | cov_1ac9yxw2a1.f[1]++;cov_1ac9yxw2a1.s[3]++;return Object.keys(obj);
|
3382 | }) : (cov_1ac9yxw2a1.b[1][1]++, function (obj) {
|
3383 | cov_1ac9yxw2a1.f[2]++;var names = (cov_1ac9yxw2a1.s[4]++, []);cov_1ac9yxw2a1.s[5]++;for (var property in obj) {
|
3384 | cov_1ac9yxw2a1.s[6]++;if (Object.prototype.hasOwnProperty.call(obj, property)) {
|
3385 | cov_1ac9yxw2a1.b[2][0]++;cov_1ac9yxw2a1.s[7]++;names.push(property);
|
3386 | } else {
|
3387 | cov_1ac9yxw2a1.b[2][1]++;
|
3388 | }
|
3389 | }cov_1ac9yxw2a1.s[8]++;return names;
|
3390 | }));cov_1ac9yxw2a1.s[9]++;var trimUnderscore = function trimUnderscore(str) {
|
3391 | cov_1ac9yxw2a1.f[3]++;cov_1ac9yxw2a1.s[10]++;if (str.substr(0, 1) === '_') {
|
3392 | cov_1ac9yxw2a1.b[3][0]++;cov_1ac9yxw2a1.s[11]++;return str.slice(1);
|
3393 | } else {
|
3394 | cov_1ac9yxw2a1.b[3][1]++;
|
3395 | }cov_1ac9yxw2a1.s[12]++;return str;
|
3396 | };cov_1ac9yxw2a1.s[13]++;var arrayKeyToSortNumber = function arrayKeyToSortNumber(key) {
|
3397 | cov_1ac9yxw2a1.f[4]++;cov_1ac9yxw2a1.s[14]++;if (key === '_t') {
|
3398 | cov_1ac9yxw2a1.b[4][0]++;cov_1ac9yxw2a1.s[15]++;return -1;
|
3399 | } else {
|
3400 | cov_1ac9yxw2a1.b[4][1]++;cov_1ac9yxw2a1.s[16]++;if (key.substr(0, 1) === '_') {
|
3401 | cov_1ac9yxw2a1.b[5][0]++;cov_1ac9yxw2a1.s[17]++;return parseInt(key.slice(1), 10);
|
3402 | } else {
|
3403 | cov_1ac9yxw2a1.b[5][1]++;cov_1ac9yxw2a1.s[18]++;return parseInt(key, 10) + 0.1;
|
3404 | }
|
3405 | }
|
3406 | };cov_1ac9yxw2a1.s[19]++;var arrayKeyComparer = function arrayKeyComparer(key1, key2) {
|
3407 | cov_1ac9yxw2a1.f[5]++;cov_1ac9yxw2a1.s[20]++;return arrayKeyToSortNumber(key1) - arrayKeyToSortNumber(key2);
|
3408 | };var BaseFormatter = (cov_1ac9yxw2a1.s[21]++, function () {
|
3409 | cov_1ac9yxw2a1.f[6]++;function BaseFormatter() {
|
3410 | cov_1ac9yxw2a1.f[7]++;cov_1ac9yxw2a1.s[22]++;classCallCheck$1(this, BaseFormatter);
|
3411 | }cov_1ac9yxw2a1.s[23]++;createClass$1(BaseFormatter, [{ key: 'format', value: function format(delta, left) {
|
3412 | cov_1ac9yxw2a1.f[8]++;var context = (cov_1ac9yxw2a1.s[24]++, {});cov_1ac9yxw2a1.s[25]++;this.prepareContext(context);cov_1ac9yxw2a1.s[26]++;this.recurse(context, delta, left);cov_1ac9yxw2a1.s[27]++;return this.finalize(context);
|
3413 | } }, { key: 'prepareContext', value: function prepareContext(context) {
|
3414 | cov_1ac9yxw2a1.f[9]++;cov_1ac9yxw2a1.s[28]++;context.buffer = [];cov_1ac9yxw2a1.s[29]++;context.out = function () {
|
3415 | cov_1ac9yxw2a1.f[10]++;var _buffer;cov_1ac9yxw2a1.s[30]++;(_buffer = this.buffer).push.apply(_buffer, arguments);
|
3416 | };
|
3417 | } }, { key: 'typeFormattterNotFound', value: function typeFormattterNotFound(context, deltaType) {
|
3418 | cov_1ac9yxw2a1.f[11]++;cov_1ac9yxw2a1.s[31]++;throw new Error('cannot format delta type: ' + deltaType);
|
3419 | } }, { key: 'typeFormattterErrorFormatter', value: function typeFormattterErrorFormatter(context, err) {
|
3420 | cov_1ac9yxw2a1.f[12]++;cov_1ac9yxw2a1.s[32]++;return err.toString();
|
3421 | } }, { key: 'finalize', value: function finalize(_ref) {
|
3422 | cov_1ac9yxw2a1.f[13]++;var buffer = (cov_1ac9yxw2a1.s[33]++, _ref.buffer);cov_1ac9yxw2a1.s[34]++;if (isArray$3(buffer)) {
|
3423 | cov_1ac9yxw2a1.b[6][0]++;cov_1ac9yxw2a1.s[35]++;return buffer.join('');
|
3424 | } else {
|
3425 | cov_1ac9yxw2a1.b[6][1]++;
|
3426 | }
|
3427 | } }, { key: 'recurse', value: function recurse(context, delta, left, key, leftKey, movedFrom, isLast) {
|
3428 | cov_1ac9yxw2a1.f[14]++;var useMoveOriginHere = (cov_1ac9yxw2a1.s[36]++, (cov_1ac9yxw2a1.b[7][0]++, delta) && (cov_1ac9yxw2a1.b[7][1]++, movedFrom));var leftValue = (cov_1ac9yxw2a1.s[37]++, useMoveOriginHere ? (cov_1ac9yxw2a1.b[8][0]++, movedFrom.value) : (cov_1ac9yxw2a1.b[8][1]++, left));cov_1ac9yxw2a1.s[38]++;if ((cov_1ac9yxw2a1.b[10][0]++, typeof delta === 'undefined') && (cov_1ac9yxw2a1.b[10][1]++, typeof key === 'undefined')) {
|
3429 | cov_1ac9yxw2a1.b[9][0]++;cov_1ac9yxw2a1.s[39]++;return undefined;
|
3430 | } else {
|
3431 | cov_1ac9yxw2a1.b[9][1]++;
|
3432 | }var type = (cov_1ac9yxw2a1.s[40]++, this.getDeltaType(delta, movedFrom));var nodeType = (cov_1ac9yxw2a1.s[41]++, type === 'node' ? (cov_1ac9yxw2a1.b[11][0]++, delta._t === 'a' ? (cov_1ac9yxw2a1.b[12][0]++, 'array') : (cov_1ac9yxw2a1.b[12][1]++, 'object')) : (cov_1ac9yxw2a1.b[11][1]++, ''));cov_1ac9yxw2a1.s[42]++;if (typeof key !== 'undefined') {
|
3433 | cov_1ac9yxw2a1.b[13][0]++;cov_1ac9yxw2a1.s[43]++;this.nodeBegin(context, key, leftKey, type, nodeType, isLast);
|
3434 | } else {
|
3435 | cov_1ac9yxw2a1.b[13][1]++;cov_1ac9yxw2a1.s[44]++;this.rootBegin(context, type, nodeType);
|
3436 | }var typeFormattter = (cov_1ac9yxw2a1.s[45]++, void 0);cov_1ac9yxw2a1.s[46]++;try {
|
3437 | cov_1ac9yxw2a1.s[47]++;typeFormattter = (cov_1ac9yxw2a1.b[14][0]++, this['format_' + type]) || (cov_1ac9yxw2a1.b[14][1]++, this.typeFormattterNotFound(context, type));cov_1ac9yxw2a1.s[48]++;typeFormattter.call(this, context, delta, leftValue, key, leftKey, movedFrom);
|
3438 | } catch (err) {
|
3439 | cov_1ac9yxw2a1.s[49]++;this.typeFormattterErrorFormatter(context, err, delta, leftValue, key, leftKey, movedFrom);cov_1ac9yxw2a1.s[50]++;if ((cov_1ac9yxw2a1.b[16][0]++, typeof console !== 'undefined') && (cov_1ac9yxw2a1.b[16][1]++, console.error)) {
|
3440 | cov_1ac9yxw2a1.b[15][0]++;cov_1ac9yxw2a1.s[51]++;console.error(err.stack);
|
3441 | } else {
|
3442 | cov_1ac9yxw2a1.b[15][1]++;
|
3443 | }
|
3444 | }cov_1ac9yxw2a1.s[52]++;if (typeof key !== 'undefined') {
|
3445 | cov_1ac9yxw2a1.b[17][0]++;cov_1ac9yxw2a1.s[53]++;this.nodeEnd(context, key, leftKey, type, nodeType, isLast);
|
3446 | } else {
|
3447 | cov_1ac9yxw2a1.b[17][1]++;cov_1ac9yxw2a1.s[54]++;this.rootEnd(context, type, nodeType);
|
3448 | }
|
3449 | } }, { key: 'formatDeltaChildren', value: function formatDeltaChildren(context, delta, left) {
|
3450 | cov_1ac9yxw2a1.f[15]++;var self = (cov_1ac9yxw2a1.s[55]++, this);cov_1ac9yxw2a1.s[56]++;this.forEachDeltaKey(delta, left, function (key, leftKey, movedFrom, isLast) {
|
3451 | cov_1ac9yxw2a1.f[16]++;cov_1ac9yxw2a1.s[57]++;self.recurse(context, delta[key], left ? (cov_1ac9yxw2a1.b[18][0]++, left[leftKey]) : (cov_1ac9yxw2a1.b[18][1]++, undefined), key, leftKey, movedFrom, isLast);
|
3452 | });
|
3453 | } }, { key: 'forEachDeltaKey', value: function forEachDeltaKey(delta, left, fn) {
|
3454 | cov_1ac9yxw2a1.f[17]++;var keys = (cov_1ac9yxw2a1.s[58]++, getObjectKeys(delta));var arrayKeys = (cov_1ac9yxw2a1.s[59]++, delta._t === 'a');var moveDestinations = (cov_1ac9yxw2a1.s[60]++, {});var name = (cov_1ac9yxw2a1.s[61]++, void 0);cov_1ac9yxw2a1.s[62]++;if (typeof left !== 'undefined') {
|
3455 | cov_1ac9yxw2a1.b[19][0]++;cov_1ac9yxw2a1.s[63]++;for (name in left) {
|
3456 | cov_1ac9yxw2a1.s[64]++;if (Object.prototype.hasOwnProperty.call(left, name)) {
|
3457 | cov_1ac9yxw2a1.b[20][0]++;cov_1ac9yxw2a1.s[65]++;if ((cov_1ac9yxw2a1.b[22][0]++, typeof delta[name] === 'undefined') && ((cov_1ac9yxw2a1.b[22][1]++, !arrayKeys) || (cov_1ac9yxw2a1.b[22][2]++, typeof delta['_' + name] === 'undefined'))) {
|
3458 | cov_1ac9yxw2a1.b[21][0]++;cov_1ac9yxw2a1.s[66]++;keys.push(name);
|
3459 | } else {
|
3460 | cov_1ac9yxw2a1.b[21][1]++;
|
3461 | }
|
3462 | } else {
|
3463 | cov_1ac9yxw2a1.b[20][1]++;
|
3464 | }
|
3465 | }
|
3466 | } else {
|
3467 | cov_1ac9yxw2a1.b[19][1]++;
|
3468 | }
|
3469 | cov_1ac9yxw2a1.s[67]++;for (name in delta) {
|
3470 | cov_1ac9yxw2a1.s[68]++;if (Object.prototype.hasOwnProperty.call(delta, name)) {
|
3471 | cov_1ac9yxw2a1.b[23][0]++;var value = (cov_1ac9yxw2a1.s[69]++, delta[name]);cov_1ac9yxw2a1.s[70]++;if ((cov_1ac9yxw2a1.b[25][0]++, isArray$3(value)) && (cov_1ac9yxw2a1.b[25][1]++, value[2] === 3)) {
|
3472 | cov_1ac9yxw2a1.b[24][0]++;cov_1ac9yxw2a1.s[71]++;moveDestinations[value[1].toString()] = { key: name, value: (cov_1ac9yxw2a1.b[26][0]++, left) && (cov_1ac9yxw2a1.b[26][1]++, left[parseInt(name.substr(1))]) };cov_1ac9yxw2a1.s[72]++;if (this.includeMoveDestinations !== false) {
|
3473 | cov_1ac9yxw2a1.b[27][0]++;cov_1ac9yxw2a1.s[73]++;if ((cov_1ac9yxw2a1.b[29][0]++, typeof left === 'undefined') && (cov_1ac9yxw2a1.b[29][1]++, typeof delta[value[1]] === 'undefined')) {
|
3474 | cov_1ac9yxw2a1.b[28][0]++;cov_1ac9yxw2a1.s[74]++;keys.push(value[1].toString());
|
3475 | } else {
|
3476 | cov_1ac9yxw2a1.b[28][1]++;
|
3477 | }
|
3478 | } else {
|
3479 | cov_1ac9yxw2a1.b[27][1]++;
|
3480 | }
|
3481 | } else {
|
3482 | cov_1ac9yxw2a1.b[24][1]++;
|
3483 | }
|
3484 | } else {
|
3485 | cov_1ac9yxw2a1.b[23][1]++;
|
3486 | }
|
3487 | }cov_1ac9yxw2a1.s[75]++;if (arrayKeys) {
|
3488 | cov_1ac9yxw2a1.b[30][0]++;cov_1ac9yxw2a1.s[76]++;keys.sort(arrayKeyComparer);
|
3489 | } else {
|
3490 | cov_1ac9yxw2a1.b[30][1]++;cov_1ac9yxw2a1.s[77]++;keys.sort();
|
3491 | }cov_1ac9yxw2a1.s[78]++;for (var index = 0, length = keys.length; index < length; index++) {
|
3492 | var key = (cov_1ac9yxw2a1.s[79]++, keys[index]);cov_1ac9yxw2a1.s[80]++;if ((cov_1ac9yxw2a1.b[32][0]++, arrayKeys) && (cov_1ac9yxw2a1.b[32][1]++, key === '_t')) {
|
3493 | cov_1ac9yxw2a1.b[31][0]++;cov_1ac9yxw2a1.s[81]++;continue;
|
3494 | } else {
|
3495 | cov_1ac9yxw2a1.b[31][1]++;
|
3496 | }var leftKey = (cov_1ac9yxw2a1.s[82]++, arrayKeys ? (cov_1ac9yxw2a1.b[33][0]++, typeof key === 'number' ? (cov_1ac9yxw2a1.b[34][0]++, key) : (cov_1ac9yxw2a1.b[34][1]++, parseInt(trimUnderscore(key), 10))) : (cov_1ac9yxw2a1.b[33][1]++, key));var isLast = (cov_1ac9yxw2a1.s[83]++, index === length - 1);cov_1ac9yxw2a1.s[84]++;fn(key, leftKey, moveDestinations[leftKey], isLast);
|
3497 | }
|
3498 | } }, { key: 'getDeltaType', value: function getDeltaType(delta, movedFrom) {
|
3499 | cov_1ac9yxw2a1.f[18]++;cov_1ac9yxw2a1.s[85]++;if (typeof delta === 'undefined') {
|
3500 | cov_1ac9yxw2a1.b[35][0]++;cov_1ac9yxw2a1.s[86]++;if (typeof movedFrom !== 'undefined') {
|
3501 | cov_1ac9yxw2a1.b[36][0]++;cov_1ac9yxw2a1.s[87]++;return 'movedestination';
|
3502 | } else {
|
3503 | cov_1ac9yxw2a1.b[36][1]++;
|
3504 | }cov_1ac9yxw2a1.s[88]++;return 'unchanged';
|
3505 | } else {
|
3506 | cov_1ac9yxw2a1.b[35][1]++;
|
3507 | }cov_1ac9yxw2a1.s[89]++;if (isArray$3(delta)) {
|
3508 | cov_1ac9yxw2a1.b[37][0]++;cov_1ac9yxw2a1.s[90]++;if (delta.length === 1) {
|
3509 | cov_1ac9yxw2a1.b[38][0]++;cov_1ac9yxw2a1.s[91]++;return 'added';
|
3510 | } else {
|
3511 | cov_1ac9yxw2a1.b[38][1]++;
|
3512 | }cov_1ac9yxw2a1.s[92]++;if (delta.length === 2) {
|
3513 | cov_1ac9yxw2a1.b[39][0]++;cov_1ac9yxw2a1.s[93]++;return 'modified';
|
3514 | } else {
|
3515 | cov_1ac9yxw2a1.b[39][1]++;
|
3516 | }cov_1ac9yxw2a1.s[94]++;if ((cov_1ac9yxw2a1.b[41][0]++, delta.length === 3) && (cov_1ac9yxw2a1.b[41][1]++, delta[2] === 0)) {
|
3517 | cov_1ac9yxw2a1.b[40][0]++;cov_1ac9yxw2a1.s[95]++;return 'deleted';
|
3518 | } else {
|
3519 | cov_1ac9yxw2a1.b[40][1]++;
|
3520 | }cov_1ac9yxw2a1.s[96]++;if ((cov_1ac9yxw2a1.b[43][0]++, delta.length === 3) && (cov_1ac9yxw2a1.b[43][1]++, delta[2] === 2)) {
|
3521 | cov_1ac9yxw2a1.b[42][0]++;cov_1ac9yxw2a1.s[97]++;return 'textdiff';
|
3522 | } else {
|
3523 | cov_1ac9yxw2a1.b[42][1]++;
|
3524 | }cov_1ac9yxw2a1.s[98]++;if ((cov_1ac9yxw2a1.b[45][0]++, delta.length === 3) && (cov_1ac9yxw2a1.b[45][1]++, delta[2] === 3)) {
|
3525 | cov_1ac9yxw2a1.b[44][0]++;cov_1ac9yxw2a1.s[99]++;return 'moved';
|
3526 | } else {
|
3527 | cov_1ac9yxw2a1.b[44][1]++;
|
3528 | }
|
3529 | } else {
|
3530 | cov_1ac9yxw2a1.b[37][1]++;cov_1ac9yxw2a1.s[100]++;if ((typeof delta === 'undefined' ? (cov_1ac9yxw2a1.b[47][0]++, 'undefined') : (cov_1ac9yxw2a1.b[47][1]++, _typeof$1(delta))) === 'object') {
|
3531 | cov_1ac9yxw2a1.b[46][0]++;cov_1ac9yxw2a1.s[101]++;return 'node';
|
3532 | } else {
|
3533 | cov_1ac9yxw2a1.b[46][1]++;
|
3534 | }
|
3535 | }cov_1ac9yxw2a1.s[102]++;return 'unknown';
|
3536 | } }, { key: 'parseTextDiff', value: function parseTextDiff(value) {
|
3537 | cov_1ac9yxw2a1.f[19]++;var output = (cov_1ac9yxw2a1.s[103]++, []);var lines = (cov_1ac9yxw2a1.s[104]++, value.split('\n@@ '));cov_1ac9yxw2a1.s[105]++;for (var i = 0, l = lines.length; i < l; i++) {
|
3538 | var line = (cov_1ac9yxw2a1.s[106]++, lines[i]);var lineOutput = (cov_1ac9yxw2a1.s[107]++, { pieces: [] });var location = (cov_1ac9yxw2a1.s[108]++, /^(?:@@ )?[-+]?(\d+),(\d+)/.exec(line).slice(1));cov_1ac9yxw2a1.s[109]++;lineOutput.location = { line: location[0], chr: location[1] };var pieces = (cov_1ac9yxw2a1.s[110]++, line.split('\n').slice(1));cov_1ac9yxw2a1.s[111]++;for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
|
3539 | var piece = (cov_1ac9yxw2a1.s[112]++, pieces[pieceIndex]);cov_1ac9yxw2a1.s[113]++;if (!piece.length) {
|
3540 | cov_1ac9yxw2a1.b[48][0]++;cov_1ac9yxw2a1.s[114]++;continue;
|
3541 | } else {
|
3542 | cov_1ac9yxw2a1.b[48][1]++;
|
3543 | }var pieceOutput = (cov_1ac9yxw2a1.s[115]++, { type: 'context' });cov_1ac9yxw2a1.s[116]++;if (piece.substr(0, 1) === '+') {
|
3544 | cov_1ac9yxw2a1.b[49][0]++;cov_1ac9yxw2a1.s[117]++;pieceOutput.type = 'added';
|
3545 | } else {
|
3546 | cov_1ac9yxw2a1.b[49][1]++;cov_1ac9yxw2a1.s[118]++;if (piece.substr(0, 1) === '-') {
|
3547 | cov_1ac9yxw2a1.b[50][0]++;cov_1ac9yxw2a1.s[119]++;pieceOutput.type = 'deleted';
|
3548 | } else {
|
3549 | cov_1ac9yxw2a1.b[50][1]++;
|
3550 | }
|
3551 | }cov_1ac9yxw2a1.s[120]++;pieceOutput.text = piece.slice(1);cov_1ac9yxw2a1.s[121]++;lineOutput.pieces.push(pieceOutput);
|
3552 | }cov_1ac9yxw2a1.s[122]++;output.push(lineOutput);
|
3553 | }cov_1ac9yxw2a1.s[123]++;return output;
|
3554 | } }]);cov_1ac9yxw2a1.s[124]++;return BaseFormatter;
|
3555 | }());
|
3556 |
|
3557 | var base = Object.freeze({
|
3558 | default: BaseFormatter
|
3559 | });
|
3560 |
|
3561 | var cov_273kjaqpct = function () {
|
3562 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/html.js',
|
3563 | hash = '89f7319129571f2e1f4a32cd2cab6fd4b771fbdd',
|
3564 | global = new Function('return this')(),
|
3565 | gcv = '__coverage__',
|
3566 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/html.js', statementMap: { '0': { start: { line: 3, column: 20 }, end: { line: 139, column: 16 } }, '1': { start: { line: 4, column: 2 }, end: { line: 4, column: 55 } }, '2': { start: { line: 7, column: 4 }, end: { line: 7, column: 53 } }, '3': { start: { line: 8, column: 4 }, end: { line: 8, column: 146 } }, '4': { start: { line: 11, column: 2 }, end: { line: 137, column: 6 } }, '5': { start: { line: 14, column: 6 }, end: { line: 14, column: 72 } }, '6': { start: { line: 19, column: 6 }, end: { line: 19, column: 83 } }, '7': { start: { line: 24, column: 18 }, end: { line: 24, column: 43 } }, '8': { start: { line: 25, column: 6 }, end: { line: 25, column: 57 } }, '9': { start: { line: 26, column: 6 }, end: { line: 36, column: 7 } }, '10': { start: { line: 27, column: 19 }, end: { line: 27, column: 27 } }, '11': { start: { line: 28, column: 8 }, end: { line: 28, column: 283 } }, '12': { start: { line: 29, column: 21 }, end: { line: 29, column: 32 } }, '13': { start: { line: 30, column: 8 }, end: { line: 34, column: 9 } }, '14': { start: { line: 32, column: 22 }, end: { line: 32, column: 40 } }, '15': { start: { line: 33, column: 10 }, end: { line: 33, column: 129 } }, '16': { start: { line: 35, column: 8 }, end: { line: 35, column: 35 } }, '17': { start: { line: 37, column: 6 }, end: { line: 37, column: 27 } }, '18': { start: { line: 42, column: 22 }, end: { line: 42, column: 110 } }, '19': { start: { line: 43, column: 6 }, end: { line: 43, column: 73 } }, '20': { start: { line: 48, column: 6 }, end: { line: 48, column: 149 } }, '21': { start: { line: 53, column: 22 }, end: { line: 53, column: 110 } }, '22': { start: { line: 54, column: 6 }, end: { line: 54, column: 148 } }, '23': { start: { line: 59, column: 6 }, end: { line: 59, column: 27 } }, '24': { start: { line: 68, column: 6 }, end: { line: 70, column: 7 } }, '25': { start: { line: 69, column: 8 }, end: { line: 69, column: 15 } }, '26': { start: { line: 71, column: 6 }, end: { line: 71, column: 55 } }, '27': { start: { line: 72, column: 6 }, end: { line: 72, column: 38 } }, '28': { start: { line: 73, column: 6 }, end: { line: 73, column: 28 } }, '29': { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, '30': { start: { line: 79, column: 8 }, end: { line: 79, column: 15 } }, '31': { start: { line: 81, column: 6 }, end: { line: 81, column: 55 } }, '32': { start: { line: 82, column: 6 }, end: { line: 82, column: 38 } }, '33': { start: { line: 83, column: 6 }, end: { line: 83, column: 28 } }, '34': { start: { line: 89, column: 21 }, end: { line: 89, column: 58 } }, '35': { start: { line: 90, column: 6 }, end: { line: 90, column: 94 } }, '36': { start: { line: 91, column: 6 }, end: { line: 91, column: 53 } }, '37': { start: { line: 92, column: 6 }, end: { line: 92, column: 27 } }, '38': { start: { line: 97, column: 6 }, end: { line: 97, column: 55 } }, '39': { start: { line: 98, column: 6 }, end: { line: 98, column: 42 } }, '40': { start: { line: 99, column: 6 }, end: { line: 99, column: 28 } }, '41': { start: { line: 104, column: 6 }, end: { line: 104, column: 80 } }, '42': { start: { line: 105, column: 6 }, end: { line: 105, column: 42 } }, '43': { start: { line: 106, column: 6 }, end: { line: 106, column: 92 } }, '44': { start: { line: 107, column: 6 }, end: { line: 107, column: 42 } }, '45': { start: { line: 108, column: 6 }, end: { line: 108, column: 28 } }, '46': { start: { line: 113, column: 6 }, end: { line: 113, column: 55 } }, '47': { start: { line: 114, column: 6 }, end: { line: 114, column: 42 } }, '48': { start: { line: 115, column: 6 }, end: { line: 115, column: 28 } }, '49': { start: { line: 120, column: 6 }, end: { line: 120, column: 55 } }, '50': { start: { line: 121, column: 6 }, end: { line: 121, column: 42 } }, '51': { start: { line: 122, column: 6 }, end: { line: 122, column: 95 } }, '52': { start: { line: 125, column: 6 }, end: { line: 127, column: 702 } }, '53': { start: { line: 128, column: 6 }, end: { line: 128, column: 31 } }, '54': { start: { line: 133, column: 6 }, end: { line: 133, column: 55 } }, '55': { start: { line: 134, column: 6 }, end: { line: 134, column: 51 } }, '56': { start: { line: 135, column: 6 }, end: { line: 135, column: 28 } }, '57': { start: { line: 138, column: 2 }, end: { line: 138, column: 23 } }, '58': { start: { line: 142, column: 13 }, end: { line: 142, column: 17 } }, '59': { start: { line: 143, column: 21 }, end: { line: 143, column: 106 } }, '60': { start: { line: 144, column: 2 }, end: { line: 146, column: 3 } }, '61': { start: { line: 145, column: 4 }, end: { line: 145, column: 64 } }, '62': { start: { line: 147, column: 2 }, end: { line: 147, column: 14 } }, '63': { start: { line: 150, column: 19 }, end: { line: 199, column: 1 } }, '64': { start: { line: 151, column: 13 }, end: { line: 151, column: 32 } }, '65': { start: { line: 152, column: 23 }, end: { line: 156, column: 3 } }, '66': { start: { line: 153, column: 22 }, end: { line: 153, column: 38 } }, '67': { start: { line: 154, column: 20 }, end: { line: 154, column: 34 } }, '68': { start: { line: 155, column: 4 }, end: { line: 155, column: 36 } }, '69': { start: { line: 157, column: 20 }, end: { line: 162, column: 3 } }, '70': { start: { line: 158, column: 16 }, end: { line: 158, column: 42 } }, '71': { start: { line: 159, column: 4 }, end: { line: 161, column: 5 } }, '72': { start: { line: 160, column: 6 }, end: { line: 160, column: 19 } }, '73': { start: { line: 163, column: 21 }, end: { line: 169, column: 3 } }, '74': { start: { line: 164, column: 19 }, end: { line: 164, column: 33 } }, '75': { start: { line: 166, column: 4 }, end: { line: 168, column: 5 } }, '76': { start: { line: 167, column: 6 }, end: { line: 167, column: 25 } }, '77': { start: { line: 170, column: 2 }, end: { line: 198, column: 5 } }, '78': { start: { line: 171, column: 21 }, end: { line: 171, column: 37 } }, '79': { start: { line: 172, column: 19 }, end: { line: 172, column: 33 } }, '80': { start: { line: 173, column: 16 }, end: { line: 173, column: 27 } }, '81': { start: { line: 175, column: 22 }, end: { line: 175, column: 32 } }, '82': { start: { line: 176, column: 14 }, end: { line: 176, column: 25 } }, '83': { start: { line: 177, column: 15 }, end: { line: 177, column: 30 } }, '84': { start: { line: 178, column: 4 }, end: { line: 178, column: 31 } }, '85': { start: { line: 179, column: 22 }, end: { line: 179, column: 99 } }, '86': { start: { line: 180, column: 20 }, end: { line: 180, column: 42 } }, '87': { start: { line: 181, column: 26 }, end: { line: 181, column: 32 } }, '88': { start: { line: 182, column: 4 }, end: { line: 186, column: 7 } }, '89': { start: { line: 183, column: 6 }, end: { line: 185, column: 7 } }, '90': { start: { line: 184, column: 8 }, end: { line: 184, column: 32 } }, '91': { start: { line: 187, column: 4 }, end: { line: 189, column: 5 } }, '92': { start: { line: 188, column: 6 }, end: { line: 188, column: 13 } }, '93': { start: { line: 190, column: 4 }, end: { line: 197, column: 20 } }, '94': { start: { line: 191, column: 21 }, end: { line: 191, column: 70 } }, '95': { start: { line: 192, column: 6 }, end: { line: 192, column: 57 } }, '96': { start: { line: 193, column: 6 }, end: { line: 193, column: 60 } }, '97': { start: { line: 194, column: 18 }, end: { line: 194, column: 169 } }, '98': { start: { line: 195, column: 6 }, end: { line: 195, column: 36 } }, '99': { start: { line: 196, column: 6 }, end: { line: 196, column: 29 } }, '100': { start: { line: 204, column: 27 }, end: { line: 256, column: 1 } }, '101': { start: { line: 205, column: 11 }, end: { line: 205, column: 32 } }, '102': { start: { line: 206, column: 15 }, end: { line: 206, column: 41 } }, '103': { start: { line: 207, column: 16 }, end: { line: 212, column: 3 } }, '104': { start: { line: 213, column: 13 }, end: { line: 213, column: 25 } }, '105': { start: { line: 214, column: 2 }, end: { line: 216, column: 3 } }, '106': { start: { line: 215, column: 4 }, end: { line: 215, column: 11 } }, '107': { start: { line: 217, column: 2 }, end: { line: 226, column: 3 } }, '108': { start: { line: 218, column: 4 }, end: { line: 218, column: 33 } }, '109': { start: { line: 219, column: 4 }, end: { line: 219, column: 32 } }, '110': { start: { line: 220, column: 4 }, end: { line: 220, column: 33 } }, '111': { start: { line: 221, column: 4 }, end: { line: 221, column: 32 } }, '112': { start: { line: 222, column: 4 }, end: { line: 224, column: 5 } }, '113': { start: { line: 223, column: 6 }, end: { line: 223, column: 31 } }, '114': { start: { line: 225, column: 4 }, end: { line: 225, column: 11 } }, '115': { start: { line: 227, column: 2 }, end: { line: 237, column: 3 } }, '116': { start: { line: 228, column: 4 }, end: { line: 228, column: 33 } }, '117': { start: { line: 229, column: 4 }, end: { line: 229, column: 30 } }, '118': { start: { line: 230, column: 4 }, end: { line: 232, column: 11 } }, '119': { start: { line: 231, column: 6 }, end: { line: 231, column: 31 } }, '120': { start: { line: 234, column: 4 }, end: { line: 234, column: 32 } }, '121': { start: { line: 235, column: 4 }, end: { line: 235, column: 30 } }, '122': { start: { line: 236, column: 4 }, end: { line: 236, column: 32 } }, '123': { start: { line: 238, column: 19 }, end: { line: 240, column: 9 } }, '124': { start: { line: 239, column: 4 }, end: { line: 239, column: 21 } }, '125': { start: { line: 241, column: 2 }, end: { line: 255, column: 12 } }, '126': { start: { line: 242, column: 4 }, end: { line: 242, column: 33 } }, '127': { start: { line: 243, column: 4 }, end: { line: 243, column: 32 } }, '128': { start: { line: 244, column: 4 }, end: { line: 250, column: 5 } }, '129': { start: { line: 245, column: 6 }, end: { line: 245, column: 31 } }, '130': { start: { line: 246, column: 6 }, end: { line: 246, column: 35 } }, '131': { start: { line: 248, column: 6 }, end: { line: 248, column: 32 } }, '132': { start: { line: 249, column: 6 }, end: { line: 249, column: 34 } }, '133': { start: { line: 251, column: 4 }, end: { line: 254, column: 20 } }, '134': { start: { line: 252, column: 6 }, end: { line: 252, column: 35 } }, '135': { start: { line: 253, column: 6 }, end: { line: 253, column: 32 } }, '136': { start: { line: 258, column: 27 }, end: { line: 260, column: 1 } }, '137': { start: { line: 259, column: 2 }, end: { line: 259, column: 43 } }, '138': { start: { line: 264, column: 22 }, end: { line: 264, column: 28 } }, '139': { start: { line: 267, column: 2 }, end: { line: 269, column: 3 } }, '140': { start: { line: 268, column: 4 }, end: { line: 268, column: 42 } }, '141': { start: { line: 270, column: 2 }, end: { line: 270, column: 45 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 3, column: 20 }, end: { line: 3, column: 21 } }, loc: { start: { line: 3, column: 46 }, end: { line: 139, column: 1 } }, line: 3 }, '1': { name: 'HtmlFormatter', decl: { start: { line: 6, column: 11 }, end: { line: 6, column: 24 } }, loc: { start: { line: 6, column: 27 }, end: { line: 9, column: 3 } }, line: 6 }, '2': { name: 'typeFormattterErrorFormatter', decl: { start: { line: 13, column: 20 }, end: { line: 13, column: 48 } }, loc: { start: { line: 13, column: 63 }, end: { line: 15, column: 5 } }, line: 13 }, '3': { name: 'formatValue', decl: { start: { line: 18, column: 20 }, end: { line: 18, column: 31 } }, loc: { start: { line: 18, column: 48 }, end: { line: 20, column: 5 } }, line: 18 }, '4': { name: 'formatTextDiffString', decl: { start: { line: 23, column: 20 }, end: { line: 23, column: 40 } }, loc: { start: { line: 23, column: 57 }, end: { line: 38, column: 5 } }, line: 23 }, '5': { name: 'rootBegin', decl: { start: { line: 41, column: 20 }, end: { line: 41, column: 29 } }, loc: { start: { line: 41, column: 55 }, end: { line: 44, column: 5 } }, line: 41 }, '6': { name: 'rootEnd', decl: { start: { line: 47, column: 20 }, end: { line: 47, column: 27 } }, loc: { start: { line: 47, column: 37 }, end: { line: 49, column: 5 } }, line: 47 }, '7': { name: 'nodeBegin', decl: { start: { line: 52, column: 20 }, end: { line: 52, column: 29 } }, loc: { start: { line: 52, column: 69 }, end: { line: 55, column: 5 } }, line: 52 }, '8': { name: 'nodeEnd', decl: { start: { line: 58, column: 20 }, end: { line: 58, column: 27 } }, loc: { start: { line: 58, column: 37 }, end: { line: 60, column: 5 } }, line: 58 }, '9': { name: 'format_unchanged', decl: { start: { line: 67, column: 20 }, end: { line: 67, column: 36 } }, loc: { start: { line: 67, column: 59 }, end: { line: 74, column: 5 } }, line: 67 }, '10': { name: 'format_movedestination', decl: { start: { line: 77, column: 20 }, end: { line: 77, column: 42 } }, loc: { start: { line: 77, column: 65 }, end: { line: 84, column: 5 } }, line: 77 }, '11': { name: 'format_node', decl: { start: { line: 87, column: 20 }, end: { line: 87, column: 31 } }, loc: { start: { line: 87, column: 54 }, end: { line: 93, column: 5 } }, line: 87 }, '12': { name: 'format_added', decl: { start: { line: 96, column: 20 }, end: { line: 96, column: 32 } }, loc: { start: { line: 96, column: 49 }, end: { line: 100, column: 5 } }, line: 96 }, '13': { name: 'format_modified', decl: { start: { line: 103, column: 20 }, end: { line: 103, column: 35 } }, loc: { start: { line: 103, column: 52 }, end: { line: 109, column: 5 } }, line: 103 }, '14': { name: 'format_deleted', decl: { start: { line: 112, column: 20 }, end: { line: 112, column: 34 } }, loc: { start: { line: 112, column: 51 }, end: { line: 116, column: 5 } }, line: 112 }, '15': { name: 'format_moved', decl: { start: { line: 119, column: 20 }, end: { line: 119, column: 32 } }, loc: { start: { line: 119, column: 49 }, end: { line: 129, column: 5 } }, line: 119 }, '16': { name: 'format_textdiff', decl: { start: { line: 132, column: 20 }, end: { line: 132, column: 35 } }, loc: { start: { line: 132, column: 52 }, end: { line: 136, column: 5 } }, line: 132 }, '17': { name: 'htmlEscape', decl: { start: { line: 141, column: 9 }, end: { line: 141, column: 19 } }, loc: { start: { line: 141, column: 26 }, end: { line: 148, column: 1 } }, line: 141 }, '18': { name: 'jsondiffpatchHtmlFormatterAdjustArrows', decl: { start: { line: 150, column: 28 }, end: { line: 150, column: 66 } }, loc: { start: { line: 150, column: 76 }, end: { line: 199, column: 1 } }, line: 150 }, '19': { name: 'getElementText', decl: { start: { line: 152, column: 32 }, end: { line: 152, column: 46 } }, loc: { start: { line: 152, column: 53 }, end: { line: 156, column: 3 } }, line: 152 }, '20': { name: 'eachByQuery', decl: { start: { line: 157, column: 29 }, end: { line: 157, column: 40 } }, loc: { start: { line: 157, column: 56 }, end: { line: 162, column: 3 } }, line: 157 }, '21': { name: 'eachChildren', decl: { start: { line: 163, column: 30 }, end: { line: 163, column: 42 } }, loc: { start: { line: 163, column: 54 }, end: { line: 169, column: 3 } }, line: 163 }, '22': { name: '(anonymous_22)', decl: { start: { line: 170, column: 44 }, end: { line: 170, column: 45 } }, loc: { start: { line: 170, column: 61 }, end: { line: 198, column: 3 } }, line: 170 }, '23': { name: '(anonymous_23)', decl: { start: { line: 182, column: 28 }, end: { line: 182, column: 29 } }, loc: { start: { line: 182, column: 45 }, end: { line: 186, column: 5 } }, line: 182 }, '24': { name: 'showUnchanged', decl: { start: { line: 204, column: 36 }, end: { line: 204, column: 49 } }, loc: { start: { line: 204, column: 69 }, end: { line: 256, column: 1 } }, line: 204 }, '25': { name: '(anonymous_25)', decl: { start: { line: 230, column: 15 }, end: { line: 230, column: 16 } }, loc: { start: { line: 230, column: 27 }, end: { line: 232, column: 5 } }, line: 230 }, '26': { name: '(anonymous_26)', decl: { start: { line: 238, column: 31 }, end: { line: 238, column: 32 } }, loc: { start: { line: 238, column: 43 }, end: { line: 240, column: 3 } }, line: 238 }, '27': { name: '(anonymous_27)', decl: { start: { line: 241, column: 13 }, end: { line: 241, column: 14 } }, loc: { start: { line: 241, column: 25 }, end: { line: 255, column: 3 } }, line: 241 }, '28': { name: '(anonymous_28)', decl: { start: { line: 251, column: 15 }, end: { line: 251, column: 16 } }, loc: { start: { line: 251, column: 27 }, end: { line: 254, column: 5 } }, line: 251 }, '29': { name: 'hideUnchanged', decl: { start: { line: 258, column: 36 }, end: { line: 258, column: 49 } }, loc: { start: { line: 258, column: 63 }, end: { line: 260, column: 1 } }, line: 258 }, '30': { name: 'format', decl: { start: { line: 266, column: 16 }, end: { line: 266, column: 22 } }, loc: { start: { line: 266, column: 36 }, end: { line: 271, column: 1 } }, line: 266 } }, branchMap: { '0': { loc: { start: { line: 8, column: 57 }, end: { line: 8, column: 120 } }, type: 'binary-expr', locations: [{ start: { line: 8, column: 57 }, end: { line: 8, column: 80 } }, { start: { line: 8, column: 84 }, end: { line: 8, column: 120 } }], line: 8 }, '1': { loc: { start: { line: 42, column: 49 }, end: { line: 42, column: 109 } }, type: 'cond-expr', locations: [{ start: { line: 42, column: 60 }, end: { line: 42, column: 104 } }, { start: { line: 42, column: 107 }, end: { line: 42, column: 109 } }], line: 42 }, '2': { loc: { start: { line: 48, column: 30 }, end: { line: 48, column: 146 } }, type: 'cond-expr', locations: [{ start: { line: 48, column: 50 }, end: { line: 48, column: 141 } }, { start: { line: 48, column: 144 }, end: { line: 48, column: 146 } }], line: 48 }, '3': { loc: { start: { line: 53, column: 49 }, end: { line: 53, column: 109 } }, type: 'cond-expr', locations: [{ start: { line: 53, column: 60 }, end: { line: 53, column: 104 } }, { start: { line: 53, column: 107 }, end: { line: 53, column: 109 } }], line: 53 }, '4': { loc: { start: { line: 68, column: 6 }, end: { line: 70, column: 7 } }, type: 'if', locations: [{ start: { line: 68, column: 6 }, end: { line: 70, column: 7 } }, { start: { line: 68, column: 6 }, end: { line: 70, column: 7 } }], line: 68 }, '5': { loc: { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, type: 'if', locations: [{ start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }, { start: { line: 78, column: 6 }, end: { line: 80, column: 7 } }], line: 78 }, '6': { loc: { start: { line: 89, column: 21 }, end: { line: 89, column: 58 } }, type: 'cond-expr', locations: [{ start: { line: 89, column: 40 }, end: { line: 89, column: 47 } }, { start: { line: 89, column: 50 }, end: { line: 89, column: 58 } }], line: 89 }, '7': { loc: { start: { line: 151, column: 13 }, end: { line: 151, column: 32 } }, type: 'binary-expr', locations: [{ start: { line: 151, column: 13 }, end: { line: 151, column: 20 } }, { start: { line: 151, column: 24 }, end: { line: 151, column: 32 } }], line: 151 }, '8': { loc: { start: { line: 155, column: 11 }, end: { line: 155, column: 35 } }, type: 'binary-expr', locations: [{ start: { line: 155, column: 11 }, end: { line: 155, column: 22 } }, { start: { line: 155, column: 26 }, end: { line: 155, column: 35 } }], line: 155 }, '9': { loc: { start: { line: 183, column: 6 }, end: { line: 185, column: 7 } }, type: 'if', locations: [{ start: { line: 183, column: 6 }, end: { line: 185, column: 7 } }, { start: { line: 183, column: 6 }, end: { line: 185, column: 7 } }], line: 183 }, '10': { loc: { start: { line: 187, column: 4 }, end: { line: 189, column: 5 } }, type: 'if', locations: [{ start: { line: 187, column: 4 }, end: { line: 189, column: 5 } }, { start: { line: 187, column: 4 }, end: { line: 189, column: 5 } }], line: 187 }, '11': { loc: { start: { line: 193, column: 24 }, end: { line: 193, column: 51 } }, type: 'cond-expr', locations: [{ start: { line: 193, column: 39 }, end: { line: 193, column: 40 } }, { start: { line: 193, column: 43 }, end: { line: 193, column: 51 } }], line: 193 }, '12': { loc: { start: { line: 194, column: 18 }, end: { line: 194, column: 169 } }, type: 'cond-expr', locations: [{ start: { line: 194, column: 33 }, end: { line: 194, column: 99 } }, { start: { line: 194, column: 102 }, end: { line: 194, column: 169 } }], line: 194 }, '13': { loc: { start: { line: 205, column: 11 }, end: { line: 205, column: 32 } }, type: 'binary-expr', locations: [{ start: { line: 205, column: 11 }, end: { line: 205, column: 15 } }, { start: { line: 205, column: 19 }, end: { line: 205, column: 32 } }], line: 205 }, '14': { loc: { start: { line: 214, column: 2 }, end: { line: 216, column: 3 } }, type: 'if', locations: [{ start: { line: 214, column: 2 }, end: { line: 216, column: 3 } }, { start: { line: 214, column: 2 }, end: { line: 216, column: 3 } }], line: 214 }, '15': { loc: { start: { line: 217, column: 2 }, end: { line: 226, column: 3 } }, type: 'if', locations: [{ start: { line: 217, column: 2 }, end: { line: 226, column: 3 } }, { start: { line: 217, column: 2 }, end: { line: 226, column: 3 } }], line: 217 }, '16': { loc: { start: { line: 222, column: 4 }, end: { line: 224, column: 5 } }, type: 'if', locations: [{ start: { line: 222, column: 4 }, end: { line: 224, column: 5 } }, { start: { line: 222, column: 4 }, end: { line: 224, column: 5 } }], line: 222 }, '17': { loc: { start: { line: 227, column: 2 }, end: { line: 237, column: 3 } }, type: 'if', locations: [{ start: { line: 227, column: 2 }, end: { line: 237, column: 3 } }, { start: { line: 227, column: 2 }, end: { line: 237, column: 3 } }], line: 227 }, '18': { loc: { start: { line: 244, column: 4 }, end: { line: 250, column: 5 } }, type: 'if', locations: [{ start: { line: 244, column: 4 }, end: { line: 250, column: 5 } }, { start: { line: 244, column: 4 }, end: { line: 250, column: 5 } }], line: 244 }, '19': { loc: { start: { line: 267, column: 2 }, end: { line: 269, column: 3 } }, type: 'if', locations: [{ start: { line: 267, column: 2 }, end: { line: 269, column: 3 } }, { start: { line: 267, column: 2 }, end: { line: 269, column: 3 } }], line: 267 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0, '92': 0, '93': 0, '94': 0, '95': 0, '96': 0, '97': 0, '98': 0, '99': 0, '100': 0, '101': 0, '102': 0, '103': 0, '104': 0, '105': 0, '106': 0, '107': 0, '108': 0, '109': 0, '110': 0, '111': 0, '112': 0, '113': 0, '114': 0, '115': 0, '116': 0, '117': 0, '118': 0, '119': 0, '120': 0, '121': 0, '122': 0, '123': 0, '124': 0, '125': 0, '126': 0, '127': 0, '128': 0, '129': 0, '130': 0, '131': 0, '132': 0, '133': 0, '134': 0, '135': 0, '136': 0, '137': 0, '138': 0, '139': 0, '140': 0, '141': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3567 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3568 | return coverage[path];
|
3569 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3570 | }();var HtmlFormatter = (cov_273kjaqpct.s[0]++, function (_BaseFormatter) {
|
3571 | cov_273kjaqpct.f[0]++;cov_273kjaqpct.s[1]++;inherits$1(HtmlFormatter, _BaseFormatter);function HtmlFormatter() {
|
3572 | cov_273kjaqpct.f[1]++;cov_273kjaqpct.s[2]++;classCallCheck$1(this, HtmlFormatter);cov_273kjaqpct.s[3]++;return possibleConstructorReturn$1(this, ((cov_273kjaqpct.b[0][0]++, HtmlFormatter.__proto__) || (cov_273kjaqpct.b[0][1]++, Object.getPrototypeOf(HtmlFormatter))).apply(this, arguments));
|
3573 | }cov_273kjaqpct.s[4]++;createClass$1(HtmlFormatter, [{ key: 'typeFormattterErrorFormatter', value: function typeFormattterErrorFormatter(context, err) {
|
3574 | cov_273kjaqpct.f[2]++;cov_273kjaqpct.s[5]++;context.out('<pre class="jsondiffpatch-error">' + err + '</pre>');
|
3575 | } }, { key: 'formatValue', value: function formatValue(context, value) {
|
3576 | cov_273kjaqpct.f[3]++;cov_273kjaqpct.s[6]++;context.out('<pre>' + htmlEscape(JSON.stringify(value, null, 2)) + '</pre>');
|
3577 | } }, { key: 'formatTextDiffString', value: function formatTextDiffString(context, value) {
|
3578 | cov_273kjaqpct.f[4]++;var lines = (cov_273kjaqpct.s[7]++, this.parseTextDiff(value));cov_273kjaqpct.s[8]++;context.out('<ul class="jsondiffpatch-textdiff">');cov_273kjaqpct.s[9]++;for (var i = 0, l = lines.length; i < l; i++) {
|
3579 | var line = (cov_273kjaqpct.s[10]++, lines[i]);cov_273kjaqpct.s[11]++;context.out('<li><div class="jsondiffpatch-textdiff-location">' + ('<span class="jsondiffpatch-textdiff-line-number">' + line.location.line + '</span><span class="jsondiffpatch-textdiff-char">' + line.location.chr + '</span></div><div class="jsondiffpatch-textdiff-line">'));var pieces = (cov_273kjaqpct.s[12]++, line.pieces);cov_273kjaqpct.s[13]++;for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
|
3580 | var piece = (cov_273kjaqpct.s[14]++, pieces[pieceIndex]);cov_273kjaqpct.s[15]++;context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' + htmlEscape(unescape(piece.text)) + '</span>');
|
3581 | }cov_273kjaqpct.s[16]++;context.out('</div></li>');
|
3582 | }cov_273kjaqpct.s[17]++;context.out('</ul>');
|
3583 | } }, { key: 'rootBegin', value: function rootBegin(context, type, nodeType) {
|
3584 | cov_273kjaqpct.f[5]++;var nodeClass = (cov_273kjaqpct.s[18]++, 'jsondiffpatch-' + type + (nodeType ? (cov_273kjaqpct.b[1][0]++, ' jsondiffpatch-child-node-type-' + nodeType) : (cov_273kjaqpct.b[1][1]++, '')));cov_273kjaqpct.s[19]++;context.out('<div class="jsondiffpatch-delta ' + nodeClass + '">');
|
3585 | } }, { key: 'rootEnd', value: function rootEnd(context) {
|
3586 | cov_273kjaqpct.f[6]++;cov_273kjaqpct.s[20]++;context.out('</div>' + (context.hasArrows ? (cov_273kjaqpct.b[2][0]++, '<script type="text/javascript">setTimeout(' + (adjustArrows.toString() + ',10);</script>')) : (cov_273kjaqpct.b[2][1]++, '')));
|
3587 | } }, { key: 'nodeBegin', value: function nodeBegin(context, key, leftKey, type, nodeType) {
|
3588 | cov_273kjaqpct.f[7]++;var nodeClass = (cov_273kjaqpct.s[21]++, 'jsondiffpatch-' + type + (nodeType ? (cov_273kjaqpct.b[3][0]++, ' jsondiffpatch-child-node-type-' + nodeType) : (cov_273kjaqpct.b[3][1]++, '')));cov_273kjaqpct.s[22]++;context.out('<li class="' + nodeClass + '" data-key="' + leftKey + '">' + ('<div class="jsondiffpatch-property-name">' + leftKey + '</div>'));
|
3589 | } }, { key: 'nodeEnd', value: function nodeEnd(context) {
|
3590 | cov_273kjaqpct.f[8]++;cov_273kjaqpct.s[23]++;context.out('</li>');
|
3591 | } }, { key: 'format_unchanged', value: function format_unchanged(context, delta, left) {
|
3592 | cov_273kjaqpct.f[9]++;cov_273kjaqpct.s[24]++;if (typeof left === 'undefined') {
|
3593 | cov_273kjaqpct.b[4][0]++;cov_273kjaqpct.s[25]++;return;
|
3594 | } else {
|
3595 | cov_273kjaqpct.b[4][1]++;
|
3596 | }cov_273kjaqpct.s[26]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[27]++;this.formatValue(context, left);cov_273kjaqpct.s[28]++;context.out('</div>');
|
3597 | } }, { key: 'format_movedestination', value: function format_movedestination(context, delta, left) {
|
3598 | cov_273kjaqpct.f[10]++;cov_273kjaqpct.s[29]++;if (typeof left === 'undefined') {
|
3599 | cov_273kjaqpct.b[5][0]++;cov_273kjaqpct.s[30]++;return;
|
3600 | } else {
|
3601 | cov_273kjaqpct.b[5][1]++;
|
3602 | }cov_273kjaqpct.s[31]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[32]++;this.formatValue(context, left);cov_273kjaqpct.s[33]++;context.out('</div>');
|
3603 | } }, { key: 'format_node', value: function format_node(context, delta, left) {
|
3604 | cov_273kjaqpct.f[11]++;
|
3605 | var nodeType = (cov_273kjaqpct.s[34]++, delta._t === 'a' ? (cov_273kjaqpct.b[6][0]++, 'array') : (cov_273kjaqpct.b[6][1]++, 'object'));cov_273kjaqpct.s[35]++;context.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-' + nodeType + '">');cov_273kjaqpct.s[36]++;this.formatDeltaChildren(context, delta, left);cov_273kjaqpct.s[37]++;context.out('</ul>');
|
3606 | } }, { key: 'format_added', value: function format_added(context, delta) {
|
3607 | cov_273kjaqpct.f[12]++;cov_273kjaqpct.s[38]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[39]++;this.formatValue(context, delta[0]);cov_273kjaqpct.s[40]++;context.out('</div>');
|
3608 | } }, { key: 'format_modified', value: function format_modified(context, delta) {
|
3609 | cov_273kjaqpct.f[13]++;cov_273kjaqpct.s[41]++;context.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">');cov_273kjaqpct.s[42]++;this.formatValue(context, delta[0]);cov_273kjaqpct.s[43]++;context.out('</div>' + '<div class="jsondiffpatch-value jsondiffpatch-right-value">');cov_273kjaqpct.s[44]++;this.formatValue(context, delta[1]);cov_273kjaqpct.s[45]++;context.out('</div>');
|
3610 | } }, { key: 'format_deleted', value: function format_deleted(context, delta) {
|
3611 | cov_273kjaqpct.f[14]++;cov_273kjaqpct.s[46]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[47]++;this.formatValue(context, delta[0]);cov_273kjaqpct.s[48]++;context.out('</div>');
|
3612 | } }, { key: 'format_moved', value: function format_moved(context, delta) {
|
3613 | cov_273kjaqpct.f[15]++;cov_273kjaqpct.s[49]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[50]++;this.formatValue(context, delta[0]);cov_273kjaqpct.s[51]++;context.out('</div><div class="jsondiffpatch-moved-destination">' + delta[1] + '</div>');
|
3614 | cov_273kjaqpct.s[52]++;context.out( '<div class="jsondiffpatch-arrow" ' + 'style="position: relative; left: -34px;">\n <svg width="30" height="60" ' + 'style="position: absolute; display: none;">\n <defs>\n <marker id="markerArrow" markerWidth="8" markerHeight="8"\n refx="2" refy="4"\n orient="auto" markerUnits="userSpaceOnUse">\n <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\n </marker>\n </defs>\n <path d="M30,0 Q-10,25 26,50"\n style="stroke: #88f; stroke-width: 2px; fill: none; ' + 'stroke-opacity: 0.5; marker-end: url(#markerArrow);"\n ></path>\n </svg>\n </div>');cov_273kjaqpct.s[53]++;context.hasArrows = true;
|
3615 | } }, { key: 'format_textdiff', value: function format_textdiff(context, delta) {
|
3616 | cov_273kjaqpct.f[16]++;cov_273kjaqpct.s[54]++;context.out('<div class="jsondiffpatch-value">');cov_273kjaqpct.s[55]++;this.formatTextDiffString(context, delta[0]);cov_273kjaqpct.s[56]++;context.out('</div>');
|
3617 | } }]);cov_273kjaqpct.s[57]++;return HtmlFormatter;
|
3618 | }(BaseFormatter));function htmlEscape(text) {
|
3619 | cov_273kjaqpct.f[17]++;var html = (cov_273kjaqpct.s[58]++, text);var replacements = (cov_273kjaqpct.s[59]++, [[/&/g, '&'], [/</g, '<'], [/>/g, '>'], [/'/g, '''], [/"/g, '"']]);cov_273kjaqpct.s[60]++;for (var i = 0; i < replacements.length; i++) {
|
3620 | cov_273kjaqpct.s[61]++;html = html.replace(replacements[i][0], replacements[i][1]);
|
3621 | }cov_273kjaqpct.s[62]++;return html;
|
3622 | }cov_273kjaqpct.s[63]++;var adjustArrows = function jsondiffpatchHtmlFormatterAdjustArrows(nodeArg) {
|
3623 | cov_273kjaqpct.f[18]++;var node = (cov_273kjaqpct.s[64]++, (cov_273kjaqpct.b[7][0]++, nodeArg) || (cov_273kjaqpct.b[7][1]++, document));cov_273kjaqpct.s[65]++;var getElementText = function getElementText(_ref) {
|
3624 | cov_273kjaqpct.f[19]++;var textContent = (cov_273kjaqpct.s[66]++, _ref.textContent),
|
3625 | innerText = (cov_273kjaqpct.s[67]++, _ref.innerText);cov_273kjaqpct.s[68]++;return (cov_273kjaqpct.b[8][0]++, textContent) || (cov_273kjaqpct.b[8][1]++, innerText);
|
3626 | };cov_273kjaqpct.s[69]++;var eachByQuery = function eachByQuery(el, query, fn) {
|
3627 | cov_273kjaqpct.f[20]++;var elems = (cov_273kjaqpct.s[70]++, el.querySelectorAll(query));cov_273kjaqpct.s[71]++;for (var i = 0, l = elems.length; i < l; i++) {
|
3628 | cov_273kjaqpct.s[72]++;fn(elems[i]);
|
3629 | }
|
3630 | };cov_273kjaqpct.s[73]++;var eachChildren = function eachChildren(_ref2, fn) {
|
3631 | cov_273kjaqpct.f[21]++;var children = (cov_273kjaqpct.s[74]++, _ref2.children);cov_273kjaqpct.s[75]++;for (var i = 0, l = children.length; i < l; i++) {
|
3632 | cov_273kjaqpct.s[76]++;fn(children[i], i);
|
3633 | }
|
3634 | };cov_273kjaqpct.s[77]++;eachByQuery(node, '.jsondiffpatch-arrow', function (_ref3) {
|
3635 | cov_273kjaqpct.f[22]++;var parentNode = (cov_273kjaqpct.s[78]++, _ref3.parentNode),
|
3636 | children = (cov_273kjaqpct.s[79]++, _ref3.children),
|
3637 | style = (cov_273kjaqpct.s[80]++, _ref3.style);var arrowParent = (cov_273kjaqpct.s[81]++, parentNode);var svg = (cov_273kjaqpct.s[82]++, children[0]);var path = (cov_273kjaqpct.s[83]++, svg.children[1]);cov_273kjaqpct.s[84]++;svg.style.display = 'none';var destination = (cov_273kjaqpct.s[85]++, getElementText(arrowParent.querySelector('.jsondiffpatch-moved-destination')));var container = (cov_273kjaqpct.s[86]++, arrowParent.parentNode);var destinationElem = (cov_273kjaqpct.s[87]++, void 0);cov_273kjaqpct.s[88]++;eachChildren(container, function (child) {
|
3638 | cov_273kjaqpct.f[23]++;cov_273kjaqpct.s[89]++;if (child.getAttribute('data-key') === destination) {
|
3639 | cov_273kjaqpct.b[9][0]++;cov_273kjaqpct.s[90]++;destinationElem = child;
|
3640 | } else {
|
3641 | cov_273kjaqpct.b[9][1]++;
|
3642 | }
|
3643 | });cov_273kjaqpct.s[91]++;if (!destinationElem) {
|
3644 | cov_273kjaqpct.b[10][0]++;cov_273kjaqpct.s[92]++;return;
|
3645 | } else {
|
3646 | cov_273kjaqpct.b[10][1]++;
|
3647 | }cov_273kjaqpct.s[93]++;try {
|
3648 | var distance = (cov_273kjaqpct.s[94]++, destinationElem.offsetTop - arrowParent.offsetTop);cov_273kjaqpct.s[95]++;svg.setAttribute('height', Math.abs(distance) + 6);cov_273kjaqpct.s[96]++;style.top = -8 + (distance > 0 ? (cov_273kjaqpct.b[11][0]++, 0) : (cov_273kjaqpct.b[11][1]++, distance)) + 'px';var curve = (cov_273kjaqpct.s[97]++, distance > 0 ? (cov_273kjaqpct.b[12][0]++, 'M30,0 Q-10,' + Math.round(distance / 2) + ' 26,' + (distance - 4)) : (cov_273kjaqpct.b[12][1]++, 'M30,' + -distance + ' Q-10,' + Math.round(-distance / 2) + ' 26,4'));cov_273kjaqpct.s[98]++;path.setAttribute('d', curve);cov_273kjaqpct.s[99]++;svg.style.display = '';
|
3649 | } catch (err) {}
|
3650 | });
|
3651 | }; cov_273kjaqpct.s[100]++;var showUnchanged = function showUnchanged(show, node, delay) {
|
3652 | cov_273kjaqpct.f[24]++;var el = (cov_273kjaqpct.s[101]++, (cov_273kjaqpct.b[13][0]++, node) || (cov_273kjaqpct.b[13][1]++, document.body));var prefix = (cov_273kjaqpct.s[102]++, 'jsondiffpatch-unchanged-');var classes = (cov_273kjaqpct.s[103]++, { showing: prefix + 'showing', hiding: prefix + 'hiding', visible: prefix + 'visible', hidden: prefix + 'hidden' });var list = (cov_273kjaqpct.s[104]++, el.classList);cov_273kjaqpct.s[105]++;if (!list) {
|
3653 | cov_273kjaqpct.b[14][0]++;cov_273kjaqpct.s[106]++;return;
|
3654 | } else {
|
3655 | cov_273kjaqpct.b[14][1]++;
|
3656 | }cov_273kjaqpct.s[107]++;if (!delay) {
|
3657 | cov_273kjaqpct.b[15][0]++;cov_273kjaqpct.s[108]++;list.remove(classes.showing);cov_273kjaqpct.s[109]++;list.remove(classes.hiding);cov_273kjaqpct.s[110]++;list.remove(classes.visible);cov_273kjaqpct.s[111]++;list.remove(classes.hidden);cov_273kjaqpct.s[112]++;if (show === false) {
|
3658 | cov_273kjaqpct.b[16][0]++;cov_273kjaqpct.s[113]++;list.add(classes.hidden);
|
3659 | } else {
|
3660 | cov_273kjaqpct.b[16][1]++;
|
3661 | }cov_273kjaqpct.s[114]++;return;
|
3662 | } else {
|
3663 | cov_273kjaqpct.b[15][1]++;
|
3664 | }cov_273kjaqpct.s[115]++;if (show === false) {
|
3665 | cov_273kjaqpct.b[17][0]++;cov_273kjaqpct.s[116]++;list.remove(classes.showing);cov_273kjaqpct.s[117]++;list.add(classes.visible);cov_273kjaqpct.s[118]++;setTimeout(function () {
|
3666 | cov_273kjaqpct.f[25]++;cov_273kjaqpct.s[119]++;list.add(classes.hiding);
|
3667 | }, 10);
|
3668 | } else {
|
3669 | cov_273kjaqpct.b[17][1]++;cov_273kjaqpct.s[120]++;list.remove(classes.hiding);cov_273kjaqpct.s[121]++;list.add(classes.showing);cov_273kjaqpct.s[122]++;list.remove(classes.hidden);
|
3670 | }var intervalId = (cov_273kjaqpct.s[123]++, setInterval(function () {
|
3671 | cov_273kjaqpct.f[26]++;cov_273kjaqpct.s[124]++;adjustArrows(el);
|
3672 | }, 100));cov_273kjaqpct.s[125]++;setTimeout(function () {
|
3673 | cov_273kjaqpct.f[27]++;cov_273kjaqpct.s[126]++;list.remove(classes.showing);cov_273kjaqpct.s[127]++;list.remove(classes.hiding);cov_273kjaqpct.s[128]++;if (show === false) {
|
3674 | cov_273kjaqpct.b[18][0]++;cov_273kjaqpct.s[129]++;list.add(classes.hidden);cov_273kjaqpct.s[130]++;list.remove(classes.visible);
|
3675 | } else {
|
3676 | cov_273kjaqpct.b[18][1]++;cov_273kjaqpct.s[131]++;list.add(classes.visible);cov_273kjaqpct.s[132]++;list.remove(classes.hidden);
|
3677 | }cov_273kjaqpct.s[133]++;setTimeout(function () {
|
3678 | cov_273kjaqpct.f[28]++;cov_273kjaqpct.s[134]++;list.remove(classes.visible);cov_273kjaqpct.s[135]++;clearInterval(intervalId);
|
3679 | }, delay + 400);
|
3680 | }, delay);
|
3681 | };cov_273kjaqpct.s[136]++;var hideUnchanged = function hideUnchanged(node, delay) {
|
3682 | cov_273kjaqpct.f[29]++;cov_273kjaqpct.s[137]++;return showUnchanged(false, node, delay);
|
3683 | };var defaultInstance = (cov_273kjaqpct.s[138]++, void 0);function format(delta, left) {
|
3684 | cov_273kjaqpct.f[30]++;cov_273kjaqpct.s[139]++;if (!defaultInstance) {
|
3685 | cov_273kjaqpct.b[19][0]++;cov_273kjaqpct.s[140]++;defaultInstance = new HtmlFormatter();
|
3686 | } else {
|
3687 | cov_273kjaqpct.b[19][1]++;
|
3688 | }cov_273kjaqpct.s[141]++;return defaultInstance.format(delta, left);
|
3689 | }
|
3690 |
|
3691 | var html = Object.freeze({
|
3692 | showUnchanged: showUnchanged,
|
3693 | hideUnchanged: hideUnchanged,
|
3694 | default: HtmlFormatter,
|
3695 | format: format
|
3696 | });
|
3697 |
|
3698 | var cov_23zb36bnir = function () {
|
3699 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/annotated.js',
|
3700 | hash = '750ced81bce7e3624b7eddbe3e7bc0f18f2d4a8b',
|
3701 | global = new Function('return this')(),
|
3702 | gcv = '__coverage__',
|
3703 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/annotated.js', statementMap: { '0': { start: { line: 3, column: 25 }, end: { line: 114, column: 16 } }, '1': { start: { line: 4, column: 2 }, end: { line: 4, column: 60 } }, '2': { start: { line: 7, column: 4 }, end: { line: 7, column: 58 } }, '3': { start: { line: 9, column: 16 }, end: { line: 9, column: 148 } }, '4': { start: { line: 11, column: 4 }, end: { line: 11, column: 42 } }, '5': { start: { line: 12, column: 4 }, end: { line: 12, column: 17 } }, '6': { start: { line: 15, column: 2 }, end: { line: 112, column: 6 } }, '7': { start: { line: 18, column: 6 }, end: { line: 18, column: 162 } }, '8': { start: { line: 19, column: 6 }, end: { line: 22, column: 8 } }, '9': { start: { line: 20, column: 8 }, end: { line: 20, column: 98 } }, '10': { start: { line: 21, column: 8 }, end: { line: 21, column: 78 } }, '11': { start: { line: 23, column: 6 }, end: { line: 31, column: 8 } }, '12': { start: { line: 24, column: 8 }, end: { line: 24, column: 145 } }, '13': { start: { line: 25, column: 8 }, end: { line: 25, column: 39 } }, '14': { start: { line: 26, column: 8 }, end: { line: 26, column: 65 } }, '15': { start: { line: 27, column: 8 }, end: { line: 27, column: 26 } }, '16': { start: { line: 28, column: 8 }, end: { line: 28, column: 77 } }, '17': { start: { line: 29, column: 8 }, end: { line: 29, column: 30 } }, '18': { start: { line: 30, column: 8 }, end: { line: 30, column: 40 } }, '19': { start: { line: 36, column: 6 }, end: { line: 36, column: 76 } }, '20': { start: { line: 41, column: 18 }, end: { line: 41, column: 43 } }, '21': { start: { line: 42, column: 6 }, end: { line: 42, column: 57 } }, '22': { start: { line: 43, column: 6 }, end: { line: 52, column: 7 } }, '23': { start: { line: 44, column: 19 }, end: { line: 44, column: 27 } }, '24': { start: { line: 45, column: 8 }, end: { line: 45, column: 283 } }, '25': { start: { line: 46, column: 21 }, end: { line: 46, column: 32 } }, '26': { start: { line: 47, column: 8 }, end: { line: 50, column: 9 } }, '27': { start: { line: 48, column: 22 }, end: { line: 48, column: 40 } }, '28': { start: { line: 49, column: 10 }, end: { line: 49, column: 107 } }, '29': { start: { line: 51, column: 8 }, end: { line: 51, column: 35 } }, '30': { start: { line: 53, column: 6 }, end: { line: 53, column: 27 } }, '31': { start: { line: 58, column: 6 }, end: { line: 58, column: 67 } }, '32': { start: { line: 59, column: 6 }, end: { line: 62, column: 7 } }, '33': { start: { line: 60, column: 8 }, end: { line: 60, column: 25 } }, '34': { start: { line: 61, column: 8 }, end: { line: 61, column: 25 } }, '35': { start: { line: 63, column: 6 }, end: { line: 65, column: 7 } }, '36': { start: { line: 64, column: 8 }, end: { line: 64, column: 87 } }, '37': { start: { line: 70, column: 6 }, end: { line: 73, column: 7 } }, '38': { start: { line: 71, column: 8 }, end: { line: 71, column: 27 } }, '39': { start: { line: 72, column: 8 }, end: { line: 72, column: 25 } }, '40': { start: { line: 74, column: 6 }, end: { line: 74, column: 30 } }, '41': { start: { line: 79, column: 6 }, end: { line: 79, column: 48 } }, '42': { start: { line: 80, column: 6 }, end: { line: 82, column: 7 } }, '43': { start: { line: 81, column: 8 }, end: { line: 81, column: 25 } }, '44': { start: { line: 83, column: 6 }, end: { line: 85, column: 7 } }, '45': { start: { line: 84, column: 8 }, end: { line: 84, column: 87 } }, '46': { start: { line: 90, column: 6 }, end: { line: 92, column: 7 } }, '47': { start: { line: 91, column: 8 }, end: { line: 91, column: 27 } }, '48': { start: { line: 93, column: 6 }, end: { line: 93, column: 45 } }, '49': { start: { line: 110, column: 6 }, end: { line: 110, column: 53 } }, '50': { start: { line: 113, column: 2 }, end: { line: 113, column: 28 } }, '51': { start: { line: 118, column: 23 }, end: { line: 120, column: 1 } }, '52': { start: { line: 119, column: 2 }, end: { line: 119, column: 76 } }, '53': { start: { line: 122, column: 23 }, end: { line: 160, column: 1 } }, '54': { start: { line: 124, column: 23 }, end: { line: 124, column: 49 } }, '55': { start: { line: 125, column: 4 }, end: { line: 127, column: 5 } }, '56': { start: { line: 126, column: 6 }, end: { line: 126, column: 40 } }, '57': { start: { line: 128, column: 4 }, end: { line: 130, column: 5 } }, '58': { start: { line: 129, column: 6 }, end: { line: 129, column: 57 } }, '59': { start: { line: 131, column: 4 }, end: { line: 131, column: 70 } }, '60': { start: { line: 134, column: 23 }, end: { line: 134, column: 64 } }, '61': { start: { line: 135, column: 4 }, end: { line: 137, column: 5 } }, '62': { start: { line: 136, column: 6 }, end: { line: 136, column: 43 } }, '63': { start: { line: 138, column: 4 }, end: { line: 140, column: 5 } }, '64': { start: { line: 139, column: 6 }, end: { line: 139, column: 57 } }, '65': { start: { line: 141, column: 4 }, end: { line: 141, column: 73 } }, '66': { start: { line: 144, column: 23 }, end: { line: 144, column: 60 } }, '67': { start: { line: 145, column: 4 }, end: { line: 147, column: 5 } }, '68': { start: { line: 146, column: 6 }, end: { line: 146, column: 43 } }, '69': { start: { line: 148, column: 4 }, end: { line: 150, column: 5 } }, '70': { start: { line: 149, column: 6 }, end: { line: 149, column: 54 } }, '71': { start: { line: 151, column: 4 }, end: { line: 151, column: 73 } }, '72': { start: { line: 154, column: 4 }, end: { line: 154, column: 202 } }, '73': { start: { line: 157, column: 19 }, end: { line: 157, column: 155 } }, '74': { start: { line: 158, column: 4 }, end: { line: 158, column: 155 } }, '75': { start: { line: 162, column: 22 }, end: { line: 174, column: 1 } }, '76': { start: { line: 163, column: 18 }, end: { line: 163, column: 42 } }, '77': { start: { line: 164, column: 18 }, end: { line: 164, column: 45 } }, '78': { start: { line: 165, column: 17 }, end: { line: 165, column: 98 } }, '79': { start: { line: 166, column: 13 }, end: { line: 166, column: 43 } }, '80': { start: { line: 167, column: 2 }, end: { line: 170, column: 3 } }, '81': { start: { line: 169, column: 4 }, end: { line: 169, column: 49 } }, '82': { start: { line: 171, column: 2 }, end: { line: 171, column: 19 } }, '83': { start: { line: 172, column: 2 }, end: { line: 172, column: 30 } }, '84': { start: { line: 173, column: 2 }, end: { line: 173, column: 21 } }, '85': { start: { line: 177, column: 0 }, end: { line: 177, column: 60 } }, '86': { start: { line: 178, column: 0 }, end: { line: 178, column: 63 } }, '87': { start: { line: 179, column: 0 }, end: { line: 179, column: 62 } }, '88': { start: { line: 180, column: 0 }, end: { line: 180, column: 60 } }, '89': { start: { line: 181, column: 0 }, end: { line: 181, column: 63 } }, '90': { start: { line: 188, column: 22 }, end: { line: 188, column: 28 } }, '91': { start: { line: 191, column: 2 }, end: { line: 193, column: 3 } }, '92': { start: { line: 192, column: 4 }, end: { line: 192, column: 47 } }, '93': { start: { line: 194, column: 2 }, end: { line: 194, column: 45 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 3, column: 25 }, end: { line: 3, column: 26 } }, loc: { start: { line: 3, column: 51 }, end: { line: 114, column: 1 } }, line: 3 }, '1': { name: 'AnnotatedFormatter', decl: { start: { line: 6, column: 11 }, end: { line: 6, column: 29 } }, loc: { start: { line: 6, column: 32 }, end: { line: 13, column: 3 } }, line: 6 }, '2': { name: 'prepareContext', decl: { start: { line: 17, column: 20 }, end: { line: 17, column: 34 } }, loc: { start: { line: 17, column: 44 }, end: { line: 32, column: 5 } }, line: 17 }, '3': { name: '(anonymous_3)', decl: { start: { line: 19, column: 23 }, end: { line: 19, column: 24 } }, loc: { start: { line: 19, column: 41 }, end: { line: 22, column: 7 } }, line: 19 }, '4': { name: '(anonymous_4)', decl: { start: { line: 23, column: 20 }, end: { line: 23, column: 21 } }, loc: { start: { line: 23, column: 46 }, end: { line: 31, column: 7 } }, line: 23 }, '5': { name: 'typeFormattterErrorFormatter', decl: { start: { line: 35, column: 20 }, end: { line: 35, column: 48 } }, loc: { start: { line: 35, column: 63 }, end: { line: 37, column: 5 } }, line: 35 }, '6': { name: 'formatTextDiffString', decl: { start: { line: 40, column: 20 }, end: { line: 40, column: 40 } }, loc: { start: { line: 40, column: 57 }, end: { line: 54, column: 5 } }, line: 40 }, '7': { name: 'rootBegin', decl: { start: { line: 57, column: 20 }, end: { line: 57, column: 29 } }, loc: { start: { line: 57, column: 55 }, end: { line: 66, column: 5 } }, line: 57 }, '8': { name: 'rootEnd', decl: { start: { line: 69, column: 20 }, end: { line: 69, column: 27 } }, loc: { start: { line: 69, column: 43 }, end: { line: 75, column: 5 } }, line: 69 }, '9': { name: 'nodeBegin', decl: { start: { line: 78, column: 20 }, end: { line: 78, column: 29 } }, loc: { start: { line: 78, column: 69 }, end: { line: 86, column: 5 } }, line: 78 }, '10': { name: 'nodeEnd', decl: { start: { line: 89, column: 20 }, end: { line: 89, column: 27 } }, loc: { start: { line: 89, column: 75 }, end: { line: 94, column: 5 } }, line: 89 }, '11': { name: 'format_unchanged', decl: { start: { line: 102, column: 20 }, end: { line: 102, column: 36 } }, loc: { start: { line: 102, column: 39 }, end: { line: 102, column: 41 } }, line: 102 }, '12': { name: 'format_movedestination', decl: { start: { line: 105, column: 20 }, end: { line: 105, column: 42 } }, loc: { start: { line: 105, column: 45 }, end: { line: 105, column: 47 } }, line: 105 }, '13': { name: 'format_node', decl: { start: { line: 108, column: 20 }, end: { line: 108, column: 31 } }, loc: { start: { line: 108, column: 54 }, end: { line: 111, column: 5 } }, line: 108 }, '14': { name: 'wrapPropertyName', decl: { start: { line: 118, column: 32 }, end: { line: 118, column: 48 } }, loc: { start: { line: 118, column: 55 }, end: { line: 120, column: 1 } }, line: 118 }, '15': { name: 'added', decl: { start: { line: 123, column: 18 }, end: { line: 123, column: 23 } }, loc: { start: { line: 123, column: 51 }, end: { line: 132, column: 3 } }, line: 123 }, '16': { name: 'modified', decl: { start: { line: 133, column: 21 }, end: { line: 133, column: 29 } }, loc: { start: { line: 133, column: 57 }, end: { line: 142, column: 3 } }, line: 133 }, '17': { name: 'deleted', decl: { start: { line: 143, column: 20 }, end: { line: 143, column: 27 } }, loc: { start: { line: 143, column: 55 }, end: { line: 152, column: 3 } }, line: 143 }, '18': { name: 'moved', decl: { start: { line: 153, column: 18 }, end: { line: 153, column: 23 } }, loc: { start: { line: 153, column: 51 }, end: { line: 155, column: 3 } }, line: 153 }, '19': { name: 'textdiff', decl: { start: { line: 156, column: 21 }, end: { line: 156, column: 29 } }, loc: { start: { line: 156, column: 57 }, end: { line: 159, column: 3 } }, line: 156 }, '20': { name: 'formatAnyChange', decl: { start: { line: 162, column: 31 }, end: { line: 162, column: 46 } }, loc: { start: { line: 162, column: 63 }, end: { line: 174, column: 1 } }, line: 162 }, '21': { name: 'format', decl: { start: { line: 190, column: 16 }, end: { line: 190, column: 22 } }, loc: { start: { line: 190, column: 36 }, end: { line: 195, column: 1 } }, line: 190 } }, branchMap: { '0': { loc: { start: { line: 9, column: 62 }, end: { line: 9, column: 135 } }, type: 'binary-expr', locations: [{ start: { line: 9, column: 62 }, end: { line: 9, column: 90 } }, { start: { line: 9, column: 94 }, end: { line: 9, column: 135 } }], line: 9 }, '1': { loc: { start: { line: 18, column: 23 }, end: { line: 18, column: 116 } }, type: 'binary-expr', locations: [{ start: { line: 18, column: 23 }, end: { line: 18, column: 61 } }, { start: { line: 18, column: 65 }, end: { line: 18, column: 116 } }], line: 18 }, '2': { loc: { start: { line: 20, column: 28 }, end: { line: 20, column: 49 } }, type: 'binary-expr', locations: [{ start: { line: 20, column: 28 }, end: { line: 20, column: 44 } }, { start: { line: 20, column: 48 }, end: { line: 20, column: 49 } }], line: 20 }, '3': { loc: { start: { line: 20, column: 54 }, end: { line: 20, column: 96 } }, type: 'cond-expr', locations: [{ start: { line: 20, column: 86 }, end: { line: 20, column: 87 } }, { start: { line: 20, column: 90 }, end: { line: 20, column: 96 } }], line: 20 }, '4': { loc: { start: { line: 59, column: 6 }, end: { line: 62, column: 7 } }, type: 'if', locations: [{ start: { line: 59, column: 6 }, end: { line: 62, column: 7 } }, { start: { line: 59, column: 6 }, end: { line: 62, column: 7 } }], line: 59 }, '5': { loc: { start: { line: 63, column: 6 }, end: { line: 65, column: 7 } }, type: 'if', locations: [{ start: { line: 63, column: 6 }, end: { line: 65, column: 7 } }, { start: { line: 63, column: 6 }, end: { line: 65, column: 7 } }], line: 63 }, '6': { loc: { start: { line: 70, column: 6 }, end: { line: 73, column: 7 } }, type: 'if', locations: [{ start: { line: 70, column: 6 }, end: { line: 73, column: 7 } }, { start: { line: 70, column: 6 }, end: { line: 73, column: 7 } }], line: 70 }, '7': { loc: { start: { line: 80, column: 6 }, end: { line: 82, column: 7 } }, type: 'if', locations: [{ start: { line: 80, column: 6 }, end: { line: 82, column: 7 } }, { start: { line: 80, column: 6 }, end: { line: 82, column: 7 } }], line: 80 }, '8': { loc: { start: { line: 83, column: 6 }, end: { line: 85, column: 7 } }, type: 'if', locations: [{ start: { line: 83, column: 6 }, end: { line: 85, column: 7 } }, { start: { line: 83, column: 6 }, end: { line: 85, column: 7 } }], line: 83 }, '9': { loc: { start: { line: 90, column: 6 }, end: { line: 92, column: 7 } }, type: 'if', locations: [{ start: { line: 90, column: 6 }, end: { line: 92, column: 7 } }, { start: { line: 90, column: 6 }, end: { line: 92, column: 7 } }], line: 90 }, '10': { loc: { start: { line: 93, column: 25 }, end: { line: 93, column: 42 } }, type: 'cond-expr', locations: [{ start: { line: 93, column: 34 }, end: { line: 93, column: 36 } }, { start: { line: 93, column: 39 }, end: { line: 93, column: 42 } }], line: 93 }, '11': { loc: { start: { line: 125, column: 4 }, end: { line: 127, column: 5 } }, type: 'if', locations: [{ start: { line: 125, column: 4 }, end: { line: 127, column: 5 } }, { start: { line: 125, column: 4 }, end: { line: 127, column: 5 } }], line: 125 }, '12': { loc: { start: { line: 128, column: 4 }, end: { line: 130, column: 5 } }, type: 'if', locations: [{ start: { line: 128, column: 4 }, end: { line: 130, column: 5 } }, { start: { line: 128, column: 4 }, end: { line: 130, column: 5 } }], line: 128 }, '13': { loc: { start: { line: 135, column: 4 }, end: { line: 137, column: 5 } }, type: 'if', locations: [{ start: { line: 135, column: 4 }, end: { line: 137, column: 5 } }, { start: { line: 135, column: 4 }, end: { line: 137, column: 5 } }], line: 135 }, '14': { loc: { start: { line: 138, column: 4 }, end: { line: 140, column: 5 } }, type: 'if', locations: [{ start: { line: 138, column: 4 }, end: { line: 140, column: 5 } }, { start: { line: 138, column: 4 }, end: { line: 140, column: 5 } }], line: 138 }, '15': { loc: { start: { line: 145, column: 4 }, end: { line: 147, column: 5 } }, type: 'if', locations: [{ start: { line: 145, column: 4 }, end: { line: 147, column: 5 } }, { start: { line: 145, column: 4 }, end: { line: 147, column: 5 } }], line: 145 }, '16': { loc: { start: { line: 148, column: 4 }, end: { line: 150, column: 5 } }, type: 'if', locations: [{ start: { line: 148, column: 4 }, end: { line: 150, column: 5 } }, { start: { line: 148, column: 4 }, end: { line: 150, column: 5 } }], line: 148 }, '17': { loc: { start: { line: 157, column: 19 }, end: { line: 157, column: 155 } }, type: 'cond-expr', locations: [{ start: { line: 157, column: 52 }, end: { line: 157, column: 54 } }, { start: { line: 157, column: 57 }, end: { line: 157, column: 155 } }], line: 157 }, '18': { loc: { start: { line: 157, column: 57 }, end: { line: 157, column: 155 } }, type: 'cond-expr', locations: [{ start: { line: 157, column: 87 }, end: { line: 157, column: 109 } }, { start: { line: 157, column: 112 }, end: { line: 157, column: 155 } }], line: 157 }, '19': { loc: { start: { line: 165, column: 17 }, end: { line: 165, column: 98 } }, type: 'binary-expr', locations: [{ start: { line: 165, column: 17 }, end: { line: 165, column: 26 } }, { start: { line: 165, column: 30 }, end: { line: 165, column: 98 } }], line: 165 }, '20': { loc: { start: { line: 167, column: 2 }, end: { line: 170, column: 3 } }, type: 'if', locations: [{ start: { line: 167, column: 2 }, end: { line: 170, column: 3 } }, { start: { line: 167, column: 2 }, end: { line: 170, column: 3 } }], line: 167 }, '21': { loc: { start: { line: 191, column: 2 }, end: { line: 193, column: 3 } }, type: 'if', locations: [{ start: { line: 191, column: 2 }, end: { line: 193, column: 3 } }, { start: { line: 191, column: 2 }, end: { line: 193, column: 3 } }], line: 191 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0, '92': 0, '93': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3704 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3705 | return coverage[path];
|
3706 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3707 | }();var AnnotatedFormatter = (cov_23zb36bnir.s[0]++, function (_BaseFormatter) {
|
3708 | cov_23zb36bnir.f[0]++;cov_23zb36bnir.s[1]++;inherits$1(AnnotatedFormatter, _BaseFormatter);function AnnotatedFormatter() {
|
3709 | cov_23zb36bnir.f[1]++;cov_23zb36bnir.s[2]++;classCallCheck$1(this, AnnotatedFormatter);var _this = (cov_23zb36bnir.s[3]++, possibleConstructorReturn$1(this, ((cov_23zb36bnir.b[0][0]++, AnnotatedFormatter.__proto__) || (cov_23zb36bnir.b[0][1]++, Object.getPrototypeOf(AnnotatedFormatter))).call(this)));cov_23zb36bnir.s[4]++;_this.includeMoveDestinations = false;cov_23zb36bnir.s[5]++;return _this;
|
3710 | }cov_23zb36bnir.s[6]++;createClass$1(AnnotatedFormatter, [{ key: 'prepareContext', value: function prepareContext(context) {
|
3711 | cov_23zb36bnir.f[2]++;cov_23zb36bnir.s[7]++;get$1((cov_23zb36bnir.b[1][0]++, AnnotatedFormatter.prototype.__proto__) || (cov_23zb36bnir.b[1][1]++, Object.getPrototypeOf(AnnotatedFormatter.prototype)), 'prepareContext', this).call(this, context);cov_23zb36bnir.s[8]++;context.indent = function (levels) {
|
3712 | cov_23zb36bnir.f[3]++;cov_23zb36bnir.s[9]++;this.indentLevel = ((cov_23zb36bnir.b[2][0]++, this.indentLevel) || (cov_23zb36bnir.b[2][1]++, 0)) + (typeof levels === 'undefined' ? (cov_23zb36bnir.b[3][0]++, 1) : (cov_23zb36bnir.b[3][1]++, levels));cov_23zb36bnir.s[10]++;this.indentPad = new Array(this.indentLevel + 1).join(' ');
|
3713 | };cov_23zb36bnir.s[11]++;context.row = function (json, htmlNote) {
|
3714 | cov_23zb36bnir.f[4]++;cov_23zb36bnir.s[12]++;context.out('<tr><td style="white-space: nowrap;">' + '<pre class="jsondiffpatch-annotated-indent"' + ' style="display: inline-block">');cov_23zb36bnir.s[13]++;context.out(context.indentPad);cov_23zb36bnir.s[14]++;context.out('</pre><pre style="display: inline-block">');cov_23zb36bnir.s[15]++;context.out(json);cov_23zb36bnir.s[16]++;context.out('</pre></td><td class="jsondiffpatch-delta-note"><div>');cov_23zb36bnir.s[17]++;context.out(htmlNote);cov_23zb36bnir.s[18]++;context.out('</div></td></tr>');
|
3715 | };
|
3716 | } }, { key: 'typeFormattterErrorFormatter', value: function typeFormattterErrorFormatter(context, err) {
|
3717 | cov_23zb36bnir.f[5]++;cov_23zb36bnir.s[19]++;context.row('', '<pre class="jsondiffpatch-error">' + err + '</pre>');
|
3718 | } }, { key: 'formatTextDiffString', value: function formatTextDiffString(context, value) {
|
3719 | cov_23zb36bnir.f[6]++;var lines = (cov_23zb36bnir.s[20]++, this.parseTextDiff(value));cov_23zb36bnir.s[21]++;context.out('<ul class="jsondiffpatch-textdiff">');cov_23zb36bnir.s[22]++;for (var i = 0, l = lines.length; i < l; i++) {
|
3720 | var line = (cov_23zb36bnir.s[23]++, lines[i]);cov_23zb36bnir.s[24]++;context.out('<li><div class="jsondiffpatch-textdiff-location">' + ('<span class="jsondiffpatch-textdiff-line-number">' + line.location.line + '</span><span class="jsondiffpatch-textdiff-char">' + line.location.chr + '</span></div><div class="jsondiffpatch-textdiff-line">'));var pieces = (cov_23zb36bnir.s[25]++, line.pieces);cov_23zb36bnir.s[26]++;for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
|
3721 | var piece = (cov_23zb36bnir.s[27]++, pieces[pieceIndex]);cov_23zb36bnir.s[28]++;context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' + piece.text + '</span>');
|
3722 | }cov_23zb36bnir.s[29]++;context.out('</div></li>');
|
3723 | }cov_23zb36bnir.s[30]++;context.out('</ul>');
|
3724 | } }, { key: 'rootBegin', value: function rootBegin(context, type, nodeType) {
|
3725 | cov_23zb36bnir.f[7]++;cov_23zb36bnir.s[31]++;context.out('<table class="jsondiffpatch-annotated-delta">');cov_23zb36bnir.s[32]++;if (type === 'node') {
|
3726 | cov_23zb36bnir.b[4][0]++;cov_23zb36bnir.s[33]++;context.row('{');cov_23zb36bnir.s[34]++;context.indent();
|
3727 | } else {
|
3728 | cov_23zb36bnir.b[4][1]++;
|
3729 | }cov_23zb36bnir.s[35]++;if (nodeType === 'array') {
|
3730 | cov_23zb36bnir.b[5][0]++;cov_23zb36bnir.s[36]++;context.row('"_t": "a",', 'Array delta (member names indicate array indices)');
|
3731 | } else {
|
3732 | cov_23zb36bnir.b[5][1]++;
|
3733 | }
|
3734 | } }, { key: 'rootEnd', value: function rootEnd(context, type) {
|
3735 | cov_23zb36bnir.f[8]++;cov_23zb36bnir.s[37]++;if (type === 'node') {
|
3736 | cov_23zb36bnir.b[6][0]++;cov_23zb36bnir.s[38]++;context.indent(-1);cov_23zb36bnir.s[39]++;context.row('}');
|
3737 | } else {
|
3738 | cov_23zb36bnir.b[6][1]++;
|
3739 | }cov_23zb36bnir.s[40]++;context.out('</table>');
|
3740 | } }, { key: 'nodeBegin', value: function nodeBegin(context, key, leftKey, type, nodeType) {
|
3741 | cov_23zb36bnir.f[9]++;cov_23zb36bnir.s[41]++;context.row('"' + key + '": {');cov_23zb36bnir.s[42]++;if (type === 'node') {
|
3742 | cov_23zb36bnir.b[7][0]++;cov_23zb36bnir.s[43]++;context.indent();
|
3743 | } else {
|
3744 | cov_23zb36bnir.b[7][1]++;
|
3745 | }cov_23zb36bnir.s[44]++;if (nodeType === 'array') {
|
3746 | cov_23zb36bnir.b[8][0]++;cov_23zb36bnir.s[45]++;context.row('"_t": "a",', 'Array delta (member names indicate array indices)');
|
3747 | } else {
|
3748 | cov_23zb36bnir.b[8][1]++;
|
3749 | }
|
3750 | } }, { key: 'nodeEnd', value: function nodeEnd(context, key, leftKey, type, nodeType, isLast) {
|
3751 | cov_23zb36bnir.f[10]++;cov_23zb36bnir.s[46]++;if (type === 'node') {
|
3752 | cov_23zb36bnir.b[9][0]++;cov_23zb36bnir.s[47]++;context.indent(-1);
|
3753 | } else {
|
3754 | cov_23zb36bnir.b[9][1]++;
|
3755 | }cov_23zb36bnir.s[48]++;context.row('}' + (isLast ? (cov_23zb36bnir.b[10][0]++, '') : (cov_23zb36bnir.b[10][1]++, ',')));
|
3756 | } }, { key: 'format_unchanged', value: function format_unchanged() {
|
3757 | cov_23zb36bnir.f[11]++;
|
3758 | } }, { key: 'format_movedestination', value: function format_movedestination() {
|
3759 | cov_23zb36bnir.f[12]++;
|
3760 | } }, { key: 'format_node', value: function format_node(context, delta, left) {
|
3761 | cov_23zb36bnir.f[13]++;cov_23zb36bnir.s[49]++;
|
3762 | this.formatDeltaChildren(context, delta, left);
|
3763 | } }]);cov_23zb36bnir.s[50]++;return AnnotatedFormatter;
|
3764 | }(BaseFormatter)); cov_23zb36bnir.s[51]++;var wrapPropertyName = function wrapPropertyName(name) {
|
3765 | cov_23zb36bnir.f[14]++;cov_23zb36bnir.s[52]++;return '<pre style="display:inline-block">"' + name + '"</pre>';
|
3766 | };var deltaAnnotations = (cov_23zb36bnir.s[53]++, { added: function added(delta, left, key, leftKey) {
|
3767 | cov_23zb36bnir.f[15]++;var formatLegend = (cov_23zb36bnir.s[54]++, ' <pre>([newValue])</pre>');cov_23zb36bnir.s[55]++;if (typeof leftKey === 'undefined') {
|
3768 | cov_23zb36bnir.b[11][0]++;cov_23zb36bnir.s[56]++;return 'new value' + formatLegend;
|
3769 | } else {
|
3770 | cov_23zb36bnir.b[11][1]++;
|
3771 | }cov_23zb36bnir.s[57]++;if (typeof leftKey === 'number') {
|
3772 | cov_23zb36bnir.b[12][0]++;cov_23zb36bnir.s[58]++;return 'insert at index ' + leftKey + formatLegend;
|
3773 | } else {
|
3774 | cov_23zb36bnir.b[12][1]++;
|
3775 | }cov_23zb36bnir.s[59]++;return 'add property ' + wrapPropertyName(leftKey) + formatLegend;
|
3776 | }, modified: function modified(delta, left, key, leftKey) {
|
3777 | cov_23zb36bnir.f[16]++;var formatLegend = (cov_23zb36bnir.s[60]++, ' <pre>([previousValue, newValue])</pre>');cov_23zb36bnir.s[61]++;if (typeof leftKey === 'undefined') {
|
3778 | cov_23zb36bnir.b[13][0]++;cov_23zb36bnir.s[62]++;return 'modify value' + formatLegend;
|
3779 | } else {
|
3780 | cov_23zb36bnir.b[13][1]++;
|
3781 | }cov_23zb36bnir.s[63]++;if (typeof leftKey === 'number') {
|
3782 | cov_23zb36bnir.b[14][0]++;cov_23zb36bnir.s[64]++;return 'modify at index ' + leftKey + formatLegend;
|
3783 | } else {
|
3784 | cov_23zb36bnir.b[14][1]++;
|
3785 | }cov_23zb36bnir.s[65]++;return 'modify property ' + wrapPropertyName(leftKey) + formatLegend;
|
3786 | }, deleted: function deleted(delta, left, key, leftKey) {
|
3787 | cov_23zb36bnir.f[17]++;var formatLegend = (cov_23zb36bnir.s[66]++, ' <pre>([previousValue, 0, 0])</pre>');cov_23zb36bnir.s[67]++;if (typeof leftKey === 'undefined') {
|
3788 | cov_23zb36bnir.b[15][0]++;cov_23zb36bnir.s[68]++;return 'delete value' + formatLegend;
|
3789 | } else {
|
3790 | cov_23zb36bnir.b[15][1]++;
|
3791 | }cov_23zb36bnir.s[69]++;if (typeof leftKey === 'number') {
|
3792 | cov_23zb36bnir.b[16][0]++;cov_23zb36bnir.s[70]++;return 'remove index ' + leftKey + formatLegend;
|
3793 | } else {
|
3794 | cov_23zb36bnir.b[16][1]++;
|
3795 | }cov_23zb36bnir.s[71]++;return 'delete property ' + wrapPropertyName(leftKey) + formatLegend;
|
3796 | }, moved: function moved(delta, left, key, leftKey) {
|
3797 | cov_23zb36bnir.f[18]++;cov_23zb36bnir.s[72]++;return 'move from <span title="(position to remove at original state)">' + ('index ' + leftKey + '</span> to <span title="(position to insert at final') + (' state)">index ' + delta[1] + '</span>');
|
3798 | }, textdiff: function textdiff(delta, left, key, leftKey) {
|
3799 | cov_23zb36bnir.f[19]++;var location = (cov_23zb36bnir.s[73]++, typeof leftKey === 'undefined' ? (cov_23zb36bnir.b[17][0]++, '') : (cov_23zb36bnir.b[17][1]++, typeof leftKey === 'number' ? (cov_23zb36bnir.b[18][0]++, ' at index ' + leftKey) : (cov_23zb36bnir.b[18][1]++, ' at property ' + wrapPropertyName(leftKey))));cov_23zb36bnir.s[74]++;return 'text diff' + location + ', format is <a href="https://code.google.com/' + 'p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>';
|
3800 | } });cov_23zb36bnir.s[75]++;var formatAnyChange = function formatAnyChange(context, delta) {
|
3801 | cov_23zb36bnir.f[20]++;var deltaType = (cov_23zb36bnir.s[76]++, this.getDeltaType(delta));var annotator = (cov_23zb36bnir.s[77]++, deltaAnnotations[deltaType]);var htmlNote = (cov_23zb36bnir.s[78]++, (cov_23zb36bnir.b[19][0]++, annotator) && (cov_23zb36bnir.b[19][1]++, annotator.apply(annotator, Array.prototype.slice.call(arguments, 1))));var json = (cov_23zb36bnir.s[79]++, JSON.stringify(delta, null, 2));cov_23zb36bnir.s[80]++;if (deltaType === 'textdiff') {
|
3802 | cov_23zb36bnir.b[20][0]++;cov_23zb36bnir.s[81]++;
|
3803 | json = json.split('\\n').join('\\n"+\n "');
|
3804 | } else {
|
3805 | cov_23zb36bnir.b[20][1]++;
|
3806 | }cov_23zb36bnir.s[82]++;context.indent();cov_23zb36bnir.s[83]++;context.row(json, htmlNote);cov_23zb36bnir.s[84]++;context.indent(-1);
|
3807 | }; cov_23zb36bnir.s[85]++;AnnotatedFormatter.prototype.format_added = formatAnyChange;cov_23zb36bnir.s[86]++;AnnotatedFormatter.prototype.format_modified = formatAnyChange;cov_23zb36bnir.s[87]++;AnnotatedFormatter.prototype.format_deleted = formatAnyChange;cov_23zb36bnir.s[88]++;AnnotatedFormatter.prototype.format_moved = formatAnyChange;cov_23zb36bnir.s[89]++;AnnotatedFormatter.prototype.format_textdiff = formatAnyChange; var defaultInstance$1 = (cov_23zb36bnir.s[90]++, void 0);function format$1(delta, left) {
|
3808 | cov_23zb36bnir.f[21]++;cov_23zb36bnir.s[91]++;if (!defaultInstance$1) {
|
3809 | cov_23zb36bnir.b[21][0]++;cov_23zb36bnir.s[92]++;defaultInstance$1 = new AnnotatedFormatter();
|
3810 | } else {
|
3811 | cov_23zb36bnir.b[21][1]++;
|
3812 | }cov_23zb36bnir.s[93]++;return defaultInstance$1.format(delta, left);
|
3813 | }
|
3814 |
|
3815 | var annotated = Object.freeze({
|
3816 | default: AnnotatedFormatter,
|
3817 | format: format$1
|
3818 | });
|
3819 |
|
3820 | var cov_jjhm4s856 = function () {
|
3821 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/jsonpatch.js',
|
3822 | hash = '9b5b78803240797e2db3754793b03ea9de3badde',
|
3823 | global = new Function('return this')(),
|
3824 | gcv = '__coverage__',
|
3825 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/jsonpatch.js', statementMap: { '0': { start: { line: 3, column: 17 }, end: { line: 8, column: 1 } }, '1': { start: { line: 10, column: 20 }, end: { line: 128, column: 16 } }, '2': { start: { line: 11, column: 2 }, end: { line: 11, column: 55 } }, '3': { start: { line: 14, column: 4 }, end: { line: 14, column: 53 } }, '4': { start: { line: 16, column: 16 }, end: { line: 16, column: 138 } }, '5': { start: { line: 18, column: 4 }, end: { line: 18, column: 41 } }, '6': { start: { line: 19, column: 4 }, end: { line: 19, column: 17 } }, '7': { start: { line: 22, column: 2 }, end: { line: 126, column: 6 } }, '8': { start: { line: 25, column: 6 }, end: { line: 25, column: 152 } }, '9': { start: { line: 26, column: 6 }, end: { line: 26, column: 26 } }, '10': { start: { line: 27, column: 6 }, end: { line: 27, column: 24 } }, '11': { start: { line: 28, column: 6 }, end: { line: 40, column: 8 } }, '12': { start: { line: 29, column: 17 }, end: { line: 29, column: 23 } }, '13': { start: { line: 30, column: 20 }, end: { line: 30, column: 29 } }, '14': { start: { line: 32, column: 18 }, end: { line: 35, column: 9 } }, '15': { start: { line: 36, column: 8 }, end: { line: 38, column: 9 } }, '16': { start: { line: 37, column: 10 }, end: { line: 37, column: 28 } }, '17': { start: { line: 39, column: 8 }, end: { line: 39, column: 30 } }, '18': { start: { line: 42, column: 6 }, end: { line: 46, column: 8 } }, '19': { start: { line: 43, column: 22 }, end: { line: 43, column: 30 } }, '20': { start: { line: 44, column: 19 }, end: { line: 44, column: 37 } }, '21': { start: { line: 45, column: 8 }, end: { line: 45, column: 77 } }, '22': { start: { line: 48, column: 6 }, end: { line: 50, column: 8 } }, '23': { start: { line: 49, column: 8 }, end: { line: 49, column: 41 } }, '24': { start: { line: 55, column: 6 }, end: { line: 55, column: 36 } }, '25': { start: { line: 66, column: 17 }, end: { line: 66, column: 26 } }, '26': { start: { line: 68, column: 6 }, end: { line: 68, column: 25 } }, '27': { start: { line: 73, column: 17 }, end: { line: 73, column: 27 } }, '28': { start: { line: 75, column: 6 }, end: { line: 75, column: 17 } }, '29': { start: { line: 90, column: 6 }, end: { line: 90, column: 53 } }, '30': { start: { line: 95, column: 6 }, end: { line: 95, column: 69 } }, '31': { start: { line: 100, column: 6 }, end: { line: 100, column: 73 } }, '32': { start: { line: 105, column: 6 }, end: { line: 105, column: 55 } }, '33': { start: { line: 110, column: 15 }, end: { line: 110, column: 23 } }, '34': { start: { line: 111, column: 6 }, end: { line: 111, column: 29 } }, '35': { start: { line: 116, column: 6 }, end: { line: 116, column: 41 } }, '36': { start: { line: 121, column: 20 }, end: { line: 121, column: 22 } }, '37': { start: { line: 122, column: 6 }, end: { line: 122, column: 35 } }, '38': { start: { line: 123, column: 6 }, end: { line: 123, column: 41 } }, '39': { start: { line: 124, column: 6 }, end: { line: 124, column: 28 } }, '40': { start: { line: 127, column: 2 }, end: { line: 127, column: 23 } }, '41': { start: { line: 135, column: 11 }, end: { line: 137, column: 1 } }, '42': { start: { line: 136, column: 2 }, end: { line: 136, column: 29 } }, '43': { start: { line: 139, column: 13 }, end: { line: 142, column: 1 } }, '44': { start: { line: 140, column: 2 }, end: { line: 140, column: 17 } }, '45': { start: { line: 141, column: 2 }, end: { line: 141, column: 13 } }, '46': { start: { line: 144, column: 25 }, end: { line: 152, column: 1 } }, '47': { start: { line: 145, column: 14 }, end: { line: 145, column: 34 } }, '48': { start: { line: 146, column: 14 }, end: { line: 146, column: 34 } }, '49': { start: { line: 147, column: 2 }, end: { line: 151, column: 3 } }, '50': { start: { line: 148, column: 4 }, end: { line: 148, column: 25 } }, '51': { start: { line: 150, column: 4 }, end: { line: 150, column: 13 } }, '52': { start: { line: 154, column: 27 }, end: { line: 164, column: 1 } }, '53': { start: { line: 155, column: 2 }, end: { line: 163, column: 5 } }, '54': { start: { line: 156, column: 17 }, end: { line: 156, column: 34 } }, '55': { start: { line: 157, column: 17 }, end: { line: 157, column: 34 } }, '56': { start: { line: 158, column: 4 }, end: { line: 162, column: 5 } }, '57': { start: { line: 159, column: 6 }, end: { line: 159, column: 43 } }, '58': { start: { line: 161, column: 6 }, end: { line: 161, column: 60 } }, '59': { start: { line: 166, column: 16 }, end: { line: 175, column: 1 } }, '60': { start: { line: 167, column: 13 }, end: { line: 167, column: 15 } }, '61': { start: { line: 168, column: 14 }, end: { line: 168, column: 16 } }, '62': { start: { line: 170, column: 2 }, end: { line: 173, column: 5 } }, '63': { start: { line: 171, column: 15 }, end: { line: 171, column: 38 } }, '64': { start: { line: 172, column: 4 }, end: { line: 172, column: 18 } }, '65': { start: { line: 174, column: 2 }, end: { line: 174, column: 23 } }, '66': { start: { line: 177, column: 26 }, end: { line: 184, column: 1 } }, '67': { start: { line: 178, column: 19 }, end: { line: 181, column: 3 } }, '68': { start: { line: 179, column: 13 }, end: { line: 179, column: 21 } }, '69': { start: { line: 180, column: 4 }, end: { line: 180, column: 27 } }, '70': { start: { line: 182, column: 26 }, end: { line: 182, column: 66 } }, '71': { start: { line: 183, column: 2 }, end: { line: 183, column: 27 } }, '72': { start: { line: 186, column: 17 }, end: { line: 194, column: 1 } }, '73': { start: { line: 187, column: 29 }, end: { line: 187, column: 67 } }, '74': { start: { line: 188, column: 30 }, end: { line: 188, column: 81 } }, '75': { start: { line: 189, column: 18 }, end: { line: 189, column: 42 } }, '76': { start: { line: 190, column: 17 }, end: { line: 190, column: 41 } }, '77': { start: { line: 192, column: 25 }, end: { line: 192, column: 56 } }, '78': { start: { line: 193, column: 2 }, end: { line: 193, column: 43 } }, '79': { start: { line: 196, column: 22 }, end: { line: 196, column: 28 } }, '80': { start: { line: 198, column: 20 }, end: { line: 203, column: 1 } }, '81': { start: { line: 199, column: 2 }, end: { line: 201, column: 3 } }, '82': { start: { line: 200, column: 4 }, end: { line: 200, column: 42 } }, '83': { start: { line: 202, column: 2 }, end: { line: 202, column: 57 } }, '84': { start: { line: 205, column: 17 }, end: { line: 207, column: 1 } }, '85': { start: { line: 206, column: 2 }, end: { line: 206, column: 35 } } }, fnMap: { '0': { name: '(anonymous_0)', decl: { start: { line: 10, column: 20 }, end: { line: 10, column: 21 } }, loc: { start: { line: 10, column: 46 }, end: { line: 128, column: 1 } }, line: 10 }, '1': { name: 'JSONFormatter', decl: { start: { line: 13, column: 11 }, end: { line: 13, column: 24 } }, loc: { start: { line: 13, column: 27 }, end: { line: 20, column: 3 } }, line: 13 }, '2': { name: 'prepareContext', decl: { start: { line: 24, column: 20 }, end: { line: 24, column: 34 } }, loc: { start: { line: 24, column: 44 }, end: { line: 51, column: 5 } }, line: 24 }, '3': { name: '(anonymous_3)', decl: { start: { line: 28, column: 30 }, end: { line: 28, column: 31 } }, loc: { start: { line: 28, column: 45 }, end: { line: 40, column: 7 } }, line: 28 }, '4': { name: '(anonymous_4)', decl: { start: { line: 42, column: 27 }, end: { line: 42, column: 28 } }, loc: { start: { line: 42, column: 41 }, end: { line: 46, column: 7 } }, line: 42 }, '5': { name: '(anonymous_5)', decl: { start: { line: 48, column: 28 }, end: { line: 48, column: 29 } }, loc: { start: { line: 48, column: 40 }, end: { line: 50, column: 7 } }, line: 48 }, '6': { name: 'typeFormattterErrorFormatter', decl: { start: { line: 54, column: 20 }, end: { line: 54, column: 48 } }, loc: { start: { line: 54, column: 63 }, end: { line: 56, column: 5 } }, line: 54 }, '7': { name: 'rootBegin', decl: { start: { line: 59, column: 20 }, end: { line: 59, column: 29 } }, loc: { start: { line: 59, column: 32 }, end: { line: 59, column: 34 } }, line: 59 }, '8': { name: 'rootEnd', decl: { start: { line: 62, column: 20 }, end: { line: 62, column: 27 } }, loc: { start: { line: 62, column: 30 }, end: { line: 62, column: 32 } }, line: 62 }, '9': { name: 'nodeBegin', decl: { start: { line: 65, column: 20 }, end: { line: 65, column: 29 } }, loc: { start: { line: 65, column: 50 }, end: { line: 69, column: 5 } }, line: 65 }, '10': { name: 'nodeEnd', decl: { start: { line: 72, column: 20 }, end: { line: 72, column: 27 } }, loc: { start: { line: 72, column: 35 }, end: { line: 76, column: 5 } }, line: 72 }, '11': { name: 'format_unchanged', decl: { start: { line: 83, column: 20 }, end: { line: 83, column: 36 } }, loc: { start: { line: 83, column: 39 }, end: { line: 83, column: 41 } }, line: 83 }, '12': { name: 'format_movedestination', decl: { start: { line: 86, column: 20 }, end: { line: 86, column: 42 } }, loc: { start: { line: 86, column: 45 }, end: { line: 86, column: 47 } }, line: 86 }, '13': { name: 'format_node', decl: { start: { line: 89, column: 20 }, end: { line: 89, column: 31 } }, loc: { start: { line: 89, column: 54 }, end: { line: 91, column: 5 } }, line: 89 }, '14': { name: 'format_added', decl: { start: { line: 94, column: 20 }, end: { line: 94, column: 32 } }, loc: { start: { line: 94, column: 49 }, end: { line: 96, column: 5 } }, line: 94 }, '15': { name: 'format_modified', decl: { start: { line: 99, column: 20 }, end: { line: 99, column: 35 } }, loc: { start: { line: 99, column: 52 }, end: { line: 101, column: 5 } }, line: 99 }, '16': { name: 'format_deleted', decl: { start: { line: 104, column: 20 }, end: { line: 104, column: 34 } }, loc: { start: { line: 104, column: 44 }, end: { line: 106, column: 5 } }, line: 104 }, '17': { name: 'format_moved', decl: { start: { line: 109, column: 20 }, end: { line: 109, column: 32 } }, loc: { start: { line: 109, column: 49 }, end: { line: 112, column: 5 } }, line: 109 }, '18': { name: 'format_textdiff', decl: { start: { line: 115, column: 20 }, end: { line: 115, column: 35 } }, loc: { start: { line: 115, column: 38 }, end: { line: 117, column: 5 } }, line: 115 }, '19': { name: 'format', decl: { start: { line: 120, column: 20 }, end: { line: 120, column: 26 } }, loc: { start: { line: 120, column: 40 }, end: { line: 125, column: 5 } }, line: 120 }, '20': { name: 'last', decl: { start: { line: 135, column: 20 }, end: { line: 135, column: 24 } }, loc: { start: { line: 135, column: 30 }, end: { line: 137, column: 1 } }, line: 135 }, '21': { name: 'sortBy', decl: { start: { line: 139, column: 22 }, end: { line: 139, column: 28 } }, loc: { start: { line: 139, column: 40 }, end: { line: 142, column: 1 } }, line: 139 }, '22': { name: 'compareByIndexDesc', decl: { start: { line: 144, column: 34 }, end: { line: 144, column: 52 } }, loc: { start: { line: 144, column: 69 }, end: { line: 152, column: 1 } }, line: 144 }, '23': { name: 'opsByDescendingOrder', decl: { start: { line: 154, column: 36 }, end: { line: 154, column: 56 } }, loc: { start: { line: 154, column: 68 }, end: { line: 164, column: 1 } }, line: 154 }, '24': { name: '(anonymous_24)', decl: { start: { line: 155, column: 27 }, end: { line: 155, column: 28 } }, loc: { start: { line: 155, column: 43 }, end: { line: 163, column: 3 } }, line: 155 }, '25': { name: 'partition', decl: { start: { line: 166, column: 25 }, end: { line: 166, column: 34 } }, loc: { start: { line: 166, column: 46 }, end: { line: 175, column: 1 } }, line: 166 }, '26': { name: '(anonymous_26)', decl: { start: { line: 170, column: 14 }, end: { line: 170, column: 15 } }, loc: { start: { line: 170, column: 28 }, end: { line: 173, column: 3 } }, line: 170 }, '27': { name: 'partitionRemovedOps', decl: { start: { line: 177, column: 35 }, end: { line: 177, column: 54 } }, loc: { start: { line: 177, column: 74 }, end: { line: 184, column: 1 } }, line: 177 }, '28': { name: 'isRemoveOp', decl: { start: { line: 178, column: 28 }, end: { line: 178, column: 38 } }, loc: { start: { line: 178, column: 46 }, end: { line: 181, column: 3 } }, line: 178 }, '29': { name: 'reorderOps', decl: { start: { line: 186, column: 26 }, end: { line: 186, column: 36 } }, loc: { start: { line: 186, column: 56 }, end: { line: 194, column: 1 } }, line: 186 }, '30': { name: 'format', decl: { start: { line: 198, column: 29 }, end: { line: 198, column: 35 } }, loc: { start: { line: 198, column: 49 }, end: { line: 203, column: 1 } }, line: 198 }, '31': { name: 'log', decl: { start: { line: 205, column: 26 }, end: { line: 205, column: 29 } }, loc: { start: { line: 205, column: 43 }, end: { line: 207, column: 1 } }, line: 205 } }, branchMap: { '0': { loc: { start: { line: 16, column: 62 }, end: { line: 16, column: 125 } }, type: 'binary-expr', locations: [{ start: { line: 16, column: 62 }, end: { line: 16, column: 85 } }, { start: { line: 16, column: 89 }, end: { line: 16, column: 125 } }], line: 16 }, '1': { loc: { start: { line: 25, column: 23 }, end: { line: 25, column: 106 } }, type: 'binary-expr', locations: [{ start: { line: 25, column: 23 }, end: { line: 25, column: 56 } }, { start: { line: 25, column: 60 }, end: { line: 25, column: 106 } }], line: 25 }, '2': { loc: { start: { line: 36, column: 8 }, end: { line: 38, column: 9 } }, type: 'if', locations: [{ start: { line: 36, column: 8 }, end: { line: 38, column: 9 } }, { start: { line: 36, column: 8 }, end: { line: 38, column: 9 } }], line: 36 }, '3': { loc: { start: { line: 147, column: 2 }, end: { line: 151, column: 3 } }, type: 'if', locations: [{ start: { line: 147, column: 2 }, end: { line: 151, column: 3 } }, { start: { line: 147, column: 2 }, end: { line: 151, column: 3 } }], line: 147 }, '4': { loc: { start: { line: 147, column: 8 }, end: { line: 147, column: 36 } }, type: 'binary-expr', locations: [{ start: { line: 147, column: 8 }, end: { line: 147, column: 20 } }, { start: { line: 147, column: 24 }, end: { line: 147, column: 36 } }], line: 147 }, '5': { loc: { start: { line: 158, column: 4 }, end: { line: 162, column: 5 } }, type: 'if', locations: [{ start: { line: 158, column: 4 }, end: { line: 162, column: 5 } }, { start: { line: 158, column: 4 }, end: { line: 162, column: 5 } }], line: 158 }, '6': { loc: { start: { line: 171, column: 15 }, end: { line: 171, column: 38 } }, type: 'cond-expr', locations: [{ start: { line: 171, column: 26 }, end: { line: 171, column: 30 } }, { start: { line: 171, column: 33 }, end: { line: 171, column: 38 } }], line: 171 }, '7': { loc: { start: { line: 199, column: 2 }, end: { line: 201, column: 3 } }, type: 'if', locations: [{ start: { line: 199, column: 2 }, end: { line: 201, column: 3 } }, { start: { line: 199, column: 2 }, end: { line: 201, column: 3 } }], line: 199 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3826 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3827 | return coverage[path];
|
3828 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3829 | }();var OPERATIONS = (cov_jjhm4s856.s[0]++, { add: 'add', remove: 'remove', replace: 'replace', move: 'move' });var JSONFormatter = (cov_jjhm4s856.s[1]++, function (_BaseFormatter) {
|
3830 | cov_jjhm4s856.f[0]++;cov_jjhm4s856.s[2]++;inherits$1(JSONFormatter, _BaseFormatter);function JSONFormatter() {
|
3831 | cov_jjhm4s856.f[1]++;cov_jjhm4s856.s[3]++;classCallCheck$1(this, JSONFormatter);var _this = (cov_jjhm4s856.s[4]++, possibleConstructorReturn$1(this, ((cov_jjhm4s856.b[0][0]++, JSONFormatter.__proto__) || (cov_jjhm4s856.b[0][1]++, Object.getPrototypeOf(JSONFormatter))).call(this)));cov_jjhm4s856.s[5]++;_this.includeMoveDestinations = true;cov_jjhm4s856.s[6]++;return _this;
|
3832 | }cov_jjhm4s856.s[7]++;createClass$1(JSONFormatter, [{ key: 'prepareContext', value: function prepareContext(context) {
|
3833 | cov_jjhm4s856.f[2]++;cov_jjhm4s856.s[8]++;get$1((cov_jjhm4s856.b[1][0]++, JSONFormatter.prototype.__proto__) || (cov_jjhm4s856.b[1][1]++, Object.getPrototypeOf(JSONFormatter.prototype)), 'prepareContext', this).call(this, context);cov_jjhm4s856.s[9]++;context.result = [];cov_jjhm4s856.s[10]++;context.path = [];cov_jjhm4s856.s[11]++;context.pushCurrentOp = function (obj) {
|
3834 | cov_jjhm4s856.f[3]++;var op = (cov_jjhm4s856.s[12]++, obj.op),
|
3835 | value = (cov_jjhm4s856.s[13]++, obj.value);var val = (cov_jjhm4s856.s[14]++, { op: op, path: this.currentPath() });cov_jjhm4s856.s[15]++;if (typeof value !== 'undefined') {
|
3836 | cov_jjhm4s856.b[2][0]++;cov_jjhm4s856.s[16]++;val.value = value;
|
3837 | } else {
|
3838 | cov_jjhm4s856.b[2][1]++;
|
3839 | }cov_jjhm4s856.s[17]++;this.result.push(val);
|
3840 | };cov_jjhm4s856.s[18]++;context.pushMoveOp = function (to) {
|
3841 | cov_jjhm4s856.f[4]++;var finalTo = (cov_jjhm4s856.s[19]++, '/' + to);var from = (cov_jjhm4s856.s[20]++, this.currentPath());cov_jjhm4s856.s[21]++;this.result.push({ op: OPERATIONS.move, from: from, path: finalTo });
|
3842 | };cov_jjhm4s856.s[22]++;context.currentPath = function () {
|
3843 | cov_jjhm4s856.f[5]++;cov_jjhm4s856.s[23]++;return '/' + this.path.join('/');
|
3844 | };
|
3845 | } }, { key: 'typeFormattterErrorFormatter', value: function typeFormattterErrorFormatter(context, err) {
|
3846 | cov_jjhm4s856.f[6]++;cov_jjhm4s856.s[24]++;context.out('[ERROR] ' + err);
|
3847 | } }, { key: 'rootBegin', value: function rootBegin() {
|
3848 | cov_jjhm4s856.f[7]++;
|
3849 | } }, { key: 'rootEnd', value: function rootEnd() {
|
3850 | cov_jjhm4s856.f[8]++;
|
3851 | } }, { key: 'nodeBegin', value: function nodeBegin(_ref, key, leftKey) {
|
3852 | cov_jjhm4s856.f[9]++;var path = (cov_jjhm4s856.s[25]++, _ref.path);cov_jjhm4s856.s[26]++;path.push(leftKey);
|
3853 | } }, { key: 'nodeEnd', value: function nodeEnd(_ref2) {
|
3854 | cov_jjhm4s856.f[10]++;var path = (cov_jjhm4s856.s[27]++, _ref2.path);cov_jjhm4s856.s[28]++;path.pop();
|
3855 | } }, { key: 'format_unchanged', value: function format_unchanged() {
|
3856 | cov_jjhm4s856.f[11]++;
|
3857 | } }, { key: 'format_movedestination', value: function format_movedestination() {
|
3858 | cov_jjhm4s856.f[12]++;
|
3859 | } }, { key: 'format_node', value: function format_node(context, delta, left) {
|
3860 | cov_jjhm4s856.f[13]++;cov_jjhm4s856.s[29]++;this.formatDeltaChildren(context, delta, left);
|
3861 | } }, { key: 'format_added', value: function format_added(context, delta) {
|
3862 | cov_jjhm4s856.f[14]++;cov_jjhm4s856.s[30]++;context.pushCurrentOp({ op: OPERATIONS.add, value: delta[0] });
|
3863 | } }, { key: 'format_modified', value: function format_modified(context, delta) {
|
3864 | cov_jjhm4s856.f[15]++;cov_jjhm4s856.s[31]++;context.pushCurrentOp({ op: OPERATIONS.replace, value: delta[1] });
|
3865 | } }, { key: 'format_deleted', value: function format_deleted(context) {
|
3866 | cov_jjhm4s856.f[16]++;cov_jjhm4s856.s[32]++;context.pushCurrentOp({ op: OPERATIONS.remove });
|
3867 | } }, { key: 'format_moved', value: function format_moved(context, delta) {
|
3868 | cov_jjhm4s856.f[17]++;var to = (cov_jjhm4s856.s[33]++, delta[1]);cov_jjhm4s856.s[34]++;context.pushMoveOp(to);
|
3869 | } }, { key: 'format_textdiff', value: function format_textdiff() {
|
3870 | cov_jjhm4s856.f[18]++;cov_jjhm4s856.s[35]++;throw new Error('Not implemented');
|
3871 | } }, { key: 'format', value: function format(delta, left) {
|
3872 | cov_jjhm4s856.f[19]++;var context = (cov_jjhm4s856.s[36]++, {});cov_jjhm4s856.s[37]++;this.prepareContext(context);cov_jjhm4s856.s[38]++;this.recurse(context, delta, left);cov_jjhm4s856.s[39]++;return context.result;
|
3873 | } }]);cov_jjhm4s856.s[40]++;return JSONFormatter;
|
3874 | }(BaseFormatter)); cov_jjhm4s856.s[41]++;var last = function last(arr) {
|
3875 | cov_jjhm4s856.f[20]++;cov_jjhm4s856.s[42]++;return arr[arr.length - 1];
|
3876 | };cov_jjhm4s856.s[43]++;var sortBy = function sortBy(arr, pred) {
|
3877 | cov_jjhm4s856.f[21]++;cov_jjhm4s856.s[44]++;arr.sort(pred);cov_jjhm4s856.s[45]++;return arr;
|
3878 | };cov_jjhm4s856.s[46]++;var compareByIndexDesc = function compareByIndexDesc(indexA, indexB) {
|
3879 | cov_jjhm4s856.f[22]++;var lastA = (cov_jjhm4s856.s[47]++, parseInt(indexA, 10));var lastB = (cov_jjhm4s856.s[48]++, parseInt(indexB, 10));cov_jjhm4s856.s[49]++;if (!((cov_jjhm4s856.b[4][0]++, isNaN(lastA)) || (cov_jjhm4s856.b[4][1]++, isNaN(lastB)))) {
|
3880 | cov_jjhm4s856.b[3][0]++;cov_jjhm4s856.s[50]++;return lastB - lastA;
|
3881 | } else {
|
3882 | cov_jjhm4s856.b[3][1]++;cov_jjhm4s856.s[51]++;return 0;
|
3883 | }
|
3884 | };cov_jjhm4s856.s[52]++;var opsByDescendingOrder = function opsByDescendingOrder(removeOps) {
|
3885 | cov_jjhm4s856.f[23]++;cov_jjhm4s856.s[53]++;return sortBy(removeOps, function (a, b) {
|
3886 | cov_jjhm4s856.f[24]++;var splitA = (cov_jjhm4s856.s[54]++, a.path.split('/'));var splitB = (cov_jjhm4s856.s[55]++, b.path.split('/'));cov_jjhm4s856.s[56]++;if (splitA.length !== splitB.length) {
|
3887 | cov_jjhm4s856.b[5][0]++;cov_jjhm4s856.s[57]++;return splitA.length - splitB.length;
|
3888 | } else {
|
3889 | cov_jjhm4s856.b[5][1]++;cov_jjhm4s856.s[58]++;return compareByIndexDesc(last(splitA), last(splitB));
|
3890 | }
|
3891 | });
|
3892 | };cov_jjhm4s856.s[59]++;var partition = function partition(arr, pred) {
|
3893 | cov_jjhm4s856.f[25]++;var left = (cov_jjhm4s856.s[60]++, []);var right = (cov_jjhm4s856.s[61]++, []);cov_jjhm4s856.s[62]++;arr.forEach(function (el) {
|
3894 | cov_jjhm4s856.f[26]++;var coll = (cov_jjhm4s856.s[63]++, pred(el) ? (cov_jjhm4s856.b[6][0]++, left) : (cov_jjhm4s856.b[6][1]++, right));cov_jjhm4s856.s[64]++;coll.push(el);
|
3895 | });cov_jjhm4s856.s[65]++;return [left, right];
|
3896 | };cov_jjhm4s856.s[66]++;var partitionRemovedOps = function partitionRemovedOps(jsonFormattedDiff) {
|
3897 | cov_jjhm4s856.f[27]++;cov_jjhm4s856.s[67]++;var isRemoveOp = function isRemoveOp(_ref3) {
|
3898 | cov_jjhm4s856.f[28]++;var op = (cov_jjhm4s856.s[68]++, _ref3.op);cov_jjhm4s856.s[69]++;return op === 'remove';
|
3899 | };var removeOpsOtherOps = (cov_jjhm4s856.s[70]++, partition(jsonFormattedDiff, isRemoveOp));cov_jjhm4s856.s[71]++;return removeOpsOtherOps;
|
3900 | };cov_jjhm4s856.s[72]++;var reorderOps = function reorderOps(jsonFormattedDiff) {
|
3901 | cov_jjhm4s856.f[29]++;var _partitionRemovedOps = (cov_jjhm4s856.s[73]++, partitionRemovedOps(jsonFormattedDiff)),
|
3902 | _partitionRemovedOps2 = (cov_jjhm4s856.s[74]++, slicedToArray$1(_partitionRemovedOps, 2)),
|
3903 | removeOps = (cov_jjhm4s856.s[75]++, _partitionRemovedOps2[0]),
|
3904 | otherOps = (cov_jjhm4s856.s[76]++, _partitionRemovedOps2[1]);var removeOpsReverse = (cov_jjhm4s856.s[77]++, opsByDescendingOrder(removeOps));cov_jjhm4s856.s[78]++;return removeOpsReverse.concat(otherOps);
|
3905 | };var defaultInstance$2 = (cov_jjhm4s856.s[79]++, void 0);cov_jjhm4s856.s[80]++;var format$2 = function format(delta, left) {
|
3906 | cov_jjhm4s856.f[30]++;cov_jjhm4s856.s[81]++;if (!defaultInstance$2) {
|
3907 | cov_jjhm4s856.b[7][0]++;cov_jjhm4s856.s[82]++;defaultInstance$2 = new JSONFormatter();
|
3908 | } else {
|
3909 | cov_jjhm4s856.b[7][1]++;
|
3910 | }cov_jjhm4s856.s[83]++;return reorderOps(defaultInstance$2.format(delta, left));
|
3911 | };cov_jjhm4s856.s[84]++;var log = function log(delta, left) {
|
3912 | cov_jjhm4s856.f[31]++;cov_jjhm4s856.s[85]++;console.log(format$2(delta, left));
|
3913 | };
|
3914 |
|
3915 | var jsonpatch = Object.freeze({
|
3916 | default: JSONFormatter,
|
3917 | format: format$2,
|
3918 | log: log
|
3919 | });
|
3920 |
|
3921 | var cov_ye0cg04jg = function () {
|
3922 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/console.js',
|
3923 | hash = '5598765ad1d7bff6441347bf30803e4f0a7e9135',
|
3924 | global = new Function('return this')(),
|
3925 | gcv = '__coverage__',
|
3926 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/console.js', statementMap: { '0': { start: { line: 5, column: 2 }, end: { line: 11, column: 4 } }, '1': { start: { line: 6, column: 4 }, end: { line: 8, column: 5 } }, '2': { start: { line: 7, column: 6 }, end: { line: 7, column: 35 } }, '3': { start: { line: 10, column: 4 }, end: { line: 10, column: 16 } }, '4': { start: { line: 14, column: 13 }, end: { line: 22, column: 1 } }, '5': { start: { line: 24, column: 23 }, end: { line: 205, column: 16 } }, '6': { start: { line: 25, column: 2 }, end: { line: 25, column: 58 } }, '7': { start: { line: 28, column: 4 }, end: { line: 28, column: 56 } }, '8': { start: { line: 30, column: 16 }, end: { line: 30, column: 144 } }, '9': { start: { line: 32, column: 4 }, end: { line: 32, column: 42 } }, '10': { start: { line: 33, column: 4 }, end: { line: 33, column: 17 } }, '11': { start: { line: 36, column: 2 }, end: { line: 203, column: 6 } }, '12': { start: { line: 39, column: 6 }, end: { line: 39, column: 158 } }, '13': { start: { line: 40, column: 6 }, end: { line: 44, column: 8 } }, '14': { start: { line: 41, column: 8 }, end: { line: 41, column: 98 } }, '15': { start: { line: 42, column: 8 }, end: { line: 42, column: 68 } }, '16': { start: { line: 43, column: 8 }, end: { line: 43, column: 23 } }, '17': { start: { line: 45, column: 6 }, end: { line: 47, column: 8 } }, '18': { start: { line: 46, column: 8 }, end: { line: 46, column: 56 } }, '19': { start: { line: 48, column: 6 }, end: { line: 61, column: 8 } }, '20': { start: { line: 49, column: 8 }, end: { line: 51, column: 9 } }, '21': { start: { line: 50, column: 10 }, end: { line: 50, column: 41 } }, '22': { start: { line: 53, column: 8 }, end: { line: 60, column: 9 } }, '23': { start: { line: 54, column: 22 }, end: { line: 54, column: 41 } }, '24': { start: { line: 55, column: 21 }, end: { line: 55, column: 62 } }, '25': { start: { line: 56, column: 10 }, end: { line: 58, column: 11 } }, '26': { start: { line: 57, column: 12 }, end: { line: 57, column: 39 } }, '27': { start: { line: 59, column: 10 }, end: { line: 59, column: 33 } }, '28': { start: { line: 62, column: 6 }, end: { line: 65, column: 8 } }, '29': { start: { line: 63, column: 8 }, end: { line: 63, column: 38 } }, '30': { start: { line: 64, column: 8 }, end: { line: 64, column: 34 } }, '31': { start: { line: 66, column: 6 }, end: { line: 69, column: 8 } }, '32': { start: { line: 67, column: 8 }, end: { line: 67, column: 38 } }, '33': { start: { line: 68, column: 8 }, end: { line: 68, column: 27 } }, '34': { start: { line: 74, column: 6 }, end: { line: 74, column: 38 } }, '35': { start: { line: 75, column: 6 }, end: { line: 75, column: 35 } }, '36': { start: { line: 76, column: 6 }, end: { line: 76, column: 25 } }, '37': { start: { line: 81, column: 6 }, end: { line: 81, column: 50 } }, '38': { start: { line: 86, column: 18 }, end: { line: 86, column: 43 } }, '39': { start: { line: 87, column: 6 }, end: { line: 87, column: 23 } }, '40': { start: { line: 88, column: 6 }, end: { line: 103, column: 7 } }, '41': { start: { line: 89, column: 19 }, end: { line: 89, column: 27 } }, '42': { start: { line: 90, column: 8 }, end: { line: 90, column: 47 } }, '43': { start: { line: 91, column: 8 }, end: { line: 91, column: 72 } }, '44': { start: { line: 92, column: 8 }, end: { line: 92, column: 27 } }, '45': { start: { line: 93, column: 21 }, end: { line: 93, column: 32 } }, '46': { start: { line: 94, column: 8 }, end: { line: 99, column: 9 } }, '47': { start: { line: 95, column: 22 }, end: { line: 95, column: 40 } }, '48': { start: { line: 96, column: 10 }, end: { line: 96, column: 48 } }, '49': { start: { line: 97, column: 10 }, end: { line: 97, column: 34 } }, '50': { start: { line: 98, column: 10 }, end: { line: 98, column: 29 } }, '51': { start: { line: 100, column: 8 }, end: { line: 102, column: 9 } }, '52': { start: { line: 101, column: 10 }, end: { line: 101, column: 28 } }, '53': { start: { line: 104, column: 6 }, end: { line: 104, column: 25 } }, '54': { start: { line: 109, column: 6 }, end: { line: 109, column: 38 } }, '55': { start: { line: 110, column: 6 }, end: { line: 113, column: 7 } }, '56': { start: { line: 111, column: 8 }, end: { line: 111, column: 54 } }, '57': { start: { line: 112, column: 8 }, end: { line: 112, column: 25 } }, '58': { start: { line: 118, column: 6 }, end: { line: 121, column: 7 } }, '59': { start: { line: 119, column: 8 }, end: { line: 119, column: 27 } }, '60': { start: { line: 120, column: 8 }, end: { line: 120, column: 54 } }, '61': { start: { line: 122, column: 6 }, end: { line: 122, column: 25 } }, '62': { start: { line: 127, column: 6 }, end: { line: 127, column: 38 } }, '63': { start: { line: 128, column: 6 }, end: { line: 128, column: 34 } }, '64': { start: { line: 129, column: 6 }, end: { line: 132, column: 7 } }, '65': { start: { line: 130, column: 8 }, end: { line: 130, column: 54 } }, '66': { start: { line: 131, column: 8 }, end: { line: 131, column: 25 } }, '67': { start: { line: 137, column: 6 }, end: { line: 140, column: 7 } }, '68': { start: { line: 138, column: 8 }, end: { line: 138, column: 27 } }, '69': { start: { line: 139, column: 8 }, end: { line: 139, column: 76 } }, '70': { start: { line: 141, column: 6 }, end: { line: 143, column: 7 } }, '71': { start: { line: 142, column: 8 }, end: { line: 142, column: 26 } }, '72': { start: { line: 144, column: 6 }, end: { line: 144, column: 25 } }, '73': { start: { line: 153, column: 6 }, end: { line: 155, column: 7 } }, '74': { start: { line: 154, column: 8 }, end: { line: 154, column: 15 } }, '75': { start: { line: 156, column: 6 }, end: { line: 156, column: 38 } }, '76': { start: { line: 161, column: 6 }, end: { line: 163, column: 7 } }, '77': { start: { line: 162, column: 8 }, end: { line: 162, column: 15 } }, '78': { start: { line: 164, column: 6 }, end: { line: 164, column: 38 } }, '79': { start: { line: 170, column: 6 }, end: { line: 170, column: 53 } }, '80': { start: { line: 175, column: 6 }, end: { line: 175, column: 42 } }, '81': { start: { line: 180, column: 6 }, end: { line: 180, column: 40 } }, '82': { start: { line: 181, column: 6 }, end: { line: 181, column: 42 } }, '83': { start: { line: 182, column: 6 }, end: { line: 182, column: 25 } }, '84': { start: { line: 183, column: 6 }, end: { line: 183, column: 26 } }, '85': { start: { line: 184, column: 6 }, end: { line: 184, column: 38 } }, '86': { start: { line: 185, column: 6 }, end: { line: 185, column: 42 } }, '87': { start: { line: 186, column: 6 }, end: { line: 186, column: 25 } }, '88': { start: { line: 191, column: 6 }, end: { line: 191, column: 42 } }, '89': { start: { line: 196, column: 6 }, end: { line: 196, column: 37 } }, '90': { start: { line: 201, column: 6 }, end: { line: 201, column: 51 } }, '91': { start: { line: 204, column: 2 }, end: { line: 204, column: 26 } }, '92': { start: { line: 213, column: 22 }, end: { line: 213, column: 28 } }, '93': { start: { line: 215, column: 20 }, end: { line: 220, column: 1 } }, '94': { start: { line: 216, column: 2 }, end: { line: 218, column: 3 } }, '95': { start: { line: 217, column: 4 }, end: { line: 217, column: 45 } }, '96': { start: { line: 219, column: 2 }, end: { line: 219, column: 45 } }, '97': { start: { line: 223, column: 2 }, end: { line: 223, column: 35 } } }, fnMap: { '0': { name: 'chalkColor', decl: { start: { line: 4, column: 9 }, end: { line: 4, column: 19 } }, loc: { start: { line: 4, column: 26 }, end: { line: 12, column: 1 } }, line: 4 }, '1': { name: '(anonymous_1)', decl: { start: { line: 5, column: 33 }, end: { line: 5, column: 34 } }, loc: { start: { line: 5, column: 45 }, end: { line: 11, column: 3 } }, line: 5 }, '2': { name: '(anonymous_2)', decl: { start: { line: 24, column: 23 }, end: { line: 24, column: 24 } }, loc: { start: { line: 24, column: 49 }, end: { line: 205, column: 1 } }, line: 24 }, '3': { name: 'ConsoleFormatter', decl: { start: { line: 27, column: 11 }, end: { line: 27, column: 27 } }, loc: { start: { line: 27, column: 30 }, end: { line: 34, column: 3 } }, line: 27 }, '4': { name: 'prepareContext', decl: { start: { line: 38, column: 20 }, end: { line: 38, column: 34 } }, loc: { start: { line: 38, column: 44 }, end: { line: 70, column: 5 } }, line: 38 }, '5': { name: '(anonymous_5)', decl: { start: { line: 40, column: 23 }, end: { line: 40, column: 24 } }, loc: { start: { line: 40, column: 41 }, end: { line: 44, column: 7 } }, line: 40 }, '6': { name: '(anonymous_6)', decl: { start: { line: 45, column: 24 }, end: { line: 45, column: 25 } }, loc: { start: { line: 45, column: 36 }, end: { line: 47, column: 7 } }, line: 45 }, '7': { name: '(anonymous_7)', decl: { start: { line: 48, column: 20 }, end: { line: 48, column: 21 } }, loc: { start: { line: 48, column: 32 }, end: { line: 61, column: 7 } }, line: 48 }, '8': { name: '(anonymous_8)', decl: { start: { line: 62, column: 26 }, end: { line: 62, column: 27 } }, loc: { start: { line: 62, column: 43 }, end: { line: 65, column: 7 } }, line: 62 }, '9': { name: '(anonymous_9)', decl: { start: { line: 66, column: 25 }, end: { line: 66, column: 26 } }, loc: { start: { line: 66, column: 37 }, end: { line: 69, column: 7 } }, line: 66 }, '10': { name: 'typeFormattterErrorFormatter', decl: { start: { line: 73, column: 20 }, end: { line: 73, column: 48 } }, loc: { start: { line: 73, column: 63 }, end: { line: 77, column: 5 } }, line: 73 }, '11': { name: 'formatValue', decl: { start: { line: 80, column: 20 }, end: { line: 80, column: 31 } }, loc: { start: { line: 80, column: 48 }, end: { line: 82, column: 5 } }, line: 80 }, '12': { name: 'formatTextDiffString', decl: { start: { line: 85, column: 20 }, end: { line: 85, column: 40 } }, loc: { start: { line: 85, column: 57 }, end: { line: 105, column: 5 } }, line: 85 }, '13': { name: 'rootBegin', decl: { start: { line: 108, column: 20 }, end: { line: 108, column: 29 } }, loc: { start: { line: 108, column: 55 }, end: { line: 114, column: 5 } }, line: 108 }, '14': { name: 'rootEnd', decl: { start: { line: 117, column: 20 }, end: { line: 117, column: 27 } }, loc: { start: { line: 117, column: 53 }, end: { line: 123, column: 5 } }, line: 117 }, '15': { name: 'nodeBegin', decl: { start: { line: 126, column: 20 }, end: { line: 126, column: 29 } }, loc: { start: { line: 126, column: 69 }, end: { line: 133, column: 5 } }, line: 126 }, '16': { name: 'nodeEnd', decl: { start: { line: 136, column: 20 }, end: { line: 136, column: 27 } }, loc: { start: { line: 136, column: 75 }, end: { line: 145, column: 5 } }, line: 136 }, '17': { name: 'format_unchanged', decl: { start: { line: 152, column: 20 }, end: { line: 152, column: 36 } }, loc: { start: { line: 152, column: 59 }, end: { line: 157, column: 5 } }, line: 152 }, '18': { name: 'format_movedestination', decl: { start: { line: 160, column: 20 }, end: { line: 160, column: 42 } }, loc: { start: { line: 160, column: 65 }, end: { line: 165, column: 5 } }, line: 160 }, '19': { name: 'format_node', decl: { start: { line: 168, column: 20 }, end: { line: 168, column: 31 } }, loc: { start: { line: 168, column: 54 }, end: { line: 171, column: 5 } }, line: 168 }, '20': { name: 'format_added', decl: { start: { line: 174, column: 20 }, end: { line: 174, column: 32 } }, loc: { start: { line: 174, column: 49 }, end: { line: 176, column: 5 } }, line: 174 }, '21': { name: 'format_modified', decl: { start: { line: 179, column: 20 }, end: { line: 179, column: 35 } }, loc: { start: { line: 179, column: 52 }, end: { line: 187, column: 5 } }, line: 179 }, '22': { name: 'format_deleted', decl: { start: { line: 190, column: 20 }, end: { line: 190, column: 34 } }, loc: { start: { line: 190, column: 51 }, end: { line: 192, column: 5 } }, line: 190 }, '23': { name: 'format_moved', decl: { start: { line: 195, column: 20 }, end: { line: 195, column: 32 } }, loc: { start: { line: 195, column: 49 }, end: { line: 197, column: 5 } }, line: 195 }, '24': { name: 'format_textdiff', decl: { start: { line: 200, column: 20 }, end: { line: 200, column: 35 } }, loc: { start: { line: 200, column: 52 }, end: { line: 202, column: 5 } }, line: 200 }, '25': { name: 'format', decl: { start: { line: 215, column: 29 }, end: { line: 215, column: 35 } }, loc: { start: { line: 215, column: 49 }, end: { line: 220, column: 1 } }, line: 215 }, '26': { name: 'log', decl: { start: { line: 222, column: 16 }, end: { line: 222, column: 19 } }, loc: { start: { line: 222, column: 33 }, end: { line: 224, column: 1 } }, line: 222 } }, branchMap: { '0': { loc: { start: { line: 5, column: 9 }, end: { line: 11, column: 3 } }, type: 'binary-expr', locations: [{ start: { line: 5, column: 9 }, end: { line: 5, column: 14 } }, { start: { line: 5, column: 18 }, end: { line: 5, column: 29 } }, { start: { line: 5, column: 33 }, end: { line: 11, column: 3 } }], line: 5 }, '1': { loc: { start: { line: 30, column: 62 }, end: { line: 30, column: 131 } }, type: 'binary-expr', locations: [{ start: { line: 30, column: 62 }, end: { line: 30, column: 88 } }, { start: { line: 30, column: 92 }, end: { line: 30, column: 131 } }], line: 30 }, '2': { loc: { start: { line: 39, column: 23 }, end: { line: 39, column: 112 } }, type: 'binary-expr', locations: [{ start: { line: 39, column: 23 }, end: { line: 39, column: 59 } }, { start: { line: 39, column: 63 }, end: { line: 39, column: 112 } }], line: 39 }, '3': { loc: { start: { line: 41, column: 28 }, end: { line: 41, column: 49 } }, type: 'binary-expr', locations: [{ start: { line: 41, column: 28 }, end: { line: 41, column: 44 } }, { start: { line: 41, column: 48 }, end: { line: 41, column: 49 } }], line: 41 }, '4': { loc: { start: { line: 41, column: 54 }, end: { line: 41, column: 96 } }, type: 'cond-expr', locations: [{ start: { line: 41, column: 86 }, end: { line: 41, column: 87 } }, { start: { line: 41, column: 90 }, end: { line: 41, column: 96 } }], line: 41 }, '5': { loc: { start: { line: 46, column: 33 }, end: { line: 46, column: 53 } }, type: 'binary-expr', locations: [{ start: { line: 46, column: 33 }, end: { line: 46, column: 47 } }, { start: { line: 46, column: 51 }, end: { line: 46, column: 53 } }], line: 46 }, '6': { loc: { start: { line: 55, column: 40 }, end: { line: 55, column: 60 } }, type: 'binary-expr', locations: [{ start: { line: 55, column: 40 }, end: { line: 55, column: 54 } }, { start: { line: 55, column: 58 }, end: { line: 55, column: 60 } }], line: 55 }, '7': { loc: { start: { line: 56, column: 10 }, end: { line: 58, column: 11 } }, type: 'if', locations: [{ start: { line: 56, column: 10 }, end: { line: 58, column: 11 } }, { start: { line: 56, column: 10 }, end: { line: 58, column: 11 } }], line: 56 }, '8': { loc: { start: { line: 56, column: 14 }, end: { line: 56, column: 41 } }, type: 'binary-expr', locations: [{ start: { line: 56, column: 14 }, end: { line: 56, column: 24 } }, { start: { line: 56, column: 28 }, end: { line: 56, column: 41 } }], line: 56 }, '9': { loc: { start: { line: 63, column: 21 }, end: { line: 63, column: 37 } }, type: 'binary-expr', locations: [{ start: { line: 63, column: 21 }, end: { line: 63, column: 31 } }, { start: { line: 63, column: 35 }, end: { line: 63, column: 37 } }], line: 63 }, '10': { loc: { start: { line: 67, column: 21 }, end: { line: 67, column: 37 } }, type: 'binary-expr', locations: [{ start: { line: 67, column: 21 }, end: { line: 67, column: 31 } }, { start: { line: 67, column: 35 }, end: { line: 67, column: 37 } }], line: 67 }, '11': { loc: { start: { line: 100, column: 8 }, end: { line: 102, column: 9 } }, type: 'if', locations: [{ start: { line: 100, column: 8 }, end: { line: 102, column: 9 } }, { start: { line: 100, column: 8 }, end: { line: 102, column: 9 } }], line: 100 }, '12': { loc: { start: { line: 110, column: 6 }, end: { line: 113, column: 7 } }, type: 'if', locations: [{ start: { line: 110, column: 6 }, end: { line: 113, column: 7 } }, { start: { line: 110, column: 6 }, end: { line: 113, column: 7 } }], line: 110 }, '13': { loc: { start: { line: 111, column: 20 }, end: { line: 111, column: 52 } }, type: 'cond-expr', locations: [{ start: { line: 111, column: 43 }, end: { line: 111, column: 46 } }, { start: { line: 111, column: 49 }, end: { line: 111, column: 52 } }], line: 111 }, '14': { loc: { start: { line: 118, column: 6 }, end: { line: 121, column: 7 } }, type: 'if', locations: [{ start: { line: 118, column: 6 }, end: { line: 121, column: 7 } }, { start: { line: 118, column: 6 }, end: { line: 121, column: 7 } }], line: 118 }, '15': { loc: { start: { line: 120, column: 20 }, end: { line: 120, column: 52 } }, type: 'cond-expr', locations: [{ start: { line: 120, column: 43 }, end: { line: 120, column: 46 } }, { start: { line: 120, column: 49 }, end: { line: 120, column: 52 } }], line: 120 }, '16': { loc: { start: { line: 129, column: 6 }, end: { line: 132, column: 7 } }, type: 'if', locations: [{ start: { line: 129, column: 6 }, end: { line: 132, column: 7 } }, { start: { line: 129, column: 6 }, end: { line: 132, column: 7 } }], line: 129 }, '17': { loc: { start: { line: 130, column: 20 }, end: { line: 130, column: 52 } }, type: 'cond-expr', locations: [{ start: { line: 130, column: 43 }, end: { line: 130, column: 46 } }, { start: { line: 130, column: 49 }, end: { line: 130, column: 52 } }], line: 130 }, '18': { loc: { start: { line: 137, column: 6 }, end: { line: 140, column: 7 } }, type: 'if', locations: [{ start: { line: 137, column: 6 }, end: { line: 140, column: 7 } }, { start: { line: 137, column: 6 }, end: { line: 140, column: 7 } }], line: 137 }, '19': { loc: { start: { line: 139, column: 20 }, end: { line: 139, column: 74 } }, type: 'cond-expr', locations: [{ start: { line: 139, column: 43 }, end: { line: 139, column: 46 } }, { start: { line: 139, column: 49 }, end: { line: 139, column: 74 } }], line: 139 }, '20': { loc: { start: { line: 139, column: 56 }, end: { line: 139, column: 73 } }, type: 'cond-expr', locations: [{ start: { line: 139, column: 65 }, end: { line: 139, column: 67 } }, { start: { line: 139, column: 70 }, end: { line: 139, column: 73 } }], line: 139 }, '21': { loc: { start: { line: 141, column: 6 }, end: { line: 143, column: 7 } }, type: 'if', locations: [{ start: { line: 141, column: 6 }, end: { line: 143, column: 7 } }, { start: { line: 141, column: 6 }, end: { line: 143, column: 7 } }], line: 141 }, '22': { loc: { start: { line: 153, column: 6 }, end: { line: 155, column: 7 } }, type: 'if', locations: [{ start: { line: 153, column: 6 }, end: { line: 155, column: 7 } }, { start: { line: 153, column: 6 }, end: { line: 155, column: 7 } }], line: 153 }, '23': { loc: { start: { line: 161, column: 6 }, end: { line: 163, column: 7 } }, type: 'if', locations: [{ start: { line: 161, column: 6 }, end: { line: 163, column: 7 } }, { start: { line: 161, column: 6 }, end: { line: 163, column: 7 } }], line: 161 }, '24': { loc: { start: { line: 216, column: 2 }, end: { line: 218, column: 3 } }, type: 'if', locations: [{ start: { line: 216, column: 2 }, end: { line: 218, column: 3 } }, { start: { line: 216, column: 2 }, end: { line: 218, column: 3 } }], line: 216 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0, '27': 0, '28': 0, '29': 0, '30': 0, '31': 0, '32': 0, '33': 0, '34': 0, '35': 0, '36': 0, '37': 0, '38': 0, '39': 0, '40': 0, '41': 0, '42': 0, '43': 0, '44': 0, '45': 0, '46': 0, '47': 0, '48': 0, '49': 0, '50': 0, '51': 0, '52': 0, '53': 0, '54': 0, '55': 0, '56': 0, '57': 0, '58': 0, '59': 0, '60': 0, '61': 0, '62': 0, '63': 0, '64': 0, '65': 0, '66': 0, '67': 0, '68': 0, '69': 0, '70': 0, '71': 0, '72': 0, '73': 0, '74': 0, '75': 0, '76': 0, '77': 0, '78': 0, '79': 0, '80': 0, '81': 0, '82': 0, '83': 0, '84': 0, '85': 0, '86': 0, '87': 0, '88': 0, '89': 0, '90': 0, '91': 0, '92': 0, '93': 0, '94': 0, '95': 0, '96': 0, '97': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0, '17': 0, '18': 0, '19': 0, '20': 0, '21': 0, '22': 0, '23': 0, '24': 0, '25': 0, '26': 0 }, b: { '0': [0, 0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0], '5': [0, 0], '6': [0, 0], '7': [0, 0], '8': [0, 0], '9': [0, 0], '10': [0, 0], '11': [0, 0], '12': [0, 0], '13': [0, 0], '14': [0, 0], '15': [0, 0], '16': [0, 0], '17': [0, 0], '18': [0, 0], '19': [0, 0], '20': [0, 0], '21': [0, 0], '22': [0, 0], '23': [0, 0], '24': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
3927 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
3928 | return coverage[path];
|
3929 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
3930 | }();function chalkColor(name) {
|
3931 | cov_ye0cg04jg.f[0]++;cov_ye0cg04jg.s[0]++;return (cov_ye0cg04jg.b[0][0]++, chalk) && (cov_ye0cg04jg.b[0][1]++, chalk[name]) || (cov_ye0cg04jg.b[0][2]++, function () {
|
3932 | cov_ye0cg04jg.f[1]++;cov_ye0cg04jg.s[1]++;for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3933 | cov_ye0cg04jg.s[2]++;args[_key] = arguments[_key];
|
3934 | }cov_ye0cg04jg.s[3]++;return args;
|
3935 | });
|
3936 | }var colors = (cov_ye0cg04jg.s[4]++, { added: chalkColor('green'), deleted: chalkColor('red'), movedestination: chalkColor('gray'), moved: chalkColor('yellow'), unchanged: chalkColor('gray'), error: chalkColor('white.bgRed'), textDiffLine: chalkColor('gray') });var ConsoleFormatter = (cov_ye0cg04jg.s[5]++, function (_BaseFormatter) {
|
3937 | cov_ye0cg04jg.f[2]++;cov_ye0cg04jg.s[6]++;inherits$1(ConsoleFormatter, _BaseFormatter);function ConsoleFormatter() {
|
3938 | cov_ye0cg04jg.f[3]++;cov_ye0cg04jg.s[7]++;classCallCheck$1(this, ConsoleFormatter);var _this = (cov_ye0cg04jg.s[8]++, possibleConstructorReturn$1(this, ((cov_ye0cg04jg.b[1][0]++, ConsoleFormatter.__proto__) || (cov_ye0cg04jg.b[1][1]++, Object.getPrototypeOf(ConsoleFormatter))).call(this)));cov_ye0cg04jg.s[9]++;_this.includeMoveDestinations = false;cov_ye0cg04jg.s[10]++;return _this;
|
3939 | }cov_ye0cg04jg.s[11]++;createClass$1(ConsoleFormatter, [{ key: 'prepareContext', value: function prepareContext(context) {
|
3940 | cov_ye0cg04jg.f[4]++;cov_ye0cg04jg.s[12]++;get$1((cov_ye0cg04jg.b[2][0]++, ConsoleFormatter.prototype.__proto__) || (cov_ye0cg04jg.b[2][1]++, Object.getPrototypeOf(ConsoleFormatter.prototype)), 'prepareContext', this).call(this, context);cov_ye0cg04jg.s[13]++;context.indent = function (levels) {
|
3941 | cov_ye0cg04jg.f[5]++;cov_ye0cg04jg.s[14]++;this.indentLevel = ((cov_ye0cg04jg.b[3][0]++, this.indentLevel) || (cov_ye0cg04jg.b[3][1]++, 0)) + (typeof levels === 'undefined' ? (cov_ye0cg04jg.b[4][0]++, 1) : (cov_ye0cg04jg.b[4][1]++, levels));cov_ye0cg04jg.s[15]++;this.indentPad = new Array(this.indentLevel + 1).join(' ');cov_ye0cg04jg.s[16]++;this.outLine();
|
3942 | };cov_ye0cg04jg.s[17]++;context.outLine = function () {
|
3943 | cov_ye0cg04jg.f[6]++;cov_ye0cg04jg.s[18]++;this.buffer.push('\n' + ((cov_ye0cg04jg.b[5][0]++, this.indentPad) || (cov_ye0cg04jg.b[5][1]++, '')));
|
3944 | };cov_ye0cg04jg.s[19]++;context.out = function () {
|
3945 | cov_ye0cg04jg.f[7]++;cov_ye0cg04jg.s[20]++;for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
3946 | cov_ye0cg04jg.s[21]++;args[_key2] = arguments[_key2];
|
3947 | }cov_ye0cg04jg.s[22]++;for (var i = 0, l = args.length; i < l; i++) {
|
3948 | var lines = (cov_ye0cg04jg.s[23]++, args[i].split('\n'));var text = (cov_ye0cg04jg.s[24]++, lines.join('\n' + ((cov_ye0cg04jg.b[6][0]++, this.indentPad) || (cov_ye0cg04jg.b[6][1]++, ''))));cov_ye0cg04jg.s[25]++;if ((cov_ye0cg04jg.b[8][0]++, this.color) && (cov_ye0cg04jg.b[8][1]++, this.color[0])) {
|
3949 | cov_ye0cg04jg.b[7][0]++;cov_ye0cg04jg.s[26]++;text = this.color[0](text);
|
3950 | } else {
|
3951 | cov_ye0cg04jg.b[7][1]++;
|
3952 | }cov_ye0cg04jg.s[27]++;this.buffer.push(text);
|
3953 | }
|
3954 | };cov_ye0cg04jg.s[28]++;context.pushColor = function (color) {
|
3955 | cov_ye0cg04jg.f[8]++;cov_ye0cg04jg.s[29]++;this.color = (cov_ye0cg04jg.b[9][0]++, this.color) || (cov_ye0cg04jg.b[9][1]++, []);cov_ye0cg04jg.s[30]++;this.color.unshift(color);
|
3956 | };cov_ye0cg04jg.s[31]++;context.popColor = function () {
|
3957 | cov_ye0cg04jg.f[9]++;cov_ye0cg04jg.s[32]++;this.color = (cov_ye0cg04jg.b[10][0]++, this.color) || (cov_ye0cg04jg.b[10][1]++, []);cov_ye0cg04jg.s[33]++;this.color.shift();
|
3958 | };
|
3959 | } }, { key: 'typeFormattterErrorFormatter', value: function typeFormattterErrorFormatter(context, err) {
|
3960 | cov_ye0cg04jg.f[10]++;cov_ye0cg04jg.s[34]++;context.pushColor(colors.error);cov_ye0cg04jg.s[35]++;context.out('[ERROR]' + err);cov_ye0cg04jg.s[36]++;context.popColor();
|
3961 | } }, { key: 'formatValue', value: function formatValue(context, value) {
|
3962 | cov_ye0cg04jg.f[11]++;cov_ye0cg04jg.s[37]++;context.out(JSON.stringify(value, null, 2));
|
3963 | } }, { key: 'formatTextDiffString', value: function formatTextDiffString(context, value) {
|
3964 | cov_ye0cg04jg.f[12]++;var lines = (cov_ye0cg04jg.s[38]++, this.parseTextDiff(value));cov_ye0cg04jg.s[39]++;context.indent();cov_ye0cg04jg.s[40]++;for (var i = 0, l = lines.length; i < l; i++) {
|
3965 | var line = (cov_ye0cg04jg.s[41]++, lines[i]);cov_ye0cg04jg.s[42]++;context.pushColor(colors.textDiffLine);cov_ye0cg04jg.s[43]++;context.out(line.location.line + ',' + line.location.chr + ' ');cov_ye0cg04jg.s[44]++;context.popColor();var pieces = (cov_ye0cg04jg.s[45]++, line.pieces);cov_ye0cg04jg.s[46]++;for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
|
3966 | var piece = (cov_ye0cg04jg.s[47]++, pieces[pieceIndex]);cov_ye0cg04jg.s[48]++;context.pushColor(colors[piece.type]);cov_ye0cg04jg.s[49]++;context.out(piece.text);cov_ye0cg04jg.s[50]++;context.popColor();
|
3967 | }cov_ye0cg04jg.s[51]++;if (i < l - 1) {
|
3968 | cov_ye0cg04jg.b[11][0]++;cov_ye0cg04jg.s[52]++;context.outLine();
|
3969 | } else {
|
3970 | cov_ye0cg04jg.b[11][1]++;
|
3971 | }
|
3972 | }cov_ye0cg04jg.s[53]++;context.indent(-1);
|
3973 | } }, { key: 'rootBegin', value: function rootBegin(context, type, nodeType) {
|
3974 | cov_ye0cg04jg.f[13]++;cov_ye0cg04jg.s[54]++;context.pushColor(colors[type]);cov_ye0cg04jg.s[55]++;if (type === 'node') {
|
3975 | cov_ye0cg04jg.b[12][0]++;cov_ye0cg04jg.s[56]++;context.out(nodeType === 'array' ? (cov_ye0cg04jg.b[13][0]++, '[') : (cov_ye0cg04jg.b[13][1]++, '{'));cov_ye0cg04jg.s[57]++;context.indent();
|
3976 | } else {
|
3977 | cov_ye0cg04jg.b[12][1]++;
|
3978 | }
|
3979 | } }, { key: 'rootEnd', value: function rootEnd(context, type, nodeType) {
|
3980 | cov_ye0cg04jg.f[14]++;cov_ye0cg04jg.s[58]++;if (type === 'node') {
|
3981 | cov_ye0cg04jg.b[14][0]++;cov_ye0cg04jg.s[59]++;context.indent(-1);cov_ye0cg04jg.s[60]++;context.out(nodeType === 'array' ? (cov_ye0cg04jg.b[15][0]++, ']') : (cov_ye0cg04jg.b[15][1]++, '}'));
|
3982 | } else {
|
3983 | cov_ye0cg04jg.b[14][1]++;
|
3984 | }cov_ye0cg04jg.s[61]++;context.popColor();
|
3985 | } }, { key: 'nodeBegin', value: function nodeBegin(context, key, leftKey, type, nodeType) {
|
3986 | cov_ye0cg04jg.f[15]++;cov_ye0cg04jg.s[62]++;context.pushColor(colors[type]);cov_ye0cg04jg.s[63]++;context.out(leftKey + ': ');cov_ye0cg04jg.s[64]++;if (type === 'node') {
|
3987 | cov_ye0cg04jg.b[16][0]++;cov_ye0cg04jg.s[65]++;context.out(nodeType === 'array' ? (cov_ye0cg04jg.b[17][0]++, '[') : (cov_ye0cg04jg.b[17][1]++, '{'));cov_ye0cg04jg.s[66]++;context.indent();
|
3988 | } else {
|
3989 | cov_ye0cg04jg.b[16][1]++;
|
3990 | }
|
3991 | } }, { key: 'nodeEnd', value: function nodeEnd(context, key, leftKey, type, nodeType, isLast) {
|
3992 | cov_ye0cg04jg.f[16]++;cov_ye0cg04jg.s[67]++;if (type === 'node') {
|
3993 | cov_ye0cg04jg.b[18][0]++;cov_ye0cg04jg.s[68]++;context.indent(-1);cov_ye0cg04jg.s[69]++;context.out(nodeType === 'array' ? (cov_ye0cg04jg.b[19][0]++, ']') : (cov_ye0cg04jg.b[19][1]++, '}' + (isLast ? (cov_ye0cg04jg.b[20][0]++, '') : (cov_ye0cg04jg.b[20][1]++, ','))));
|
3994 | } else {
|
3995 | cov_ye0cg04jg.b[18][1]++;
|
3996 | }cov_ye0cg04jg.s[70]++;if (!isLast) {
|
3997 | cov_ye0cg04jg.b[21][0]++;cov_ye0cg04jg.s[71]++;context.outLine();
|
3998 | } else {
|
3999 | cov_ye0cg04jg.b[21][1]++;
|
4000 | }cov_ye0cg04jg.s[72]++;context.popColor();
|
4001 | } }, { key: 'format_unchanged', value: function format_unchanged(context, delta, left) {
|
4002 | cov_ye0cg04jg.f[17]++;cov_ye0cg04jg.s[73]++;if (typeof left === 'undefined') {
|
4003 | cov_ye0cg04jg.b[22][0]++;cov_ye0cg04jg.s[74]++;return;
|
4004 | } else {
|
4005 | cov_ye0cg04jg.b[22][1]++;
|
4006 | }cov_ye0cg04jg.s[75]++;this.formatValue(context, left);
|
4007 | } }, { key: 'format_movedestination', value: function format_movedestination(context, delta, left) {
|
4008 | cov_ye0cg04jg.f[18]++;cov_ye0cg04jg.s[76]++;if (typeof left === 'undefined') {
|
4009 | cov_ye0cg04jg.b[23][0]++;cov_ye0cg04jg.s[77]++;return;
|
4010 | } else {
|
4011 | cov_ye0cg04jg.b[23][1]++;
|
4012 | }cov_ye0cg04jg.s[78]++;this.formatValue(context, left);
|
4013 | } }, { key: 'format_node', value: function format_node(context, delta, left) {
|
4014 | cov_ye0cg04jg.f[19]++;cov_ye0cg04jg.s[79]++;
|
4015 | this.formatDeltaChildren(context, delta, left);
|
4016 | } }, { key: 'format_added', value: function format_added(context, delta) {
|
4017 | cov_ye0cg04jg.f[20]++;cov_ye0cg04jg.s[80]++;this.formatValue(context, delta[0]);
|
4018 | } }, { key: 'format_modified', value: function format_modified(context, delta) {
|
4019 | cov_ye0cg04jg.f[21]++;cov_ye0cg04jg.s[81]++;context.pushColor(colors.deleted);cov_ye0cg04jg.s[82]++;this.formatValue(context, delta[0]);cov_ye0cg04jg.s[83]++;context.popColor();cov_ye0cg04jg.s[84]++;context.out(' => ');cov_ye0cg04jg.s[85]++;context.pushColor(colors.added);cov_ye0cg04jg.s[86]++;this.formatValue(context, delta[1]);cov_ye0cg04jg.s[87]++;context.popColor();
|
4020 | } }, { key: 'format_deleted', value: function format_deleted(context, delta) {
|
4021 | cov_ye0cg04jg.f[22]++;cov_ye0cg04jg.s[88]++;this.formatValue(context, delta[0]);
|
4022 | } }, { key: 'format_moved', value: function format_moved(context, delta) {
|
4023 | cov_ye0cg04jg.f[23]++;cov_ye0cg04jg.s[89]++;context.out('==> ' + delta[1]);
|
4024 | } }, { key: 'format_textdiff', value: function format_textdiff(context, delta) {
|
4025 | cov_ye0cg04jg.f[24]++;cov_ye0cg04jg.s[90]++;this.formatTextDiffString(context, delta[0]);
|
4026 | } }]);cov_ye0cg04jg.s[91]++;return ConsoleFormatter;
|
4027 | }(BaseFormatter)); var defaultInstance$3 = (cov_ye0cg04jg.s[92]++, void 0);cov_ye0cg04jg.s[93]++;var format$3 = function format(delta, left) {
|
4028 | cov_ye0cg04jg.f[25]++;cov_ye0cg04jg.s[94]++;if (!defaultInstance$3) {
|
4029 | cov_ye0cg04jg.b[24][0]++;cov_ye0cg04jg.s[95]++;defaultInstance$3 = new ConsoleFormatter();
|
4030 | } else {
|
4031 | cov_ye0cg04jg.b[24][1]++;
|
4032 | }cov_ye0cg04jg.s[96]++;return defaultInstance$3.format(delta, left);
|
4033 | };function log$1(delta, left) {
|
4034 | cov_ye0cg04jg.f[26]++;cov_ye0cg04jg.s[97]++;console.log(format$3(delta, left));
|
4035 | }
|
4036 |
|
4037 | var console$1 = Object.freeze({
|
4038 | default: ConsoleFormatter,
|
4039 | format: format$3,
|
4040 | log: log$1
|
4041 | });
|
4042 |
|
4043 | var cov_1weqc1su9i = function () {
|
4044 | var path = '/Users/benja/proj/jsondiffpatch/src/formatters/index.js',
|
4045 | hash = 'c90281cbe3a6f4f9d6d07f59d6c3ec3cc53eab42',
|
4046 | global = new Function('return this')(),
|
4047 | gcv = '__coverage__',
|
4048 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/formatters/index.js', statementMap: {}, fnMap: {}, branchMap: {}, s: {}, f: {}, b: {}, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
4049 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
4050 | return coverage[path];
|
4051 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
4052 | }();
|
4053 |
|
4054 | var index = Object.freeze({
|
4055 | base: base,
|
4056 | html: html,
|
4057 | annotated: annotated,
|
4058 | jsonpatch: jsonpatch,
|
4059 | console: console$1
|
4060 | });
|
4061 |
|
4062 | var cov_wclgz6xnr = function () {
|
4063 | var path = '/Users/benja/proj/jsondiffpatch/src/date-reviver.js',
|
4064 | hash = '327f769b790d8f76a1477ada73bfb6605beb67d0',
|
4065 | global = new Function('return this')(),
|
4066 | gcv = '__coverage__',
|
4067 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/date-reviver.js', statementMap: { '0': { start: { line: 3, column: 14 }, end: { line: 3, column: 20 } }, '1': { start: { line: 4, column: 2 }, end: { line: 10, column: 3 } }, '2': { start: { line: 6, column: 4 }, end: { line: 6, column: 113 } }, '3': { start: { line: 7, column: 4 }, end: { line: 9, column: 5 } }, '4': { start: { line: 8, column: 6 }, end: { line: 8, column: 120 } }, '5': { start: { line: 11, column: 2 }, end: { line: 11, column: 15 } } }, fnMap: { '0': { name: 'dateReviver', decl: { start: { line: 2, column: 24 }, end: { line: 2, column: 35 } }, loc: { start: { line: 2, column: 48 }, end: { line: 12, column: 1 } }, line: 2 } }, branchMap: { '0': { loc: { start: { line: 4, column: 2 }, end: { line: 10, column: 3 } }, type: 'if', locations: [{ start: { line: 4, column: 2 }, end: { line: 10, column: 3 } }, { start: { line: 4, column: 2 }, end: { line: 10, column: 3 } }], line: 4 }, '1': { loc: { start: { line: 7, column: 4 }, end: { line: 9, column: 5 } }, type: 'if', locations: [{ start: { line: 7, column: 4 }, end: { line: 9, column: 5 } }, { start: { line: 7, column: 4 }, end: { line: 9, column: 5 } }], line: 7 }, '2': { loc: { start: { line: 8, column: 103 }, end: { line: 8, column: 116 } }, type: 'binary-expr', locations: [{ start: { line: 8, column: 103 }, end: { line: 8, column: 111 } }, { start: { line: 8, column: 115 }, end: { line: 8, column: 116 } }], line: 8 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0 }, f: { '0': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
4068 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
4069 | return coverage[path];
|
4070 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
4071 | }();
|
4072 | var cov_21a97a3n44 = function () {
|
4073 | var path = '/Users/benja/proj/jsondiffpatch/src/main.js',
|
4074 | hash = 'bae27349c61262eea6c8eeba2b90d234b62b4662',
|
4075 | global = new Function('return this')(),
|
4076 | gcv = '__coverage__',
|
4077 | coverageData = { path: '/Users/benja/proj/jsondiffpatch/src/main.js', statementMap: { '0': { start: { line: 11, column: 2 }, end: { line: 11, column: 34 } }, '1': { start: { line: 18, column: 22 }, end: { line: 18, column: 28 } }, '2': { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, '3': { start: { line: 22, column: 4 }, end: { line: 22, column: 40 } }, '4': { start: { line: 24, column: 2 }, end: { line: 24, column: 64 } }, '5': { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, '6': { start: { line: 29, column: 4 }, end: { line: 29, column: 40 } }, '7': { start: { line: 31, column: 2 }, end: { line: 31, column: 65 } }, '8': { start: { line: 35, column: 2 }, end: { line: 37, column: 3 } }, '9': { start: { line: 36, column: 4 }, end: { line: 36, column: 40 } }, '10': { start: { line: 38, column: 2 }, end: { line: 38, column: 67 } }, '11': { start: { line: 42, column: 2 }, end: { line: 44, column: 3 } }, '12': { start: { line: 43, column: 4 }, end: { line: 43, column: 40 } }, '13': { start: { line: 45, column: 2 }, end: { line: 45, column: 67 } }, '14': { start: { line: 49, column: 2 }, end: { line: 51, column: 3 } }, '15': { start: { line: 50, column: 4 }, end: { line: 50, column: 40 } }, '16': { start: { line: 52, column: 2 }, end: { line: 52, column: 65 } } }, fnMap: { '0': { name: 'create', decl: { start: { line: 10, column: 16 }, end: { line: 10, column: 22 } }, loc: { start: { line: 10, column: 32 }, end: { line: 12, column: 1 } }, line: 10 }, '1': { name: 'diff', decl: { start: { line: 20, column: 16 }, end: { line: 20, column: 20 } }, loc: { start: { line: 20, column: 23 }, end: { line: 25, column: 1 } }, line: 20 }, '2': { name: 'patch', decl: { start: { line: 27, column: 16 }, end: { line: 27, column: 21 } }, loc: { start: { line: 27, column: 24 }, end: { line: 32, column: 1 } }, line: 27 }, '3': { name: 'unpatch', decl: { start: { line: 34, column: 16 }, end: { line: 34, column: 23 } }, loc: { start: { line: 34, column: 26 }, end: { line: 39, column: 1 } }, line: 34 }, '4': { name: 'reverse', decl: { start: { line: 41, column: 16 }, end: { line: 41, column: 23 } }, loc: { start: { line: 41, column: 26 }, end: { line: 46, column: 1 } }, line: 41 }, '5': { name: 'clone', decl: { start: { line: 48, column: 16 }, end: { line: 48, column: 21 } }, loc: { start: { line: 48, column: 24 }, end: { line: 53, column: 1 } }, line: 48 } }, branchMap: { '0': { loc: { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, type: 'if', locations: [{ start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }, { start: { line: 21, column: 2 }, end: { line: 23, column: 3 } }], line: 21 }, '1': { loc: { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, type: 'if', locations: [{ start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }, { start: { line: 28, column: 2 }, end: { line: 30, column: 3 } }], line: 28 }, '2': { loc: { start: { line: 35, column: 2 }, end: { line: 37, column: 3 } }, type: 'if', locations: [{ start: { line: 35, column: 2 }, end: { line: 37, column: 3 } }, { start: { line: 35, column: 2 }, end: { line: 37, column: 3 } }], line: 35 }, '3': { loc: { start: { line: 42, column: 2 }, end: { line: 44, column: 3 } }, type: 'if', locations: [{ start: { line: 42, column: 2 }, end: { line: 44, column: 3 } }, { start: { line: 42, column: 2 }, end: { line: 44, column: 3 } }], line: 42 }, '4': { loc: { start: { line: 49, column: 2 }, end: { line: 51, column: 3 } }, type: 'if', locations: [{ start: { line: 49, column: 2 }, end: { line: 51, column: 3 } }, { start: { line: 49, column: 2 }, end: { line: 51, column: 3 } }], line: 49 } }, s: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, '11': 0, '12': 0, '13': 0, '14': 0, '15': 0, '16': 0 }, f: { '0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0 }, b: { '0': [0, 0], '1': [0, 0], '2': [0, 0], '3': [0, 0], '4': [0, 0] }, _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c' },
|
4078 | coverage = global[gcv] || (global[gcv] = {});if (coverage[path] && coverage[path].hash === hash) {
|
4079 | return coverage[path];
|
4080 | }coverageData.hash = hash;return coverage[path] = coverageData;
|
4081 | }();var defaultInstance$4 = (cov_21a97a3n44.s[1]++, void 0);function diff() {
|
4082 | cov_21a97a3n44.f[1]++;cov_21a97a3n44.s[2]++;if (!defaultInstance$4) {
|
4083 | cov_21a97a3n44.b[0][0]++;cov_21a97a3n44.s[3]++;defaultInstance$4 = new DiffPatcher();
|
4084 | } else {
|
4085 | cov_21a97a3n44.b[0][1]++;
|
4086 | }cov_21a97a3n44.s[4]++;return defaultInstance$4.diff.apply(defaultInstance$4, arguments);
|
4087 | }function patch() {
|
4088 | cov_21a97a3n44.f[2]++;cov_21a97a3n44.s[5]++;if (!defaultInstance$4) {
|
4089 | cov_21a97a3n44.b[1][0]++;cov_21a97a3n44.s[6]++;defaultInstance$4 = new DiffPatcher();
|
4090 | } else {
|
4091 | cov_21a97a3n44.b[1][1]++;
|
4092 | }cov_21a97a3n44.s[7]++;return defaultInstance$4.patch.apply(defaultInstance$4, arguments);
|
4093 | }function unpatch() {
|
4094 | cov_21a97a3n44.f[3]++;cov_21a97a3n44.s[8]++;if (!defaultInstance$4) {
|
4095 | cov_21a97a3n44.b[2][0]++;cov_21a97a3n44.s[9]++;defaultInstance$4 = new DiffPatcher();
|
4096 | } else {
|
4097 | cov_21a97a3n44.b[2][1]++;
|
4098 | }cov_21a97a3n44.s[10]++;return defaultInstance$4.unpatch.apply(defaultInstance$4, arguments);
|
4099 | }function reverse() {
|
4100 | cov_21a97a3n44.f[4]++;cov_21a97a3n44.s[11]++;if (!defaultInstance$4) {
|
4101 | cov_21a97a3n44.b[3][0]++;cov_21a97a3n44.s[12]++;defaultInstance$4 = new DiffPatcher();
|
4102 | } else {
|
4103 | cov_21a97a3n44.b[3][1]++;
|
4104 | }cov_21a97a3n44.s[13]++;return defaultInstance$4.reverse.apply(defaultInstance$4, arguments);
|
4105 | }function clone$1() {
|
4106 | cov_21a97a3n44.f[5]++;cov_21a97a3n44.s[14]++;if (!defaultInstance$4) {
|
4107 | cov_21a97a3n44.b[4][0]++;cov_21a97a3n44.s[15]++;defaultInstance$4 = new DiffPatcher();
|
4108 | } else {
|
4109 | cov_21a97a3n44.b[4][1]++;
|
4110 | }cov_21a97a3n44.s[16]++;return defaultInstance$4.clone.apply(defaultInstance$4, arguments);
|
4111 | }
|
4112 |
|
4113 | var examples = {};
|
4114 |
|
4115 | var exampleDate = function exampleDate() {
|
4116 | return new Date(2020, 10, 30, 15, 10, 3);
|
4117 | };
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 | examples.atomicValues = [
|
4123 |
|
4124 | {
|
4125 | left: undefined,
|
4126 | right: undefined,
|
4127 | delta: undefined,
|
4128 | reverse: undefined
|
4129 | }, {
|
4130 | left: undefined,
|
4131 | right: null,
|
4132 | delta: [null],
|
4133 | reverse: [null, 0, 0]
|
4134 | }, {
|
4135 | left: undefined,
|
4136 | right: false,
|
4137 | delta: [false],
|
4138 | reverse: [false, 0, 0]
|
4139 | }, {
|
4140 | left: undefined,
|
4141 | right: true,
|
4142 | delta: [true],
|
4143 | reverse: [true, 0, 0]
|
4144 | }, {
|
4145 | left: undefined,
|
4146 | right: 42,
|
4147 | delta: [42],
|
4148 | reverse: [42, 0, 0]
|
4149 | }, {
|
4150 | left: undefined,
|
4151 | right: 'some text',
|
4152 | delta: ['some text'],
|
4153 | reverse: ['some text', 0, 0]
|
4154 | }, {
|
4155 | left: undefined,
|
4156 | right: exampleDate(),
|
4157 | delta: [exampleDate()],
|
4158 | reverse: [exampleDate(), 0, 0]
|
4159 | }, {
|
4160 | left: undefined,
|
4161 | right: {
|
4162 | a: 1,
|
4163 | b: 2
|
4164 | },
|
4165 | delta: [{
|
4166 | a: 1,
|
4167 | b: 2
|
4168 | }],
|
4169 | reverse: [{
|
4170 | a: 1,
|
4171 | b: 2
|
4172 | }, 0, 0]
|
4173 | }, {
|
4174 | left: undefined,
|
4175 | right: [1, 2, 3],
|
4176 | delta: [[1, 2, 3]],
|
4177 | reverse: [[1, 2, 3], 0, 0]
|
4178 | }, {
|
4179 | left: undefined,
|
4180 | right: function right(x) {
|
4181 | return x * x;
|
4182 | },
|
4183 |
|
4184 | error: /not supported/
|
4185 | },
|
4186 |
|
4187 |
|
4188 | {
|
4189 | left: null,
|
4190 | right: null,
|
4191 | delta: undefined,
|
4192 | reverse: undefined
|
4193 | }, {
|
4194 | left: null,
|
4195 | right: false,
|
4196 | delta: [null, false],
|
4197 | reverse: [false, null]
|
4198 | }, {
|
4199 | left: null,
|
4200 | right: true,
|
4201 | delta: [null, true],
|
4202 | reverse: [true, null]
|
4203 | }, {
|
4204 | left: null,
|
4205 | right: 42,
|
4206 | delta: [null, 42],
|
4207 | reverse: [42, null]
|
4208 | }, {
|
4209 | left: null,
|
4210 | right: 'some text',
|
4211 | delta: [null, 'some text'],
|
4212 | reverse: ['some text', null]
|
4213 | }, {
|
4214 | left: null,
|
4215 | right: exampleDate(),
|
4216 | delta: [null, exampleDate()],
|
4217 | reverse: [exampleDate(), null]
|
4218 | }, {
|
4219 | left: null,
|
4220 | right: {
|
4221 | a: 1,
|
4222 | b: 2
|
4223 | },
|
4224 | delta: [null, {
|
4225 | a: 1,
|
4226 | b: 2
|
4227 | }],
|
4228 | reverse: [{
|
4229 | a: 1,
|
4230 | b: 2
|
4231 | }, null]
|
4232 | }, {
|
4233 | left: null,
|
4234 | right: function right(x) {
|
4235 | return x * x;
|
4236 | },
|
4237 |
|
4238 | error: /not supported/
|
4239 | },
|
4240 |
|
4241 |
|
4242 | {
|
4243 | left: false,
|
4244 | right: false,
|
4245 | delta: undefined,
|
4246 | reverse: undefined
|
4247 | }, {
|
4248 | left: false,
|
4249 | right: true,
|
4250 | delta: [false, true],
|
4251 | reverse: [true, false]
|
4252 | }, {
|
4253 | left: false,
|
4254 | right: 42,
|
4255 | delta: [false, 42],
|
4256 | reverse: [42, false]
|
4257 | }, {
|
4258 | left: false,
|
4259 | right: 'some text',
|
4260 | delta: [false, 'some text'],
|
4261 | reverse: ['some text', false]
|
4262 | }, {
|
4263 | left: false,
|
4264 | right: exampleDate(),
|
4265 | delta: [false, exampleDate()],
|
4266 | reverse: [exampleDate(), false]
|
4267 | }, {
|
4268 | left: false,
|
4269 | right: {
|
4270 | a: 1,
|
4271 | b: 2
|
4272 | },
|
4273 | delta: [false, {
|
4274 | a: 1,
|
4275 | b: 2
|
4276 | }],
|
4277 | reverse: [{
|
4278 | a: 1,
|
4279 | b: 2
|
4280 | }, false]
|
4281 | }, {
|
4282 | left: false,
|
4283 | right: [1, 2, 3],
|
4284 | delta: [false, [1, 2, 3]],
|
4285 | reverse: [[1, 2, 3], false]
|
4286 | }, {
|
4287 | left: false,
|
4288 | right: function right(x) {
|
4289 | return x * x;
|
4290 | },
|
4291 |
|
4292 | error: /not supported/
|
4293 | },
|
4294 |
|
4295 |
|
4296 | {
|
4297 | left: true,
|
4298 | right: true,
|
4299 | delta: undefined,
|
4300 | reverse: undefined
|
4301 | }, {
|
4302 | left: true,
|
4303 | right: 42,
|
4304 | delta: [true, 42],
|
4305 | reverse: [42, true]
|
4306 | }, {
|
4307 | left: true,
|
4308 | right: 'some text',
|
4309 | delta: [true, 'some text'],
|
4310 | reverse: ['some text', true]
|
4311 | }, {
|
4312 | left: true,
|
4313 | right: exampleDate(),
|
4314 | delta: [true, exampleDate()],
|
4315 | reverse: [exampleDate(), true]
|
4316 | }, {
|
4317 | left: true,
|
4318 | right: {
|
4319 | a: 1,
|
4320 | b: 2
|
4321 | },
|
4322 | delta: [true, {
|
4323 | a: 1,
|
4324 | b: 2
|
4325 | }],
|
4326 | reverse: [{
|
4327 | a: 1,
|
4328 | b: 2
|
4329 | }, true]
|
4330 | }, {
|
4331 | left: true,
|
4332 | right: [1, 2, 3],
|
4333 | delta: [true, [1, 2, 3]],
|
4334 | reverse: [[1, 2, 3], true]
|
4335 | }, {
|
4336 | left: true,
|
4337 | right: function right(x) {
|
4338 | return x * x;
|
4339 | },
|
4340 |
|
4341 | error: /not supported/
|
4342 | },
|
4343 |
|
4344 |
|
4345 | {
|
4346 | name: 'number -> same number',
|
4347 | left: 42,
|
4348 | right: 42,
|
4349 | delta: undefined,
|
4350 | reverse: undefined
|
4351 | }, {
|
4352 | left: 42,
|
4353 | right: -1,
|
4354 | delta: [42, -1],
|
4355 | reverse: [-1, 42]
|
4356 | }, {
|
4357 | left: 42,
|
4358 | right: 'some text',
|
4359 | delta: [42, 'some text'],
|
4360 | reverse: ['some text', 42]
|
4361 | }, {
|
4362 | left: 42,
|
4363 | right: exampleDate(),
|
4364 | delta: [42, exampleDate()],
|
4365 | reverse: [exampleDate(), 42]
|
4366 | }, {
|
4367 | left: 42,
|
4368 | right: {
|
4369 | a: 1,
|
4370 | b: 2
|
4371 | },
|
4372 | delta: [42, {
|
4373 | a: 1,
|
4374 | b: 2
|
4375 | }],
|
4376 | reverse: [{
|
4377 | a: 1,
|
4378 | b: 2
|
4379 | }, 42]
|
4380 | }, {
|
4381 | left: 42,
|
4382 | right: [1, 2, 3],
|
4383 | delta: [42, [1, 2, 3]],
|
4384 | reverse: [[1, 2, 3], 42]
|
4385 | }, {
|
4386 | left: 42,
|
4387 | right: function right(x) {
|
4388 | return x * x;
|
4389 | },
|
4390 |
|
4391 | error: /not supported/
|
4392 | },
|
4393 |
|
4394 |
|
4395 | {
|
4396 | name: 'string -> same string',
|
4397 | left: 'some text',
|
4398 | right: 'some text',
|
4399 | delta: undefined,
|
4400 | reverse: undefined
|
4401 | }, {
|
4402 | left: 'some text',
|
4403 | right: 'some fext',
|
4404 | delta: ['some text', 'some fext'],
|
4405 | reverse: ['some fext', 'some text']
|
4406 | }, {
|
4407 | left: 'some text',
|
4408 | right: exampleDate(),
|
4409 | delta: ['some text', exampleDate()],
|
4410 | reverse: [exampleDate(), 'some text']
|
4411 | }, {
|
4412 | left: 'some text',
|
4413 | right: {
|
4414 | a: 1,
|
4415 | b: 2
|
4416 | },
|
4417 | delta: ['some text', {
|
4418 | a: 1,
|
4419 | b: 2
|
4420 | }],
|
4421 | reverse: [{
|
4422 | a: 1,
|
4423 | b: 2
|
4424 | }, 'some text']
|
4425 | }, {
|
4426 | left: 'some text',
|
4427 | right: [1, 2, 3],
|
4428 | delta: ['some text', [1, 2, 3]],
|
4429 | reverse: [[1, 2, 3], 'some text']
|
4430 | },
|
4431 |
|
4432 |
|
4433 | {
|
4434 | name: 'Date -> same Date',
|
4435 | left: exampleDate(),
|
4436 | right: exampleDate(),
|
4437 | delta: undefined,
|
4438 | reverse: undefined
|
4439 | }, {
|
4440 | left: exampleDate(),
|
4441 | right: new Date(2020, 5, 31, 15, 12, 30),
|
4442 | delta: [exampleDate(), new Date(2020, 5, 31, 15, 12, 30)],
|
4443 | reverse: [new Date(2020, 5, 31, 15, 12, 30), exampleDate()]
|
4444 | }, {
|
4445 | left: exampleDate(),
|
4446 | right: {
|
4447 | a: 1,
|
4448 | b: 2
|
4449 | },
|
4450 | delta: [exampleDate(), {
|
4451 | a: 1,
|
4452 | b: 2
|
4453 | }],
|
4454 | reverse: [{
|
4455 | a: 1,
|
4456 | b: 2
|
4457 | }, exampleDate()]
|
4458 | }, {
|
4459 | left: exampleDate(),
|
4460 | right: [1, 2, 3],
|
4461 | delta: [exampleDate(), [1, 2, 3]],
|
4462 | reverse: [[1, 2, 3], exampleDate()]
|
4463 | }, {
|
4464 | left: exampleDate(),
|
4465 | right: function right(x) {
|
4466 | return x * x;
|
4467 | },
|
4468 |
|
4469 | error: /not supported/
|
4470 | },
|
4471 |
|
4472 |
|
4473 | {
|
4474 | name: 'string -> Function',
|
4475 | left: 'some text',
|
4476 | right: function right(x) {
|
4477 | return x * x;
|
4478 | },
|
4479 |
|
4480 | error: /not supported/
|
4481 | },
|
4482 |
|
4483 |
|
4484 | {
|
4485 | name: 'RegExp -> RegExp',
|
4486 | left: /regex/g,
|
4487 | right: /another regex/gi,
|
4488 | delta: ['/regex/g', '/another regex/gi'],
|
4489 | reverse: ['/another regex/gi', '/regex/g']
|
4490 | },
|
4491 |
|
4492 |
|
4493 | {
|
4494 | name: 'object -> same object',
|
4495 | left: {
|
4496 | a: 1,
|
4497 | b: 2
|
4498 | },
|
4499 | right: {
|
4500 | a: 1,
|
4501 | b: 2
|
4502 | },
|
4503 | delta: undefined,
|
4504 | reverse: undefined
|
4505 | }, {
|
4506 | left: {
|
4507 | a: 1,
|
4508 | b: 2
|
4509 | },
|
4510 | right: [1, 2, 3],
|
4511 | delta: [{
|
4512 | a: 1,
|
4513 | b: 2
|
4514 | }, [1, 2, 3]],
|
4515 | reverse: [[1, 2, 3], {
|
4516 | a: 1,
|
4517 | b: 2
|
4518 | }]
|
4519 | }, {
|
4520 | left: {
|
4521 | a: 1,
|
4522 | b: 2
|
4523 | },
|
4524 | right: function right(x) {
|
4525 | return x * x;
|
4526 | },
|
4527 |
|
4528 | error: /not supported/
|
4529 | },
|
4530 |
|
4531 |
|
4532 | {
|
4533 | name: 'array -> same array',
|
4534 | left: [1, 2, 3],
|
4535 | right: [1, 2, 3],
|
4536 | delta: undefined,
|
4537 | reverse: undefined
|
4538 | }, {
|
4539 | left: [1, 2, 3],
|
4540 | right: function right(x) {
|
4541 | return x * x;
|
4542 | },
|
4543 |
|
4544 | error: /not supported/
|
4545 | }, 0];
|
4546 |
|
4547 | var shortText = 'Madre,\ncuando yo sea grande\nquisiera hacer versos';
|
4548 | var largeText = '-Madre,\ncuando yo sea grande\nser\xE9 marinero.\n\nAhora estoy jugando\nque aquello es un puerto\ny que \xE9ste es un barco\ny \xE9stos son dos remos\ny por ese r\xEDo\nnavego y navego.\n\n(Agua, arena, piedras\ny dos palos viejos:\nun r\xEDo y un barco,\nun puerto y dos remos).\n\n-Madre,\ncuando yo sea grande\nser\xE9 jardinero.\n\nAhora estoy jugando\nque esto es un cantero,\naqu\xE9l un rosal,\n\xE9ste un jazminero\ny \xE9se es un camino\nque va por el medio.\n\n(Tierra, flores, hojas\ny unos tallos secos:\ncantero, camino,\nrosal, jazminero).\n\n-Madre,\ncuando yo sea grande\nquisiera hacer versos.\n\n-\xBFCon qu\xE9 est\xE1s jugando?\n\n-Madre, miro el cielo.\n\n(En dos ojos claros\ntodo el Universo).';
|
4549 |
|
4550 | examples.text = [{
|
4551 | left: shortText,
|
4552 | right: largeText,
|
4553 | delta: [shortText, largeText],
|
4554 | reverse: [largeText, shortText]
|
4555 | }, {
|
4556 | left: largeText,
|
4557 | right: largeText.replace(/jazminero/g, 'rosal'),
|
4558 | delta: ['@@ -360,25 +360,21 @@\n %C3%A9ste un \n-jazminero\n+rosal' + '\n %0Ay %C3%A9se e\n@@ -479,17 +479,13 @@\n' + ' al, \n-jazminero\n+rosal\n ).%0A%0A\n', 0, 2],
|
4559 | reverse: ['@@ -360,21 +360,25 @@\n %C3%A9ste un \n-rosal\n+jazminero\n %0Ay' + ' %C3%A9se e\n@@ -479,21 +479,25 @@\n %0Arosal,' + ' \n-rosal\n+jazminero\n ).%0A%0A-Mad\n', 0, 2],
|
4560 | exactReverse: false
|
4561 | }, {
|
4562 | name: 'larger than min length',
|
4563 | options: {
|
4564 | textDiff: {
|
4565 | minLength: 10
|
4566 | }
|
4567 | },
|
4568 | left: largeText.substr(0, 10),
|
4569 | right: largeText.substr(0, 11).replace(/Madre/g, 'Padre'),
|
4570 | delta: ['@@ -1,10 +1,11 @@\n -\n-M\n+P\n adre,%0Acu\n+a\n', 0, 2],
|
4571 | reverse: ['@@ -1,11 +1,10 @@\n -\n-P\n+M\n adre,%0Acu\n-a\n', 0, 2],
|
4572 | exactReverse: false
|
4573 | }, {
|
4574 | name: 'shorter than min length',
|
4575 | options: {
|
4576 | textDiff: {
|
4577 | minLength: 10
|
4578 | }
|
4579 | },
|
4580 | left: largeText.substr(0, 9),
|
4581 | right: largeText.substr(0, 11).replace(/Madre/g, 'Padre'),
|
4582 | delta: ['-Madre,\nc', '-Padre,\ncua'],
|
4583 | reverse: ['-Padre,\ncua', '-Madre,\nc'],
|
4584 | exactReverse: false
|
4585 | }, 0];
|
4586 |
|
4587 | examples.objects = [{
|
4588 | name: 'first level',
|
4589 | left: {
|
4590 | a: 1,
|
4591 | b: 2
|
4592 | },
|
4593 | right: {
|
4594 | a: 42,
|
4595 | b: 2
|
4596 | },
|
4597 | delta: {
|
4598 | a: [1, 42]
|
4599 | },
|
4600 | reverse: {
|
4601 | a: [42, 1]
|
4602 | }
|
4603 | }, {
|
4604 | name: 'deep level',
|
4605 | left: {
|
4606 | a: {
|
4607 | j: {
|
4608 | k: {
|
4609 | l: {
|
4610 | m: {
|
4611 | n: {
|
4612 | o: 3
|
4613 | }
|
4614 | }
|
4615 | }
|
4616 | }
|
4617 | }
|
4618 | },
|
4619 | b: 2
|
4620 | },
|
4621 | right: {
|
4622 | a: {
|
4623 | j: {
|
4624 | k: {
|
4625 | l: {
|
4626 | m: {
|
4627 | n: {
|
4628 | o: true
|
4629 | }
|
4630 | }
|
4631 | }
|
4632 | }
|
4633 | }
|
4634 | },
|
4635 | b: 2
|
4636 | },
|
4637 | delta: {
|
4638 | a: {
|
4639 | j: {
|
4640 | k: {
|
4641 | l: {
|
4642 | m: {
|
4643 | n: {
|
4644 | o: [3, true]
|
4645 | }
|
4646 | }
|
4647 | }
|
4648 | }
|
4649 | }
|
4650 | }
|
4651 | },
|
4652 | reverse: {
|
4653 | a: {
|
4654 | j: {
|
4655 | k: {
|
4656 | l: {
|
4657 | m: {
|
4658 | n: {
|
4659 | o: [true, 3]
|
4660 | }
|
4661 | }
|
4662 | }
|
4663 | }
|
4664 | }
|
4665 | }
|
4666 | }
|
4667 | }, {
|
4668 | name: 'multiple changes',
|
4669 | left: {
|
4670 | a: {
|
4671 | j: {
|
4672 | k: {
|
4673 | l: {
|
4674 | m: {
|
4675 | n: {
|
4676 | o: 3
|
4677 | }
|
4678 | }
|
4679 | }
|
4680 | }
|
4681 | }
|
4682 | },
|
4683 | b: 2,
|
4684 | c: 5
|
4685 | },
|
4686 | right: {
|
4687 | a: {
|
4688 | j: {
|
4689 | k: {
|
4690 | l: {
|
4691 | m: {
|
4692 | n: {
|
4693 | o: 5,
|
4694 | w: 12
|
4695 | }
|
4696 | }
|
4697 | }
|
4698 | }
|
4699 | }
|
4700 | },
|
4701 | b: 2
|
4702 | },
|
4703 | delta: {
|
4704 | a: {
|
4705 | j: {
|
4706 | k: {
|
4707 | l: {
|
4708 | m: {
|
4709 | n: {
|
4710 | o: [3, 5],
|
4711 | w: [12]
|
4712 | }
|
4713 | }
|
4714 | }
|
4715 | }
|
4716 | }
|
4717 | },
|
4718 | c: [5, 0, 0]
|
4719 | },
|
4720 | reverse: {
|
4721 | a: {
|
4722 | j: {
|
4723 | k: {
|
4724 | l: {
|
4725 | m: {
|
4726 | n: {
|
4727 | o: [5, 3],
|
4728 | w: [12, 0, 0]
|
4729 | }
|
4730 | }
|
4731 | }
|
4732 | }
|
4733 | }
|
4734 | },
|
4735 | c: [5]
|
4736 | }
|
4737 | }, {
|
4738 | name: 'key removed',
|
4739 | left: {
|
4740 | a: 1,
|
4741 | b: 2
|
4742 | },
|
4743 | right: {
|
4744 | a: 1
|
4745 | },
|
4746 | delta: {
|
4747 | b: [2, 0, 0]
|
4748 | },
|
4749 | reverse: {
|
4750 | b: [2]
|
4751 | }
|
4752 | }, {
|
4753 | name: 'hasOwnProperty',
|
4754 |
|
4755 | left: {
|
4756 | hasOwnProperty: true
|
4757 | },
|
4758 | right: {
|
4759 | hasOwnProperty: true
|
4760 | }
|
4761 |
|
4762 | }, 0];
|
4763 |
|
4764 | examples.arrays = [{
|
4765 | name: 'simple values',
|
4766 | left: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
4767 | right: [1, 3, 4, 5, 8, 9, 9.1, 10],
|
4768 | delta: {
|
4769 | _t: 'a',
|
4770 | _1: [2, 0, 0],
|
4771 | _5: [6, 0, 0],
|
4772 | _6: [7, 0, 0],
|
4773 | 6: [9.1]
|
4774 | },
|
4775 | reverse: {
|
4776 | _t: 'a',
|
4777 | 1: [2],
|
4778 | 5: [6],
|
4779 | 6: [7],
|
4780 | _6: [9.1, 0, 0]
|
4781 | }
|
4782 | }, {
|
4783 | name: 'added block',
|
4784 | left: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
4785 | right: [1, 2, 3, 4, 5, 5.1, 5.2, 5.3, 6, 7, 8, 9, 10],
|
4786 | delta: {
|
4787 | _t: 'a',
|
4788 | 5: [5.1],
|
4789 | 6: [5.2],
|
4790 | 7: [5.3]
|
4791 | },
|
4792 | reverse: {
|
4793 | _t: 'a',
|
4794 | _5: [5.1, 0, 0],
|
4795 | _6: [5.2, 0, 0],
|
4796 | _7: [5.3, 0, 0]
|
4797 | }
|
4798 | }, {
|
4799 | name: 'movements',
|
4800 | left: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
4801 | right: [1, 2, 3, 7, 5, 6, 8, 9, 4, 10],
|
4802 | delta: {
|
4803 | _t: 'a',
|
4804 | _3: ['', 8, 3],
|
4805 | _6: ['', 3, 3]
|
4806 | },
|
4807 | reverse: {
|
4808 | _t: 'a',
|
4809 | _3: ['', 6, 3],
|
4810 | _8: ['', 3, 3]
|
4811 | }
|
4812 | }, {
|
4813 | name: 'movements(2)',
|
4814 | left: [1, 2, 3, 4],
|
4815 | right: [2, 4, 1, 3],
|
4816 | delta: {
|
4817 | _t: 'a',
|
4818 | _1: ['', 0, 3],
|
4819 | _3: ['', 1, 3]
|
4820 | },
|
4821 | reverse: {
|
4822 | _t: 'a',
|
4823 | _2: ['', 0, 3],
|
4824 | _3: ['', 2, 3]
|
4825 | },
|
4826 | exactReverse: false
|
4827 | }, {
|
4828 | name: 'nested',
|
4829 | options: {
|
4830 | objectHash: function objectHash(obj) {
|
4831 | if (obj && obj.id) {
|
4832 | return obj.id;
|
4833 | }
|
4834 | }
|
4835 | },
|
4836 | left: [1, 2, {
|
4837 | id: 4,
|
4838 | width: 10
|
4839 | }, 4, {
|
4840 | id: 'five',
|
4841 | width: 4
|
4842 | }, 6, 7, 8, 9, 10],
|
4843 | right: [1, 2, {
|
4844 | id: 4,
|
4845 | width: 12
|
4846 | }, 4, {
|
4847 | id: 'five',
|
4848 | width: 4
|
4849 | }, 6, 7, 8, 9, 10],
|
4850 | delta: {
|
4851 | _t: 'a',
|
4852 | 2: {
|
4853 | width: [10, 12]
|
4854 | }
|
4855 | },
|
4856 | reverse: {
|
4857 | _t: 'a',
|
4858 | 2: {
|
4859 | width: [12, 10]
|
4860 | }
|
4861 | }
|
4862 | }, {
|
4863 | name: 'nested with movement',
|
4864 | options: {
|
4865 | objectHash: function objectHash(obj) {
|
4866 | if (obj && obj.id) {
|
4867 | return obj.id;
|
4868 | }
|
4869 | }
|
4870 | },
|
4871 | left: [1, 2, 4, {
|
4872 | id: 'five',
|
4873 | width: 4
|
4874 | }, 6, 7, 8, {
|
4875 | id: 4,
|
4876 | width: 10,
|
4877 | height: 3
|
4878 | }, 9, 10],
|
4879 | right: [1, 2, {
|
4880 | id: 4,
|
4881 | width: 12
|
4882 | }, 4, {
|
4883 | id: 'five',
|
4884 | width: 4
|
4885 | }, 6, 7, 8, 9, 10],
|
4886 | delta: {
|
4887 | _t: 'a',
|
4888 | 2: {
|
4889 | width: [10, 12],
|
4890 | height: [3, 0, 0]
|
4891 | },
|
4892 | _7: ['', 2, 3]
|
4893 | },
|
4894 | reverse: {
|
4895 | _t: 'a',
|
4896 | 7: {
|
4897 | width: [12, 10],
|
4898 | height: [3]
|
4899 | },
|
4900 | _2: ['', 7, 3]
|
4901 | }
|
4902 | }, {
|
4903 | name: 'nested changes among array insertions and deletions',
|
4904 | options: {
|
4905 | objectHash: function objectHash(obj) {
|
4906 | if (obj && obj.id) {
|
4907 | return obj.id;
|
4908 | }
|
4909 | }
|
4910 | },
|
4911 | left: [{
|
4912 | id: 1
|
4913 | }, {
|
4914 | id: 2
|
4915 | }, {
|
4916 | id: 4
|
4917 | }, {
|
4918 | id: 5
|
4919 | }, {
|
4920 | id: 6,
|
4921 | inner: {
|
4922 | property: 'abc'
|
4923 | }
|
4924 | }, {
|
4925 | id: 7
|
4926 | }, {
|
4927 | id: 8
|
4928 | }, {
|
4929 | id: 10
|
4930 | }, {
|
4931 | id: 11
|
4932 | }, {
|
4933 | id: 12
|
4934 | }],
|
4935 | right: [{
|
4936 | id: 3
|
4937 | }, {
|
4938 | id: 4
|
4939 | }, {
|
4940 | id: 6,
|
4941 | inner: {
|
4942 | property: 'abcd'
|
4943 | }
|
4944 | }, {
|
4945 | id: 9
|
4946 | }],
|
4947 | delta: {
|
4948 | _t: 'a',
|
4949 | 0: [{ id: 3 }],
|
4950 | 2: {
|
4951 | inner: {
|
4952 | property: ['abc', 'abcd']
|
4953 | }
|
4954 | },
|
4955 | 3: [{ id: 9 }],
|
4956 | _0: [{ id: 1 }, 0, 0],
|
4957 | _1: [{ id: 2 }, 0, 0],
|
4958 | _3: [{ id: 5 }, 0, 0],
|
4959 | _5: [{ id: 7 }, 0, 0],
|
4960 | _6: [{ id: 8 }, 0, 0],
|
4961 | _7: [{ id: 10 }, 0, 0],
|
4962 | _8: [{ id: 11 }, 0, 0],
|
4963 | _9: [{ id: 12 }, 0, 0]
|
4964 | },
|
4965 | reverse: {
|
4966 | _t: 'a',
|
4967 | 0: [{ id: 1 }],
|
4968 | 1: [{ id: 2 }],
|
4969 | 3: [{ id: 5 }],
|
4970 | 4: {
|
4971 | inner: {
|
4972 | property: ['abcd', 'abc']
|
4973 | }
|
4974 | },
|
4975 | 5: [{ id: 7 }],
|
4976 | 6: [{ id: 8 }],
|
4977 | 7: [{ id: 10 }],
|
4978 | 8: [{ id: 11 }],
|
4979 | 9: [{ id: 12 }],
|
4980 | _0: [{ id: 3 }, 0, 0],
|
4981 | _3: [{ id: 9 }, 0, 0]
|
4982 | }
|
4983 | }, {
|
4984 | name: 'nested change with item moved above',
|
4985 | options: {
|
4986 | objectHash: function objectHash(obj) {
|
4987 | if (obj && obj.id) {
|
4988 | return obj.id;
|
4989 | }
|
4990 | }
|
4991 | },
|
4992 | left: [{
|
4993 | id: 1
|
4994 | }, {
|
4995 | id: 2
|
4996 | }, {
|
4997 | id: 3,
|
4998 | inner: {
|
4999 | property: 'abc'
|
5000 | }
|
5001 | }, {
|
5002 | id: 4
|
5003 | }, {
|
5004 | id: 5
|
5005 | }, {
|
5006 | id: 6
|
5007 | }],
|
5008 | right: [{
|
5009 | id: 1
|
5010 | }, {
|
5011 | id: 2
|
5012 | }, {
|
5013 | id: 6
|
5014 | }, {
|
5015 | id: 3,
|
5016 | inner: {
|
5017 | property: 'abcd'
|
5018 | }
|
5019 | }, {
|
5020 | id: 4
|
5021 | }, {
|
5022 | id: 5
|
5023 | }],
|
5024 | delta: {
|
5025 | _t: 'a',
|
5026 | 3: {
|
5027 | inner: {
|
5028 | property: ['abc', 'abcd']
|
5029 | }
|
5030 | },
|
5031 | _5: ['', 2, 3]
|
5032 | },
|
5033 | reverse: {
|
5034 | _t: 'a',
|
5035 | 2: {
|
5036 | inner: {
|
5037 | property: ['abcd', 'abc']
|
5038 | }
|
5039 | },
|
5040 | _2: ['', 5, 3]
|
5041 | }
|
5042 | }, {
|
5043 | name: 'nested change with item moved right above',
|
5044 | options: {
|
5045 | objectHash: function objectHash(obj) {
|
5046 | if (obj && obj.id) {
|
5047 | return obj.id;
|
5048 | }
|
5049 | }
|
5050 | },
|
5051 | left: [{
|
5052 | id: 1
|
5053 | }, {
|
5054 | id: 2,
|
5055 | inner: {
|
5056 | property: 'abc'
|
5057 | }
|
5058 | }, {
|
5059 | id: 3
|
5060 | }],
|
5061 | right: [{
|
5062 | id: 1
|
5063 | }, {
|
5064 | id: 3
|
5065 | }, {
|
5066 | id: 2,
|
5067 | inner: {
|
5068 | property: 'abcd'
|
5069 | }
|
5070 | }],
|
5071 | delta: {
|
5072 | _t: 'a',
|
5073 | 2: {
|
5074 | inner: {
|
5075 | property: ['abc', 'abcd']
|
5076 | }
|
5077 | },
|
5078 | _2: ['', 1, 3]
|
5079 | },
|
5080 | reverse: {
|
5081 | _t: 'a',
|
5082 | 1: {
|
5083 | inner: {
|
5084 | property: ['abcd', 'abc']
|
5085 | }
|
5086 | },
|
5087 | _2: ['', 1, 3]
|
5088 | },
|
5089 | exactReverse: false
|
5090 | }, {
|
5091 | name: 'nested change with item moved right below',
|
5092 | options: {
|
5093 | objectHash: function objectHash(obj) {
|
5094 | if (obj && obj.id) {
|
5095 | return obj.id;
|
5096 | }
|
5097 | }
|
5098 | },
|
5099 | left: [{
|
5100 | id: 1
|
5101 | }, {
|
5102 | id: 2
|
5103 | }, {
|
5104 | id: 3,
|
5105 | inner: {
|
5106 | property: 'abc'
|
5107 | }
|
5108 | }, {
|
5109 | id: 4
|
5110 | }],
|
5111 | right: [{
|
5112 | id: 2
|
5113 | }, {
|
5114 | id: 3,
|
5115 | inner: {
|
5116 | property: 'abcd'
|
5117 | }
|
5118 | }, {
|
5119 | id: 1
|
5120 | }, {
|
5121 | id: 4
|
5122 | }],
|
5123 | delta: {
|
5124 | _t: 'a',
|
5125 | 1: {
|
5126 | inner: {
|
5127 | property: ['abc', 'abcd']
|
5128 | }
|
5129 | },
|
5130 | _0: ['', 2, 3]
|
5131 | },
|
5132 | reverse: {
|
5133 | _t: 'a',
|
5134 | 2: {
|
5135 | inner: {
|
5136 | property: ['abcd', 'abc']
|
5137 | }
|
5138 | },
|
5139 | _2: ['', 0, 3]
|
5140 | }
|
5141 | }, {
|
5142 | name: 'nested with movements using custom objectHash',
|
5143 | options: {
|
5144 | objectHash: function objectHash(obj) {
|
5145 | if (obj && obj.itemKey) {
|
5146 | return obj.itemKey;
|
5147 | }
|
5148 | }
|
5149 | },
|
5150 | left: [1, 2, 4, {
|
5151 | itemKey: 'five',
|
5152 | width: 4
|
5153 | }, 6, 7, 8, {
|
5154 | itemKey: 4,
|
5155 | width: 10,
|
5156 | height: 3
|
5157 | }, 9, 10],
|
5158 | right: [1, 2, {
|
5159 | itemKey: 4,
|
5160 | width: 12
|
5161 | }, 4, {
|
5162 | itemKey: 'five',
|
5163 | width: 4
|
5164 | }, 6, 7, 8, 9, 10],
|
5165 | delta: {
|
5166 | _t: 'a',
|
5167 | 2: {
|
5168 | width: [10, 12],
|
5169 | height: [3, 0, 0]
|
5170 | },
|
5171 | _7: ['', 2, 3]
|
5172 | },
|
5173 | reverse: {
|
5174 | _t: 'a',
|
5175 | 7: {
|
5176 | width: [12, 10],
|
5177 | height: [3]
|
5178 | },
|
5179 | _2: ['', 7, 3]
|
5180 | }
|
5181 | }, {
|
5182 | name: 'using property filter',
|
5183 | options: {
|
5184 | propertyFilter: function propertyFilter(name /*, context */) {
|
5185 | return name.slice(0, 1) !== '$';
|
5186 | }
|
5187 | },
|
5188 | left: {
|
5189 | inner: {
|
5190 | $volatileData: 345,
|
5191 | $oldVolatileData: 422,
|
5192 | nonVolatile: 432
|
5193 | }
|
5194 | },
|
5195 | right: {
|
5196 | inner: {
|
5197 | $volatileData: 346,
|
5198 | $newVolatileData: 32,
|
5199 | nonVolatile: 431
|
5200 | }
|
5201 | },
|
5202 | delta: {
|
5203 | inner: {
|
5204 | nonVolatile: [432, 431]
|
5205 | }
|
5206 | },
|
5207 | reverse: {
|
5208 | inner: {
|
5209 | nonVolatile: [431, 432]
|
5210 | }
|
5211 | },
|
5212 | noPatch: true
|
5213 | }, 0];
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 | function exclude () {
|
5231 | var excludes = [].slice.call(arguments);
|
5232 |
|
5233 | function excludeProps (res, obj) {
|
5234 | Object.keys(obj).forEach(function (key) {
|
5235 | if (!~excludes.indexOf(key)) res[key] = obj[key];
|
5236 | });
|
5237 | }
|
5238 |
|
5239 | return function extendExclude () {
|
5240 | var args = [].slice.call(arguments)
|
5241 | , i = 0
|
5242 | , res = {};
|
5243 |
|
5244 | for (; i < args.length; i++) {
|
5245 | excludeProps(res, args[i]);
|
5246 | }
|
5247 |
|
5248 | return res;
|
5249 | };
|
5250 | }
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 |
|
5256 | var assertionError = AssertionError;
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 | function AssertionError (message, _props, ssf) {
|
5270 | var extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON')
|
5271 | , props = extend(_props || {});
|
5272 |
|
5273 |
|
5274 | this.message = message || 'Unspecified AssertionError';
|
5275 | this.showDiff = false;
|
5276 |
|
5277 |
|
5278 | for (var key in props) {
|
5279 | this[key] = props[key];
|
5280 | }
|
5281 |
|
5282 |
|
5283 | ssf = ssf || AssertionError;
|
5284 | if (Error.captureStackTrace) {
|
5285 | Error.captureStackTrace(this, ssf);
|
5286 | } else {
|
5287 | try {
|
5288 | throw new Error();
|
5289 | } catch(e) {
|
5290 | this.stack = e.stack;
|
5291 | }
|
5292 | }
|
5293 | }
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 | AssertionError.prototype = Object.create(Error.prototype);
|
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 |
|
5305 | AssertionError.prototype.name = 'AssertionError';
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 | AssertionError.prototype.constructor = AssertionError;
|
5312 |
|
5313 |
|
5314 |
|
5315 |
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 | AssertionError.prototype.toJSON = function (stack) {
|
5321 | var extend = exclude('constructor', 'toJSON', 'stack')
|
5322 | , props = extend({ name: this.name }, this);
|
5323 |
|
5324 |
|
5325 | if (false !== stack && this.stack) {
|
5326 | props.stack = this.stack;
|
5327 | }
|
5328 |
|
5329 | return props;
|
5330 | };
|
5331 |
|
5332 |
|
5333 |
|
5334 |
|
5335 |
|
5336 |
|
5337 |
|
5338 |
|
5339 |
|
5340 |
|
5341 |
|
5342 |
|
5343 |
|
5344 |
|
5345 |
|
5346 |
|
5347 |
|
5348 |
|
5349 |
|
5350 |
|
5351 |
|
5352 |
|
5353 |
|
5354 |
|
5355 |
|
5356 |
|
5357 |
|
5358 |
|
5359 |
|
5360 |
|
5361 |
|
5362 |
|
5363 |
|
5364 |
|
5365 |
|
5366 |
|
5367 |
|
5368 |
|
5369 |
|
5370 |
|
5371 |
|
5372 |
|
5373 |
|
5374 |
|
5375 |
|
5376 | function hasProperty(obj, name) {
|
5377 | if (typeof obj === 'undefined' || obj === null) {
|
5378 | return false;
|
5379 | }
|
5380 |
|
5381 |
|
5382 | return name in Object(obj);
|
5383 | }
|
5384 |
|
5385 |
|
5386 |
|
5387 |
|
5388 |
|
5389 |
|
5390 |
|
5391 |
|
5392 |
|
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 |
|
5398 |
|
5399 |
|
5400 |
|
5401 |
|
5402 |
|
5403 |
|
5404 | function parsePath(path) {
|
5405 | var str = path.replace(/([^\\])\[/g, '$1.[');
|
5406 | var parts = str.match(/(\\\.|[^.]+?)+/g);
|
5407 | return parts.map(function mapMatches(value) {
|
5408 | var regexp = /^\[(\d+)\]$/;
|
5409 | var mArr = regexp.exec(value);
|
5410 | var parsed = null;
|
5411 | if (mArr) {
|
5412 | parsed = { i: parseFloat(mArr[1]) };
|
5413 | } else {
|
5414 | parsed = { p: value.replace(/\\([.\[\]])/g, '$1') };
|
5415 | }
|
5416 |
|
5417 | return parsed;
|
5418 | });
|
5419 | }
|
5420 |
|
5421 |
|
5422 |
|
5423 |
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 |
|
5433 |
|
5434 |
|
5435 |
|
5436 | function internalGetPathValue(obj, parsed, pathDepth) {
|
5437 | var temporaryValue = obj;
|
5438 | var res = null;
|
5439 | pathDepth = (typeof pathDepth === 'undefined' ? parsed.length : pathDepth);
|
5440 |
|
5441 | for (var i = 0; i < pathDepth; i++) {
|
5442 | var part = parsed[i];
|
5443 | if (temporaryValue) {
|
5444 | if (typeof part.p === 'undefined') {
|
5445 | temporaryValue = temporaryValue[part.i];
|
5446 | } else {
|
5447 | temporaryValue = temporaryValue[part.p];
|
5448 | }
|
5449 |
|
5450 | if (i === (pathDepth - 1)) {
|
5451 | res = temporaryValue;
|
5452 | }
|
5453 | }
|
5454 | }
|
5455 |
|
5456 | return res;
|
5457 | }
|
5458 |
|
5459 |
|
5460 |
|
5461 |
|
5462 |
|
5463 |
|
5464 |
|
5465 |
|
5466 |
|
5467 |
|
5468 |
|
5469 |
|
5470 |
|
5471 |
|
5472 |
|
5473 | function internalSetPathValue(obj, val, parsed) {
|
5474 | var tempObj = obj;
|
5475 | var pathDepth = parsed.length;
|
5476 | var part = null;
|
5477 |
|
5478 | for (var i = 0; i < pathDepth; i++) {
|
5479 | var propName = null;
|
5480 | var propVal = null;
|
5481 | part = parsed[i];
|
5482 |
|
5483 |
|
5484 | if (i === (pathDepth - 1)) {
|
5485 | propName = typeof part.p === 'undefined' ? part.i : part.p;
|
5486 |
|
5487 | tempObj[propName] = val;
|
5488 | } else if (typeof part.p !== 'undefined' && tempObj[part.p]) {
|
5489 | tempObj = tempObj[part.p];
|
5490 | } else if (typeof part.i !== 'undefined' && tempObj[part.i]) {
|
5491 | tempObj = tempObj[part.i];
|
5492 | } else {
|
5493 |
|
5494 | var next = parsed[i + 1];
|
5495 |
|
5496 | propName = typeof part.p === 'undefined' ? part.i : part.p;
|
5497 |
|
5498 | propVal = typeof next.p === 'undefined' ? [] : {};
|
5499 | tempObj[propName] = propVal;
|
5500 | tempObj = tempObj[propName];
|
5501 | }
|
5502 | }
|
5503 | }
|
5504 |
|
5505 |
|
5506 |
|
5507 |
|
5508 |
|
5509 |
|
5510 |
|
5511 |
|
5512 |
|
5513 |
|
5514 |
|
5515 |
|
5516 |
|
5517 |
|
5518 |
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 |
|
5524 |
|
5525 |
|
5526 |
|
5527 | function getPathInfo(obj, path) {
|
5528 | var parsed = parsePath(path);
|
5529 | var last = parsed[parsed.length - 1];
|
5530 | var info = {
|
5531 | parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj,
|
5532 | name: last.p || last.i,
|
5533 | value: internalGetPathValue(obj, parsed),
|
5534 | };
|
5535 | info.exists = hasProperty(info.parent, info.name);
|
5536 |
|
5537 | return info;
|
5538 | }
|
5539 |
|
5540 |
|
5541 |
|
5542 |
|
5543 |
|
5544 |
|
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 |
|
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 |
|
5568 |
|
5569 |
|
5570 |
|
5571 | function getPathValue(obj, path) {
|
5572 | var info = getPathInfo(obj, path);
|
5573 | return info.value;
|
5574 | }
|
5575 |
|
5576 |
|
5577 |
|
5578 |
|
5579 |
|
5580 |
|
5581 |
|
5582 |
|
5583 |
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 |
|
5594 |
|
5595 |
|
5596 |
|
5597 |
|
5598 |
|
5599 |
|
5600 |
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 |
|
5607 |
|
5608 |
|
5609 | function setPathValue(obj, path, val) {
|
5610 | var parsed = parsePath(path);
|
5611 | internalSetPathValue(obj, val, parsed);
|
5612 | return obj;
|
5613 | }
|
5614 |
|
5615 | var pathval = {
|
5616 | hasProperty: hasProperty,
|
5617 | getPathInfo: getPathInfo,
|
5618 | getPathValue: getPathValue,
|
5619 | setPathValue: setPathValue,
|
5620 | };
|
5621 |
|
5622 |
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 |
|
5630 |
|
5631 |
|
5632 |
|
5633 |
|
5634 |
|
5635 |
|
5636 |
|
5637 |
|
5638 |
|
5639 |
|
5640 |
|
5641 |
|
5642 |
|
5643 |
|
5644 |
|
5645 |
|
5646 |
|
5647 | var flag = function flag(obj, key, value) {
|
5648 | var flags = obj.__flags || (obj.__flags = Object.create(null));
|
5649 | if (arguments.length === 3) {
|
5650 | flags[key] = value;
|
5651 | } else {
|
5652 | return flags[key];
|
5653 | }
|
5654 | };
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 |
|
5664 |
|
5665 |
|
5666 |
|
5667 |
|
5668 |
|
5669 |
|
5670 |
|
5671 |
|
5672 |
|
5673 |
|
5674 |
|
5675 |
|
5676 |
|
5677 |
|
5678 |
|
5679 | var test = function test(obj, args) {
|
5680 | var negate = flag(obj, 'negate')
|
5681 | , expr = args[0];
|
5682 | return negate ? !expr : expr;
|
5683 | };
|
5684 |
|
5685 | var typeDetect = createCommonjsModule(function (module, exports) {
|
5686 | (function (global, factory) {
|
5687 | module.exports = factory();
|
5688 | }(commonjsGlobal, (function () { var promiseExists = typeof Promise === 'function';
|
5689 |
|
5690 |
|
5691 | var globalObject = typeof self === 'object' ? self : commonjsGlobal;
|
5692 |
|
5693 | var symbolExists = typeof Symbol !== 'undefined';
|
5694 | var mapExists = typeof Map !== 'undefined';
|
5695 | var setExists = typeof Set !== 'undefined';
|
5696 | var weakMapExists = typeof WeakMap !== 'undefined';
|
5697 | var weakSetExists = typeof WeakSet !== 'undefined';
|
5698 | var dataViewExists = typeof DataView !== 'undefined';
|
5699 | var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined';
|
5700 | var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined';
|
5701 | var setEntriesExists = setExists && typeof Set.prototype.entries === 'function';
|
5702 | var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function';
|
5703 | var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries());
|
5704 | var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries());
|
5705 | var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function';
|
5706 | var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
|
5707 | var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function';
|
5708 | var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]());
|
5709 | var toStringLeftSliceLength = 8;
|
5710 | var toStringRightSliceLength = -1;
|
5711 |
|
5712 |
|
5713 |
|
5714 |
|
5715 |
|
5716 |
|
5717 |
|
5718 |
|
5719 |
|
5720 |
|
5721 | function typeDetect(obj) {
|
5722 | |
5723 |
|
5724 |
|
5725 |
|
5726 |
|
5727 |
|
5728 |
|
5729 |
|
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 |
|
5735 |
|
5736 | var typeofObj = typeof obj;
|
5737 | if (typeofObj !== 'object') {
|
5738 | return typeofObj;
|
5739 | }
|
5740 |
|
5741 | |
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 | if (obj === null) {
|
5748 | return 'null';
|
5749 | }
|
5750 |
|
5751 | |
5752 |
|
5753 |
|
5754 |
|
5755 |
|
5756 |
|
5757 |
|
5758 |
|
5759 |
|
5760 |
|
5761 |
|
5762 |
|
5763 |
|
5764 |
|
5765 |
|
5766 |
|
5767 | if (obj === globalObject) {
|
5768 | return 'global';
|
5769 | }
|
5770 |
|
5771 | |
5772 |
|
5773 |
|
5774 |
|
5775 |
|
5776 |
|
5777 | if (
|
5778 | Array.isArray(obj) &&
|
5779 | (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))
|
5780 | ) {
|
5781 | return 'Array';
|
5782 | }
|
5783 |
|
5784 |
|
5785 |
|
5786 | if (typeof window === 'object') {
|
5787 | |
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 |
|
5793 |
|
5794 | if (typeof window.location === 'object' && obj === window.location) {
|
5795 | return 'Location';
|
5796 | }
|
5797 |
|
5798 | |
5799 |
|
5800 |
|
5801 |
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 |
|
5813 |
|
5814 |
|
5815 |
|
5816 |
|
5817 | if (typeof window.document === 'object' && obj === window.document) {
|
5818 | return 'Document';
|
5819 | }
|
5820 |
|
5821 | if (typeof window.navigator === 'object') {
|
5822 | |
5823 |
|
5824 |
|
5825 |
|
5826 |
|
5827 |
|
5828 | if (typeof window.navigator.mimeTypes === 'object' &&
|
5829 | obj === window.navigator.mimeTypes) {
|
5830 | return 'MimeTypeArray';
|
5831 | }
|
5832 |
|
5833 | |
5834 |
|
5835 |
|
5836 |
|
5837 |
|
5838 |
|
5839 | if (typeof window.navigator.plugins === 'object' &&
|
5840 | obj === window.navigator.plugins) {
|
5841 | return 'PluginArray';
|
5842 | }
|
5843 | }
|
5844 |
|
5845 | if ((typeof window.HTMLElement === 'function' ||
|
5846 | typeof window.HTMLElement === 'object') &&
|
5847 | obj instanceof window.HTMLElement) {
|
5848 | |
5849 |
|
5850 |
|
5851 |
|
5852 |
|
5853 |
|
5854 | if (obj.tagName === 'BLOCKQUOTE') {
|
5855 | return 'HTMLQuoteElement';
|
5856 | }
|
5857 |
|
5858 | |
5859 |
|
5860 |
|
5861 |
|
5862 |
|
5863 |
|
5864 |
|
5865 |
|
5866 |
|
5867 |
|
5868 |
|
5869 |
|
5870 | if (obj.tagName === 'TD') {
|
5871 | return 'HTMLTableDataCellElement';
|
5872 | }
|
5873 |
|
5874 | |
5875 |
|
5876 |
|
5877 |
|
5878 |
|
5879 |
|
5880 |
|
5881 |
|
5882 |
|
5883 |
|
5884 |
|
5885 |
|
5886 | if (obj.tagName === 'TH') {
|
5887 | return 'HTMLTableHeaderCellElement';
|
5888 | }
|
5889 | }
|
5890 | }
|
5891 |
|
5892 | |
5893 |
|
5894 |
|
5895 |
|
5896 |
|
5897 |
|
5898 |
|
5899 |
|
5900 |
|
5901 |
|
5902 |
|
5903 |
|
5904 |
|
5905 |
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 |
|
5912 |
|
5913 |
|
5914 | var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]);
|
5915 | if (typeof stringTag === 'string') {
|
5916 | return stringTag;
|
5917 | }
|
5918 |
|
5919 | var objPrototype = Object.getPrototypeOf(obj);
|
5920 | |
5921 |
|
5922 |
|
5923 |
|
5924 |
|
5925 |
|
5926 |
|
5927 |
|
5928 | if (objPrototype === RegExp.prototype) {
|
5929 | return 'RegExp';
|
5930 | }
|
5931 |
|
5932 | |
5933 |
|
5934 |
|
5935 |
|
5936 |
|
5937 |
|
5938 | if (objPrototype === Date.prototype) {
|
5939 | return 'Date';
|
5940 | }
|
5941 |
|
5942 | |
5943 |
|
5944 |
|
5945 |
|
5946 |
|
5947 |
|
5948 |
|
5949 |
|
5950 |
|
5951 | if (promiseExists && objPrototype === Promise.prototype) {
|
5952 | return 'Promise';
|
5953 | }
|
5954 |
|
5955 | |
5956 |
|
5957 |
|
5958 |
|
5959 |
|
5960 |
|
5961 | if (setExists && objPrototype === Set.prototype) {
|
5962 | return 'Set';
|
5963 | }
|
5964 |
|
5965 | |
5966 |
|
5967 |
|
5968 |
|
5969 |
|
5970 |
|
5971 | if (mapExists && objPrototype === Map.prototype) {
|
5972 | return 'Map';
|
5973 | }
|
5974 |
|
5975 | |
5976 |
|
5977 |
|
5978 |
|
5979 |
|
5980 |
|
5981 | if (weakSetExists && objPrototype === WeakSet.prototype) {
|
5982 | return 'WeakSet';
|
5983 | }
|
5984 |
|
5985 | |
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 | if (weakMapExists && objPrototype === WeakMap.prototype) {
|
5992 | return 'WeakMap';
|
5993 | }
|
5994 |
|
5995 | |
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 | if (dataViewExists && objPrototype === DataView.prototype) {
|
6002 | return 'DataView';
|
6003 | }
|
6004 |
|
6005 | |
6006 |
|
6007 |
|
6008 |
|
6009 |
|
6010 |
|
6011 | if (mapExists && objPrototype === mapIteratorPrototype) {
|
6012 | return 'Map Iterator';
|
6013 | }
|
6014 |
|
6015 | |
6016 |
|
6017 |
|
6018 |
|
6019 |
|
6020 |
|
6021 | if (setExists && objPrototype === setIteratorPrototype) {
|
6022 | return 'Set Iterator';
|
6023 | }
|
6024 |
|
6025 | |
6026 |
|
6027 |
|
6028 |
|
6029 |
|
6030 |
|
6031 | if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
|
6032 | return 'Array Iterator';
|
6033 | }
|
6034 |
|
6035 | |
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 | if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
|
6042 | return 'String Iterator';
|
6043 | }
|
6044 |
|
6045 | |
6046 |
|
6047 |
|
6048 |
|
6049 |
|
6050 |
|
6051 | if (objPrototype === null) {
|
6052 | return 'Object';
|
6053 | }
|
6054 |
|
6055 | return Object
|
6056 | .prototype
|
6057 | .toString
|
6058 | .call(obj)
|
6059 | .slice(toStringLeftSliceLength, toStringRightSliceLength);
|
6060 | }
|
6061 |
|
6062 | return typeDetect;
|
6063 |
|
6064 | })));
|
6065 | });
|
6066 |
|
6067 |
|
6068 |
|
6069 |
|
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 |
|
6077 |
|
6078 |
|
6079 |
|
6080 |
|
6081 |
|
6082 |
|
6083 |
|
6084 |
|
6085 |
|
6086 |
|
6087 |
|
6088 |
|
6089 |
|
6090 |
|
6091 | var expectTypes = function expectTypes(obj, types) {
|
6092 | var flagMsg = flag(obj, 'message');
|
6093 | var ssfi = flag(obj, 'ssfi');
|
6094 |
|
6095 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
6096 |
|
6097 | obj = flag(obj, 'object');
|
6098 | types = types.map(function (t) { return t.toLowerCase(); });
|
6099 | types.sort();
|
6100 |
|
6101 |
|
6102 | var str = types.map(function (t, index) {
|
6103 | var art = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(t.charAt(0)) ? 'an' : 'a';
|
6104 | var or = types.length > 1 && index === types.length - 1 ? 'or ' : '';
|
6105 | return or + art + ' ' + t;
|
6106 | }).join(', ');
|
6107 |
|
6108 | var objType = typeDetect(obj).toLowerCase();
|
6109 |
|
6110 | if (!types.some(function (expected) { return objType === expected; })) {
|
6111 | throw new assertionError(
|
6112 | flagMsg + 'object tested must be ' + str + ', but ' + objType + ' given',
|
6113 | undefined,
|
6114 | ssfi
|
6115 | );
|
6116 | }
|
6117 | };
|
6118 |
|
6119 |
|
6120 |
|
6121 |
|
6122 |
|
6123 |
|
6124 |
|
6125 |
|
6126 |
|
6127 |
|
6128 |
|
6129 |
|
6130 |
|
6131 |
|
6132 |
|
6133 |
|
6134 |
|
6135 |
|
6136 | var getActual = function getActual(obj, args) {
|
6137 | return args.length > 4 ? args[4] : obj._obj;
|
6138 | };
|
6139 |
|
6140 |
|
6141 |
|
6142 |
|
6143 |
|
6144 |
|
6145 |
|
6146 |
|
6147 |
|
6148 |
|
6149 |
|
6150 |
|
6151 |
|
6152 |
|
6153 |
|
6154 |
|
6155 |
|
6156 |
|
6157 |
|
6158 |
|
6159 | var toString = Function.prototype.toString;
|
6160 | var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;
|
6161 | function getFuncName(aFunc) {
|
6162 | if (typeof aFunc !== 'function') {
|
6163 | return null;
|
6164 | }
|
6165 |
|
6166 | var name = '';
|
6167 | if (typeof Function.prototype.name === 'undefined' && typeof aFunc.name === 'undefined') {
|
6168 |
|
6169 | var match = toString.call(aFunc).match(functionNameMatch);
|
6170 | if (match) {
|
6171 | name = match[1];
|
6172 | }
|
6173 | } else {
|
6174 |
|
6175 | name = aFunc.name;
|
6176 | }
|
6177 |
|
6178 | return name;
|
6179 | }
|
6180 |
|
6181 | var getFuncName_1 = getFuncName;
|
6182 |
|
6183 |
|
6184 |
|
6185 |
|
6186 |
|
6187 |
|
6188 |
|
6189 |
|
6190 |
|
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 |
|
6197 |
|
6198 |
|
6199 |
|
6200 |
|
6201 |
|
6202 | var getProperties = function getProperties(object) {
|
6203 | var result = Object.getOwnPropertyNames(object);
|
6204 |
|
6205 | function addProperty(property) {
|
6206 | if (result.indexOf(property) === -1) {
|
6207 | result.push(property);
|
6208 | }
|
6209 | }
|
6210 |
|
6211 | var proto = Object.getPrototypeOf(object);
|
6212 | while (proto !== null) {
|
6213 | Object.getOwnPropertyNames(proto).forEach(addProperty);
|
6214 | proto = Object.getPrototypeOf(proto);
|
6215 | }
|
6216 |
|
6217 | return result;
|
6218 | };
|
6219 |
|
6220 |
|
6221 |
|
6222 |
|
6223 |
|
6224 |
|
6225 |
|
6226 |
|
6227 |
|
6228 |
|
6229 |
|
6230 |
|
6231 |
|
6232 |
|
6233 |
|
6234 |
|
6235 |
|
6236 |
|
6237 |
|
6238 |
|
6239 | var getEnumerableProperties = function getEnumerableProperties(object) {
|
6240 | var result = [];
|
6241 | for (var name in object) {
|
6242 | result.push(name);
|
6243 | }
|
6244 | return result;
|
6245 | };
|
6246 |
|
6247 | var config = {
|
6248 |
|
6249 | |
6250 |
|
6251 |
|
6252 |
|
6253 |
|
6254 |
|
6255 |
|
6256 |
|
6257 |
|
6258 |
|
6259 |
|
6260 |
|
6261 |
|
6262 | includeStack: false,
|
6263 |
|
6264 | |
6265 |
|
6266 |
|
6267 |
|
6268 |
|
6269 |
|
6270 |
|
6271 |
|
6272 |
|
6273 |
|
6274 |
|
6275 |
|
6276 |
|
6277 | showDiff: true,
|
6278 |
|
6279 | |
6280 |
|
6281 |
|
6282 |
|
6283 |
|
6284 |
|
6285 |
|
6286 |
|
6287 |
|
6288 |
|
6289 |
|
6290 |
|
6291 |
|
6292 |
|
6293 |
|
6294 |
|
6295 |
|
6296 |
|
6297 |
|
6298 |
|
6299 | truncateThreshold: 40,
|
6300 |
|
6301 | |
6302 |
|
6303 |
|
6304 |
|
6305 |
|
6306 |
|
6307 |
|
6308 |
|
6309 |
|
6310 |
|
6311 |
|
6312 |
|
6313 |
|
6314 |
|
6315 |
|
6316 |
|
6317 |
|
6318 |
|
6319 | useProxy: true,
|
6320 |
|
6321 | |
6322 |
|
6323 |
|
6324 |
|
6325 |
|
6326 |
|
6327 |
|
6328 |
|
6329 |
|
6330 |
|
6331 |
|
6332 |
|
6333 |
|
6334 |
|
6335 |
|
6336 |
|
6337 |
|
6338 |
|
6339 | proxyExcludedKeys: ['then', 'inspect', 'toJSON']
|
6340 | };
|
6341 |
|
6342 | var inspect_1 = createCommonjsModule(function (module, exports) {
|
6343 |
|
6344 |
|
6345 |
|
6346 |
|
6347 |
|
6348 |
|
6349 |
|
6350 |
|
6351 | module.exports = inspect;
|
6352 |
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 |
|
6358 |
|
6359 |
|
6360 |
|
6361 |
|
6362 |
|
6363 |
|
6364 |
|
6365 |
|
6366 |
|
6367 |
|
6368 | function inspect(obj, showHidden, depth, colors) {
|
6369 | var ctx = {
|
6370 | showHidden: showHidden,
|
6371 | seen: [],
|
6372 | stylize: function (str) { return str; }
|
6373 | };
|
6374 | return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
|
6375 | }
|
6376 |
|
6377 |
|
6378 | var isDOMElement = function (object) {
|
6379 | if (typeof HTMLElement === 'object') {
|
6380 | return object instanceof HTMLElement;
|
6381 | } else {
|
6382 | return object &&
|
6383 | typeof object === 'object' &&
|
6384 | 'nodeType' in object &&
|
6385 | object.nodeType === 1 &&
|
6386 | typeof object.nodeName === 'string';
|
6387 | }
|
6388 | };
|
6389 |
|
6390 | function formatValue(ctx, value, recurseTimes) {
|
6391 |
|
6392 |
|
6393 | if (value && typeof value.inspect === 'function' &&
|
6394 |
|
6395 | value.inspect !== exports.inspect &&
|
6396 |
|
6397 | !(value.constructor && value.constructor.prototype === value)) {
|
6398 | var ret = value.inspect(recurseTimes, ctx);
|
6399 | if (typeof ret !== 'string') {
|
6400 | ret = formatValue(ctx, ret, recurseTimes);
|
6401 | }
|
6402 | return ret;
|
6403 | }
|
6404 |
|
6405 |
|
6406 | var primitive = formatPrimitive(ctx, value);
|
6407 | if (primitive) {
|
6408 | return primitive;
|
6409 | }
|
6410 |
|
6411 |
|
6412 | if (isDOMElement(value)) {
|
6413 | if ('outerHTML' in value) {
|
6414 | return value.outerHTML;
|
6415 |
|
6416 |
|
6417 | } else {
|
6418 |
|
6419 | try {
|
6420 | if (document.xmlVersion) {
|
6421 | var xmlSerializer = new XMLSerializer();
|
6422 | return xmlSerializer.serializeToString(value);
|
6423 | } else {
|
6424 |
|
6425 |
|
6426 |
|
6427 | var ns = "http://www.w3.org/1999/xhtml";
|
6428 | var container = document.createElementNS(ns, '_');
|
6429 |
|
6430 | container.appendChild(value.cloneNode(false));
|
6431 | var html = container.innerHTML
|
6432 | .replace('><', '>' + value.innerHTML + '<');
|
6433 | container.innerHTML = '';
|
6434 | return html;
|
6435 | }
|
6436 | } catch (err) {
|
6437 |
|
6438 |
|
6439 |
|
6440 | }
|
6441 | }
|
6442 | }
|
6443 |
|
6444 |
|
6445 | var visibleKeys = getEnumerableProperties(value);
|
6446 | var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
|
6447 |
|
6448 | var name, nameSuffix;
|
6449 |
|
6450 |
|
6451 |
|
6452 |
|
6453 | if (keys.length === 0 || (isError(value) && (
|
6454 | (keys.length === 1 && keys[0] === 'stack') ||
|
6455 | (keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack')
|
6456 | ))) {
|
6457 | if (typeof value === 'function') {
|
6458 | name = getFuncName_1(value);
|
6459 | nameSuffix = name ? ': ' + name : '';
|
6460 | return ctx.stylize('[Function' + nameSuffix + ']', 'special');
|
6461 | }
|
6462 | if (isRegExp(value)) {
|
6463 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
6464 | }
|
6465 | if (isDate(value)) {
|
6466 | return ctx.stylize(Date.prototype.toUTCString.call(value), 'date');
|
6467 | }
|
6468 | if (isError(value)) {
|
6469 | return formatError(value);
|
6470 | }
|
6471 | }
|
6472 |
|
6473 | var base = ''
|
6474 | , array = false
|
6475 | , typedArray = false
|
6476 | , braces = ['{', '}'];
|
6477 |
|
6478 | if (isTypedArray(value)) {
|
6479 | typedArray = true;
|
6480 | braces = ['[', ']'];
|
6481 | }
|
6482 |
|
6483 |
|
6484 | if (isArray(value)) {
|
6485 | array = true;
|
6486 | braces = ['[', ']'];
|
6487 | }
|
6488 |
|
6489 |
|
6490 | if (typeof value === 'function') {
|
6491 | name = getFuncName_1(value);
|
6492 | nameSuffix = name ? ': ' + name : '';
|
6493 | base = ' [Function' + nameSuffix + ']';
|
6494 | }
|
6495 |
|
6496 |
|
6497 | if (isRegExp(value)) {
|
6498 | base = ' ' + RegExp.prototype.toString.call(value);
|
6499 | }
|
6500 |
|
6501 |
|
6502 | if (isDate(value)) {
|
6503 | base = ' ' + Date.prototype.toUTCString.call(value);
|
6504 | }
|
6505 |
|
6506 |
|
6507 | if (isError(value)) {
|
6508 | return formatError(value);
|
6509 | }
|
6510 |
|
6511 | if (keys.length === 0 && (!array || value.length == 0)) {
|
6512 | return braces[0] + base + braces[1];
|
6513 | }
|
6514 |
|
6515 | if (recurseTimes < 0) {
|
6516 | if (isRegExp(value)) {
|
6517 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
6518 | } else {
|
6519 | return ctx.stylize('[Object]', 'special');
|
6520 | }
|
6521 | }
|
6522 |
|
6523 | ctx.seen.push(value);
|
6524 |
|
6525 | var output;
|
6526 | if (array) {
|
6527 | output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
|
6528 | } else if (typedArray) {
|
6529 | return formatTypedArray(value);
|
6530 | } else {
|
6531 | output = keys.map(function(key) {
|
6532 | return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
|
6533 | });
|
6534 | }
|
6535 |
|
6536 | ctx.seen.pop();
|
6537 |
|
6538 | return reduceToSingleString(output, base, braces);
|
6539 | }
|
6540 |
|
6541 |
|
6542 | function formatPrimitive(ctx, value) {
|
6543 | switch (typeof value) {
|
6544 | case 'undefined':
|
6545 | return ctx.stylize('undefined', 'undefined');
|
6546 |
|
6547 | case 'string':
|
6548 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
6549 | .replace(/'/g, "\\'")
|
6550 | .replace(/\\"/g, '"') + '\'';
|
6551 | return ctx.stylize(simple, 'string');
|
6552 |
|
6553 | case 'number':
|
6554 | if (value === 0 && (1/value) === -Infinity) {
|
6555 | return ctx.stylize('-0', 'number');
|
6556 | }
|
6557 | return ctx.stylize('' + value, 'number');
|
6558 |
|
6559 | case 'boolean':
|
6560 | return ctx.stylize('' + value, 'boolean');
|
6561 |
|
6562 | case 'symbol':
|
6563 | return ctx.stylize(value.toString(), 'symbol');
|
6564 | }
|
6565 |
|
6566 | if (value === null) {
|
6567 | return ctx.stylize('null', 'null');
|
6568 | }
|
6569 | }
|
6570 |
|
6571 |
|
6572 | function formatError(value) {
|
6573 | return '[' + Error.prototype.toString.call(value) + ']';
|
6574 | }
|
6575 |
|
6576 |
|
6577 | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
6578 | var output = [];
|
6579 | for (var i = 0, l = value.length; i < l; ++i) {
|
6580 | if (Object.prototype.hasOwnProperty.call(value, String(i))) {
|
6581 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
6582 | String(i), true));
|
6583 | } else {
|
6584 | output.push('');
|
6585 | }
|
6586 | }
|
6587 |
|
6588 | keys.forEach(function(key) {
|
6589 | if (!key.match(/^\d+$/)) {
|
6590 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
6591 | key, true));
|
6592 | }
|
6593 | });
|
6594 | return output;
|
6595 | }
|
6596 |
|
6597 | function formatTypedArray(value) {
|
6598 | var str = '[ ';
|
6599 |
|
6600 | for (var i = 0; i < value.length; ++i) {
|
6601 | if (str.length >= config.truncateThreshold - 7) {
|
6602 | str += '...';
|
6603 | break;
|
6604 | }
|
6605 | str += value[i] + ', ';
|
6606 | }
|
6607 | str += ' ]';
|
6608 |
|
6609 |
|
6610 | if (str.indexOf(', ]') !== -1) {
|
6611 | str = str.replace(', ]', ' ]');
|
6612 | }
|
6613 |
|
6614 | return str;
|
6615 | }
|
6616 |
|
6617 | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
6618 | var name;
|
6619 | var propDescriptor = Object.getOwnPropertyDescriptor(value, key);
|
6620 | var str;
|
6621 |
|
6622 | if (propDescriptor) {
|
6623 | if (propDescriptor.get) {
|
6624 | if (propDescriptor.set) {
|
6625 | str = ctx.stylize('[Getter/Setter]', 'special');
|
6626 | } else {
|
6627 | str = ctx.stylize('[Getter]', 'special');
|
6628 | }
|
6629 | } else {
|
6630 | if (propDescriptor.set) {
|
6631 | str = ctx.stylize('[Setter]', 'special');
|
6632 | }
|
6633 | }
|
6634 | }
|
6635 | if (visibleKeys.indexOf(key) < 0) {
|
6636 | name = '[' + key + ']';
|
6637 | }
|
6638 | if (!str) {
|
6639 | if (ctx.seen.indexOf(value[key]) < 0) {
|
6640 | if (recurseTimes === null) {
|
6641 | str = formatValue(ctx, value[key], null);
|
6642 | } else {
|
6643 | str = formatValue(ctx, value[key], recurseTimes - 1);
|
6644 | }
|
6645 | if (str.indexOf('\n') > -1) {
|
6646 | if (array) {
|
6647 | str = str.split('\n').map(function(line) {
|
6648 | return ' ' + line;
|
6649 | }).join('\n').substr(2);
|
6650 | } else {
|
6651 | str = '\n' + str.split('\n').map(function(line) {
|
6652 | return ' ' + line;
|
6653 | }).join('\n');
|
6654 | }
|
6655 | }
|
6656 | } else {
|
6657 | str = ctx.stylize('[Circular]', 'special');
|
6658 | }
|
6659 | }
|
6660 | if (typeof name === 'undefined') {
|
6661 | if (array && key.match(/^\d+$/)) {
|
6662 | return str;
|
6663 | }
|
6664 | name = JSON.stringify('' + key);
|
6665 | if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
6666 | name = name.substr(1, name.length - 2);
|
6667 | name = ctx.stylize(name, 'name');
|
6668 | } else {
|
6669 | name = name.replace(/'/g, "\\'")
|
6670 | .replace(/\\"/g, '"')
|
6671 | .replace(/(^"|"$)/g, "'");
|
6672 | name = ctx.stylize(name, 'string');
|
6673 | }
|
6674 | }
|
6675 |
|
6676 | return name + ': ' + str;
|
6677 | }
|
6678 |
|
6679 |
|
6680 | function reduceToSingleString(output, base, braces) {
|
6681 | var numLinesEst = 0;
|
6682 | var length = output.reduce(function(prev, cur) {
|
6683 | numLinesEst++;
|
6684 | if (cur.indexOf('\n') >= 0) numLinesEst++;
|
6685 | return prev + cur.length + 1;
|
6686 | }, 0);
|
6687 |
|
6688 | if (length > 60) {
|
6689 | return braces[0] +
|
6690 | (base === '' ? '' : base + '\n ') +
|
6691 | ' ' +
|
6692 | output.join(',\n ') +
|
6693 | ' ' +
|
6694 | braces[1];
|
6695 | }
|
6696 |
|
6697 | return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
6698 | }
|
6699 |
|
6700 | function isTypedArray(ar) {
|
6701 |
|
6702 |
|
6703 | return (typeof ar === 'object' && /\w+Array]$/.test(objectToString(ar)));
|
6704 | }
|
6705 |
|
6706 | function isArray(ar) {
|
6707 | return Array.isArray(ar) ||
|
6708 | (typeof ar === 'object' && objectToString(ar) === '[object Array]');
|
6709 | }
|
6710 |
|
6711 | function isRegExp(re) {
|
6712 | return typeof re === 'object' && objectToString(re) === '[object RegExp]';
|
6713 | }
|
6714 |
|
6715 | function isDate(d) {
|
6716 | return typeof d === 'object' && objectToString(d) === '[object Date]';
|
6717 | }
|
6718 |
|
6719 | function isError(e) {
|
6720 | return typeof e === 'object' && objectToString(e) === '[object Error]';
|
6721 | }
|
6722 |
|
6723 | function objectToString(o) {
|
6724 | return Object.prototype.toString.call(o);
|
6725 | }
|
6726 | });
|
6727 |
|
6728 |
|
6729 |
|
6730 |
|
6731 |
|
6732 |
|
6733 |
|
6734 |
|
6735 |
|
6736 |
|
6737 |
|
6738 |
|
6739 |
|
6740 |
|
6741 |
|
6742 |
|
6743 |
|
6744 |
|
6745 |
|
6746 |
|
6747 |
|
6748 |
|
6749 |
|
6750 |
|
6751 |
|
6752 |
|
6753 |
|
6754 | var objDisplay = function objDisplay(obj) {
|
6755 | var str = inspect_1(obj)
|
6756 | , type = Object.prototype.toString.call(obj);
|
6757 |
|
6758 | if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
6759 | if (type === '[object Function]') {
|
6760 | return !obj.name || obj.name === ''
|
6761 | ? '[Function]'
|
6762 | : '[Function: ' + obj.name + ']';
|
6763 | } else if (type === '[object Array]') {
|
6764 | return '[ Array(' + obj.length + ') ]';
|
6765 | } else if (type === '[object Object]') {
|
6766 | var keys = Object.keys(obj)
|
6767 | , kstr = keys.length > 2
|
6768 | ? keys.splice(0, 2).join(', ') + ', ...'
|
6769 | : keys.join(', ');
|
6770 | return '{ Object (' + kstr + ') }';
|
6771 | } else {
|
6772 | return str;
|
6773 | }
|
6774 | } else {
|
6775 | return str;
|
6776 | }
|
6777 | };
|
6778 |
|
6779 |
|
6780 |
|
6781 |
|
6782 |
|
6783 |
|
6784 |
|
6785 |
|
6786 |
|
6787 |
|
6788 |
|
6789 |
|
6790 |
|
6791 |
|
6792 |
|
6793 |
|
6794 |
|
6795 |
|
6796 |
|
6797 |
|
6798 |
|
6799 |
|
6800 |
|
6801 |
|
6802 |
|
6803 |
|
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 |
|
6809 |
|
6810 | var getMessage = function getMessage(obj, args) {
|
6811 | var negate = flag(obj, 'negate')
|
6812 | , val = flag(obj, 'object')
|
6813 | , expected = args[3]
|
6814 | , actual = getActual(obj, args)
|
6815 | , msg = negate ? args[2] : args[1]
|
6816 | , flagMsg = flag(obj, 'message');
|
6817 |
|
6818 | if(typeof msg === "function") msg = msg();
|
6819 | msg = msg || '';
|
6820 | msg = msg
|
6821 | .replace(/#\{this\}/g, function () { return objDisplay(val); })
|
6822 | .replace(/#\{act\}/g, function () { return objDisplay(actual); })
|
6823 | .replace(/#\{exp\}/g, function () { return objDisplay(expected); });
|
6824 |
|
6825 | return flagMsg ? flagMsg + ': ' + msg : msg;
|
6826 | };
|
6827 |
|
6828 |
|
6829 |
|
6830 |
|
6831 |
|
6832 |
|
6833 |
|
6834 |
|
6835 |
|
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 |
|
6845 |
|
6846 |
|
6847 |
|
6848 |
|
6849 |
|
6850 |
|
6851 |
|
6852 |
|
6853 |
|
6854 |
|
6855 |
|
6856 |
|
6857 | var transferFlags = function transferFlags(assertion, object, includeAll) {
|
6858 | var flags = assertion.__flags || (assertion.__flags = Object.create(null));
|
6859 |
|
6860 | if (!object.__flags) {
|
6861 | object.__flags = Object.create(null);
|
6862 | }
|
6863 |
|
6864 | includeAll = arguments.length === 3 ? includeAll : true;
|
6865 |
|
6866 | for (var flag in flags) {
|
6867 | if (includeAll ||
|
6868 | (flag !== 'object' && flag !== 'ssfi' && flag !== 'lockSsfi' && flag != 'message')) {
|
6869 | object.__flags[flag] = flags[flag];
|
6870 | }
|
6871 | }
|
6872 | };
|
6873 |
|
6874 |
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 | function FakeMap() {
|
6883 | this._key = 'chai/deep-eql__' + Math.random() + Date.now();
|
6884 | }
|
6885 |
|
6886 | FakeMap.prototype = {
|
6887 | get: function getMap(key) {
|
6888 | return key[this._key];
|
6889 | },
|
6890 | set: function setMap(key, value) {
|
6891 | if (Object.isExtensible(key)) {
|
6892 | Object.defineProperty(key, this._key, {
|
6893 | value: value,
|
6894 | configurable: true,
|
6895 | });
|
6896 | }
|
6897 | },
|
6898 | };
|
6899 |
|
6900 | var MemoizeMap = typeof WeakMap === 'function' ? WeakMap : FakeMap;
|
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 | function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) {
|
6910 |
|
6911 | if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
|
6912 | return null;
|
6913 | }
|
6914 | var leftHandMap = memoizeMap.get(leftHandOperand);
|
6915 | if (leftHandMap) {
|
6916 | var result = leftHandMap.get(rightHandOperand);
|
6917 | if (typeof result === 'boolean') {
|
6918 | return result;
|
6919 | }
|
6920 | }
|
6921 | return null;
|
6922 | }
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 | function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) {
|
6933 |
|
6934 | if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
|
6935 | return;
|
6936 | }
|
6937 | var leftHandMap = memoizeMap.get(leftHandOperand);
|
6938 | if (leftHandMap) {
|
6939 | leftHandMap.set(rightHandOperand, result);
|
6940 | } else {
|
6941 | leftHandMap = new MemoizeMap();
|
6942 | leftHandMap.set(rightHandOperand, result);
|
6943 | memoizeMap.set(leftHandOperand, leftHandMap);
|
6944 | }
|
6945 | }
|
6946 |
|
6947 |
|
6948 |
|
6949 |
|
6950 |
|
6951 | var deepEql = deepEqual;
|
6952 | var MemoizeMap_1 = MemoizeMap;
|
6953 |
|
6954 |
|
6955 |
|
6956 |
|
6957 |
|
6958 |
|
6959 |
|
6960 |
|
6961 |
|
6962 |
|
6963 |
|
6964 |
|
6965 |
|
6966 | function deepEqual(leftHandOperand, rightHandOperand, options) {
|
6967 |
|
6968 | if (options && options.comparator) {
|
6969 | return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
|
6970 | }
|
6971 |
|
6972 | var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
|
6973 | if (simpleResult !== null) {
|
6974 | return simpleResult;
|
6975 | }
|
6976 |
|
6977 |
|
6978 | return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
|
6979 | }
|
6980 |
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 | function simpleEqual(leftHandOperand, rightHandOperand) {
|
6988 |
|
6989 | if (leftHandOperand === rightHandOperand) {
|
6990 |
|
6991 | return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand;
|
6992 | }
|
6993 |
|
6994 |
|
6995 | if (
|
6996 | leftHandOperand !== leftHandOperand &&
|
6997 | rightHandOperand !== rightHandOperand
|
6998 | ) {
|
6999 | return true;
|
7000 | }
|
7001 |
|
7002 |
|
7003 |
|
7004 | if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
|
7005 |
|
7006 | return false;
|
7007 | }
|
7008 | return null;
|
7009 | }
|
7010 |
|
7011 |
|
7012 |
|
7013 |
|
7014 |
|
7015 |
|
7016 |
|
7017 |
|
7018 |
|
7019 |
|
7020 |
|
7021 |
|
7022 |
|
7023 | function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) {
|
7024 | options = options || {};
|
7025 | options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap();
|
7026 | var comparator = options && options.comparator;
|
7027 |
|
7028 |
|
7029 | var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize);
|
7030 | if (memoizeResultLeft !== null) {
|
7031 | return memoizeResultLeft;
|
7032 | }
|
7033 | var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize);
|
7034 | if (memoizeResultRight !== null) {
|
7035 | return memoizeResultRight;
|
7036 | }
|
7037 |
|
7038 |
|
7039 | if (comparator) {
|
7040 | var comparatorResult = comparator(leftHandOperand, rightHandOperand);
|
7041 |
|
7042 | if (comparatorResult === false || comparatorResult === true) {
|
7043 | memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult);
|
7044 | return comparatorResult;
|
7045 | }
|
7046 |
|
7047 |
|
7048 | var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
|
7049 | if (simpleResult !== null) {
|
7050 |
|
7051 | return simpleResult;
|
7052 | }
|
7053 | }
|
7054 |
|
7055 | var leftHandType = typeDetect(leftHandOperand);
|
7056 | if (leftHandType !== typeDetect(rightHandOperand)) {
|
7057 | memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false);
|
7058 | return false;
|
7059 | }
|
7060 |
|
7061 |
|
7062 | memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true);
|
7063 |
|
7064 | var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options);
|
7065 | memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result);
|
7066 | return result;
|
7067 | }
|
7068 |
|
7069 | function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) {
|
7070 | switch (leftHandType) {
|
7071 | case 'String':
|
7072 | case 'Number':
|
7073 | case 'Boolean':
|
7074 | case 'Date':
|
7075 |
|
7076 | return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf());
|
7077 | case 'Promise':
|
7078 | case 'Symbol':
|
7079 | case 'function':
|
7080 | case 'WeakMap':
|
7081 | case 'WeakSet':
|
7082 | case 'Error':
|
7083 | return leftHandOperand === rightHandOperand;
|
7084 | case 'Arguments':
|
7085 | case 'Int8Array':
|
7086 | case 'Uint8Array':
|
7087 | case 'Uint8ClampedArray':
|
7088 | case 'Int16Array':
|
7089 | case 'Uint16Array':
|
7090 | case 'Int32Array':
|
7091 | case 'Uint32Array':
|
7092 | case 'Float32Array':
|
7093 | case 'Float64Array':
|
7094 | case 'Array':
|
7095 | return iterableEqual(leftHandOperand, rightHandOperand, options);
|
7096 | case 'RegExp':
|
7097 | return regexpEqual(leftHandOperand, rightHandOperand);
|
7098 | case 'Generator':
|
7099 | return generatorEqual(leftHandOperand, rightHandOperand, options);
|
7100 | case 'DataView':
|
7101 | return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options);
|
7102 | case 'ArrayBuffer':
|
7103 | return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options);
|
7104 | case 'Set':
|
7105 | return entriesEqual(leftHandOperand, rightHandOperand, options);
|
7106 | case 'Map':
|
7107 | return entriesEqual(leftHandOperand, rightHandOperand, options);
|
7108 | default:
|
7109 | return objectEqual(leftHandOperand, rightHandOperand, options);
|
7110 | }
|
7111 | }
|
7112 |
|
7113 |
|
7114 |
|
7115 |
|
7116 |
|
7117 |
|
7118 |
|
7119 |
|
7120 |
|
7121 | function regexpEqual(leftHandOperand, rightHandOperand) {
|
7122 | return leftHandOperand.toString() === rightHandOperand.toString();
|
7123 | }
|
7124 |
|
7125 |
|
7126 |
|
7127 |
|
7128 |
|
7129 |
|
7130 |
|
7131 |
|
7132 |
|
7133 |
|
7134 | function entriesEqual(leftHandOperand, rightHandOperand, options) {
|
7135 |
|
7136 | if (leftHandOperand.size !== rightHandOperand.size) {
|
7137 | return false;
|
7138 | }
|
7139 | if (leftHandOperand.size === 0) {
|
7140 | return true;
|
7141 | }
|
7142 | var leftHandItems = [];
|
7143 | var rightHandItems = [];
|
7144 | leftHandOperand.forEach(function gatherEntries(key, value) {
|
7145 | leftHandItems.push([ key, value ]);
|
7146 | });
|
7147 | rightHandOperand.forEach(function gatherEntries(key, value) {
|
7148 | rightHandItems.push([ key, value ]);
|
7149 | });
|
7150 | return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options);
|
7151 | }
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 |
|
7157 |
|
7158 |
|
7159 |
|
7160 |
|
7161 |
|
7162 | function iterableEqual(leftHandOperand, rightHandOperand, options) {
|
7163 | var length = leftHandOperand.length;
|
7164 | if (length !== rightHandOperand.length) {
|
7165 | return false;
|
7166 | }
|
7167 | if (length === 0) {
|
7168 | return true;
|
7169 | }
|
7170 | var index = -1;
|
7171 | while (++index < length) {
|
7172 | if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) {
|
7173 | return false;
|
7174 | }
|
7175 | }
|
7176 | return true;
|
7177 | }
|
7178 |
|
7179 |
|
7180 |
|
7181 |
|
7182 |
|
7183 |
|
7184 |
|
7185 |
|
7186 |
|
7187 |
|
7188 | function generatorEqual(leftHandOperand, rightHandOperand, options) {
|
7189 | return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options);
|
7190 | }
|
7191 |
|
7192 |
|
7193 |
|
7194 |
|
7195 |
|
7196 |
|
7197 |
|
7198 | function hasIteratorFunction(target) {
|
7199 | return typeof Symbol !== 'undefined' &&
|
7200 | typeof target === 'object' &&
|
7201 | typeof Symbol.iterator !== 'undefined' &&
|
7202 | typeof target[Symbol.iterator] === 'function';
|
7203 | }
|
7204 |
|
7205 |
|
7206 |
|
7207 |
|
7208 |
|
7209 |
|
7210 |
|
7211 |
|
7212 | function getIteratorEntries(target) {
|
7213 | if (hasIteratorFunction(target)) {
|
7214 | try {
|
7215 | return getGeneratorEntries(target[Symbol.iterator]());
|
7216 | } catch (iteratorError) {
|
7217 | return [];
|
7218 | }
|
7219 | }
|
7220 | return [];
|
7221 | }
|
7222 |
|
7223 |
|
7224 |
|
7225 |
|
7226 |
|
7227 |
|
7228 |
|
7229 | function getGeneratorEntries(generator) {
|
7230 | var generatorResult = generator.next();
|
7231 | var accumulator = [ generatorResult.value ];
|
7232 | while (generatorResult.done === false) {
|
7233 | generatorResult = generator.next();
|
7234 | accumulator.push(generatorResult.value);
|
7235 | }
|
7236 | return accumulator;
|
7237 | }
|
7238 |
|
7239 |
|
7240 |
|
7241 |
|
7242 |
|
7243 |
|
7244 |
|
7245 | function getEnumerableKeys(target) {
|
7246 | var keys = [];
|
7247 | for (var key in target) {
|
7248 | keys.push(key);
|
7249 | }
|
7250 | return keys;
|
7251 | }
|
7252 |
|
7253 |
|
7254 |
|
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 |
|
7262 |
|
7263 | function keysEqual(leftHandOperand, rightHandOperand, keys, options) {
|
7264 | var length = keys.length;
|
7265 | if (length === 0) {
|
7266 | return true;
|
7267 | }
|
7268 | for (var i = 0; i < length; i += 1) {
|
7269 | if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) {
|
7270 | return false;
|
7271 | }
|
7272 | }
|
7273 | return true;
|
7274 | }
|
7275 |
|
7276 |
|
7277 |
|
7278 |
|
7279 |
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 |
|
7286 | function objectEqual(leftHandOperand, rightHandOperand, options) {
|
7287 | var leftHandKeys = getEnumerableKeys(leftHandOperand);
|
7288 | var rightHandKeys = getEnumerableKeys(rightHandOperand);
|
7289 | if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
|
7290 | leftHandKeys.sort();
|
7291 | rightHandKeys.sort();
|
7292 | if (iterableEqual(leftHandKeys, rightHandKeys) === false) {
|
7293 | return false;
|
7294 | }
|
7295 | return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
|
7296 | }
|
7297 |
|
7298 | var leftHandEntries = getIteratorEntries(leftHandOperand);
|
7299 | var rightHandEntries = getIteratorEntries(rightHandOperand);
|
7300 | if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) {
|
7301 | leftHandEntries.sort();
|
7302 | rightHandEntries.sort();
|
7303 | return iterableEqual(leftHandEntries, rightHandEntries, options);
|
7304 | }
|
7305 |
|
7306 | if (leftHandKeys.length === 0 &&
|
7307 | leftHandEntries.length === 0 &&
|
7308 | rightHandKeys.length === 0 &&
|
7309 | rightHandEntries.length === 0) {
|
7310 | return true;
|
7311 | }
|
7312 |
|
7313 | return false;
|
7314 | }
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 | function isPrimitive(value) {
|
7326 | return value === null || typeof value !== 'object';
|
7327 | }
|
7328 |
|
7329 | deepEql.MemoizeMap = MemoizeMap_1;
|
7330 |
|
7331 |
|
7332 |
|
7333 |
|
7334 |
|
7335 |
|
7336 |
|
7337 |
|
7338 |
|
7339 |
|
7340 |
|
7341 |
|
7342 |
|
7343 |
|
7344 |
|
7345 |
|
7346 |
|
7347 |
|
7348 | var isProxyEnabled = function isProxyEnabled() {
|
7349 | return config.useProxy &&
|
7350 | typeof Proxy !== 'undefined' &&
|
7351 | typeof Reflect !== 'undefined';
|
7352 | };
|
7353 |
|
7354 |
|
7355 |
|
7356 |
|
7357 |
|
7358 |
|
7359 |
|
7360 |
|
7361 |
|
7362 |
|
7363 |
|
7364 |
|
7365 |
|
7366 |
|
7367 |
|
7368 |
|
7369 |
|
7370 |
|
7371 |
|
7372 |
|
7373 |
|
7374 |
|
7375 |
|
7376 |
|
7377 |
|
7378 |
|
7379 |
|
7380 |
|
7381 |
|
7382 |
|
7383 |
|
7384 |
|
7385 |
|
7386 |
|
7387 |
|
7388 |
|
7389 |
|
7390 |
|
7391 | var addProperty = function addProperty(ctx, name, getter) {
|
7392 | getter = getter === undefined ? function () {} : getter;
|
7393 |
|
7394 | Object.defineProperty(ctx, name,
|
7395 | { get: function propertyGetter() {
|
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 |
|
7403 |
|
7404 |
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 |
|
7411 | if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {
|
7412 | flag(this, 'ssfi', propertyGetter);
|
7413 | }
|
7414 |
|
7415 | var result = getter.call(this);
|
7416 | if (result !== undefined)
|
7417 | return result;
|
7418 |
|
7419 | var newAssertion = new chai.Assertion();
|
7420 | transferFlags(this, newAssertion);
|
7421 | return newAssertion;
|
7422 | }
|
7423 | , configurable: true
|
7424 | });
|
7425 | };
|
7426 |
|
7427 | var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length');
|
7428 |
|
7429 |
|
7430 |
|
7431 |
|
7432 |
|
7433 |
|
7434 |
|
7435 |
|
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 |
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 |
|
7450 |
|
7451 |
|
7452 |
|
7453 |
|
7454 |
|
7455 |
|
7456 |
|
7457 |
|
7458 |
|
7459 |
|
7460 |
|
7461 |
|
7462 |
|
7463 |
|
7464 |
|
7465 |
|
7466 |
|
7467 |
|
7468 |
|
7469 | var addLengthGuard = function addLengthGuard (fn, assertionName, isChainable) {
|
7470 | if (!fnLengthDesc.configurable) return fn;
|
7471 |
|
7472 | Object.defineProperty(fn, 'length', {
|
7473 | get: function () {
|
7474 | if (isChainable) {
|
7475 | throw Error('Invalid Chai property: ' + assertionName + '.length. Due' +
|
7476 | ' to a compatibility issue, "length" cannot directly follow "' +
|
7477 | assertionName + '". Use "' + assertionName + '.lengthOf" instead.');
|
7478 | }
|
7479 |
|
7480 | throw Error('Invalid Chai property: ' + assertionName + '.length. See' +
|
7481 | ' docs for proper usage of "' + assertionName + '".');
|
7482 | }
|
7483 | });
|
7484 |
|
7485 | return fn;
|
7486 | };
|
7487 |
|
7488 |
|
7489 |
|
7490 |
|
7491 |
|
7492 |
|
7493 |
|
7494 |
|
7495 |
|
7496 |
|
7497 |
|
7498 |
|
7499 |
|
7500 |
|
7501 |
|
7502 |
|
7503 |
|
7504 |
|
7505 |
|
7506 |
|
7507 |
|
7508 |
|
7509 |
|
7510 |
|
7511 |
|
7512 |
|
7513 | var builtins = ['__flags', '__methods', '_obj', 'assert'];
|
7514 |
|
7515 | var proxify = function proxify(obj, nonChainableMethodName) {
|
7516 | if (!isProxyEnabled()) return obj;
|
7517 |
|
7518 | return new Proxy(obj, {
|
7519 | get: function proxyGetter(target, property) {
|
7520 |
|
7521 |
|
7522 |
|
7523 |
|
7524 | if (typeof property === 'string' &&
|
7525 | config.proxyExcludedKeys.indexOf(property) === -1 &&
|
7526 | !Reflect.has(target, property)) {
|
7527 |
|
7528 | if (nonChainableMethodName) {
|
7529 | throw Error('Invalid Chai property: ' + nonChainableMethodName + '.' +
|
7530 | property + '. See docs for proper usage of "' +
|
7531 | nonChainableMethodName + '".');
|
7532 | }
|
7533 |
|
7534 | var orderedProperties = getProperties(target).filter(function(property) {
|
7535 | return !Object.prototype.hasOwnProperty(property) &&
|
7536 | builtins.indexOf(property) === -1;
|
7537 | }).sort(function(a, b) {
|
7538 | return stringDistance(property, a) - stringDistance(property, b);
|
7539 | });
|
7540 |
|
7541 | if (orderedProperties.length &&
|
7542 | stringDistance(orderedProperties[0], property) < 4) {
|
7543 |
|
7544 |
|
7545 | throw Error('Invalid Chai property: ' + property +
|
7546 | '. Did you mean "' + orderedProperties[0] + '"?');
|
7547 | } else {
|
7548 | throw Error('Invalid Chai property: ' + property);
|
7549 | }
|
7550 | }
|
7551 |
|
7552 |
|
7553 |
|
7554 |
|
7555 |
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 |
|
7562 |
|
7563 |
|
7564 | if (builtins.indexOf(property) === -1 && !flag(target, 'lockSsfi')) {
|
7565 | flag(target, 'ssfi', proxyGetter);
|
7566 | }
|
7567 |
|
7568 | return Reflect.get(target, property);
|
7569 | }
|
7570 | });
|
7571 | };
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 |
|
7581 |
|
7582 | function stringDistance(strA, strB, memo) {
|
7583 | if (!memo) {
|
7584 |
|
7585 |
|
7586 |
|
7587 | memo = [];
|
7588 | for (var i = 0; i <= strA.length; i++) {
|
7589 | memo[i] = [];
|
7590 | }
|
7591 | }
|
7592 |
|
7593 | if (!memo[strA.length] || !memo[strA.length][strB.length]) {
|
7594 | if (strA.length === 0 || strB.length === 0) {
|
7595 | memo[strA.length][strB.length] = Math.max(strA.length, strB.length);
|
7596 | } else {
|
7597 | memo[strA.length][strB.length] = Math.min(
|
7598 | stringDistance(strA.slice(0, -1), strB, memo) + 1,
|
7599 | stringDistance(strA, strB.slice(0, -1), memo) + 1,
|
7600 | stringDistance(strA.slice(0, -1), strB.slice(0, -1), memo) +
|
7601 | (strA.slice(-1) === strB.slice(-1) ? 0 : 1)
|
7602 | );
|
7603 | }
|
7604 | }
|
7605 |
|
7606 | return memo[strA.length][strB.length];
|
7607 | }
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 |
|
7614 |
|
7615 |
|
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 |
|
7627 |
|
7628 |
|
7629 |
|
7630 |
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 |
|
7637 |
|
7638 |
|
7639 |
|
7640 |
|
7641 |
|
7642 |
|
7643 |
|
7644 |
|
7645 |
|
7646 |
|
7647 | var addMethod = function addMethod(ctx, name, method) {
|
7648 | var methodWrapper = function () {
|
7649 |
|
7650 |
|
7651 |
|
7652 |
|
7653 |
|
7654 |
|
7655 |
|
7656 |
|
7657 |
|
7658 |
|
7659 |
|
7660 |
|
7661 | if (!flag(this, 'lockSsfi')) {
|
7662 | flag(this, 'ssfi', methodWrapper);
|
7663 | }
|
7664 |
|
7665 | var result = method.apply(this, arguments);
|
7666 | if (result !== undefined)
|
7667 | return result;
|
7668 |
|
7669 | var newAssertion = new chai.Assertion();
|
7670 | transferFlags(this, newAssertion);
|
7671 | return newAssertion;
|
7672 | };
|
7673 |
|
7674 | addLengthGuard(methodWrapper, name, false);
|
7675 | ctx[name] = proxify(methodWrapper, name);
|
7676 | };
|
7677 |
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 |
|
7683 |
|
7684 |
|
7685 |
|
7686 |
|
7687 |
|
7688 |
|
7689 |
|
7690 |
|
7691 |
|
7692 |
|
7693 |
|
7694 |
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 |
|
7705 |
|
7706 |
|
7707 |
|
7708 |
|
7709 |
|
7710 |
|
7711 |
|
7712 |
|
7713 |
|
7714 |
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 |
|
7721 |
|
7722 |
|
7723 | var overwriteProperty = function overwriteProperty(ctx, name, getter) {
|
7724 | var _get = Object.getOwnPropertyDescriptor(ctx, name)
|
7725 | , _super = function () {};
|
7726 |
|
7727 | if (_get && 'function' === typeof _get.get)
|
7728 | _super = _get.get;
|
7729 |
|
7730 | Object.defineProperty(ctx, name,
|
7731 | { get: function overwritingPropertyGetter() {
|
7732 |
|
7733 |
|
7734 |
|
7735 |
|
7736 |
|
7737 |
|
7738 |
|
7739 |
|
7740 |
|
7741 |
|
7742 |
|
7743 |
|
7744 |
|
7745 |
|
7746 |
|
7747 | if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {
|
7748 | flag(this, 'ssfi', overwritingPropertyGetter);
|
7749 | }
|
7750 |
|
7751 |
|
7752 |
|
7753 |
|
7754 | var origLockSsfi = flag(this, 'lockSsfi');
|
7755 | flag(this, 'lockSsfi', true);
|
7756 | var result = getter(_super).call(this);
|
7757 | flag(this, 'lockSsfi', origLockSsfi);
|
7758 |
|
7759 | if (result !== undefined) {
|
7760 | return result;
|
7761 | }
|
7762 |
|
7763 | var newAssertion = new chai.Assertion();
|
7764 | transferFlags(this, newAssertion);
|
7765 | return newAssertion;
|
7766 | }
|
7767 | , configurable: true
|
7768 | });
|
7769 | };
|
7770 |
|
7771 |
|
7772 |
|
7773 |
|
7774 |
|
7775 |
|
7776 |
|
7777 |
|
7778 |
|
7779 |
|
7780 |
|
7781 |
|
7782 |
|
7783 |
|
7784 |
|
7785 |
|
7786 |
|
7787 |
|
7788 |
|
7789 |
|
7790 |
|
7791 |
|
7792 |
|
7793 |
|
7794 |
|
7795 |
|
7796 |
|
7797 |
|
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 |
|
7804 |
|
7805 |
|
7806 |
|
7807 |
|
7808 |
|
7809 |
|
7810 |
|
7811 |
|
7812 |
|
7813 |
|
7814 |
|
7815 |
|
7816 |
|
7817 | var overwriteMethod = function overwriteMethod(ctx, name, method) {
|
7818 | var _method = ctx[name]
|
7819 | , _super = function () {
|
7820 | throw new Error(name + ' is not a function');
|
7821 | };
|
7822 |
|
7823 | if (_method && 'function' === typeof _method)
|
7824 | _super = _method;
|
7825 |
|
7826 | var overwritingMethodWrapper = function () {
|
7827 |
|
7828 |
|
7829 |
|
7830 |
|
7831 |
|
7832 |
|
7833 |
|
7834 |
|
7835 |
|
7836 |
|
7837 |
|
7838 |
|
7839 | if (!flag(this, 'lockSsfi')) {
|
7840 | flag(this, 'ssfi', overwritingMethodWrapper);
|
7841 | }
|
7842 |
|
7843 |
|
7844 |
|
7845 |
|
7846 | var origLockSsfi = flag(this, 'lockSsfi');
|
7847 | flag(this, 'lockSsfi', true);
|
7848 | var result = method(_super).apply(this, arguments);
|
7849 | flag(this, 'lockSsfi', origLockSsfi);
|
7850 |
|
7851 | if (result !== undefined) {
|
7852 | return result;
|
7853 | }
|
7854 |
|
7855 | var newAssertion = new chai.Assertion();
|
7856 | transferFlags(this, newAssertion);
|
7857 | return newAssertion;
|
7858 | };
|
7859 |
|
7860 | addLengthGuard(overwritingMethodWrapper, name, false);
|
7861 | ctx[name] = proxify(overwritingMethodWrapper, name);
|
7862 | };
|
7863 |
|
7864 |
|
7865 |
|
7866 |
|
7867 |
|
7868 |
|
7869 |
|
7870 |
|
7871 |
|
7872 |
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 |
|
7878 |
|
7879 |
|
7880 |
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 | var canSetPrototype = typeof Object.setPrototypeOf === 'function';
|
7886 |
|
7887 |
|
7888 |
|
7889 | var testFn = function() {};
|
7890 | var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
|
7891 | var propDesc = Object.getOwnPropertyDescriptor(testFn, name);
|
7892 |
|
7893 |
|
7894 |
|
7895 |
|
7896 |
|
7897 | if (typeof propDesc !== 'object')
|
7898 | return true;
|
7899 |
|
7900 | return !propDesc.configurable;
|
7901 | });
|
7902 |
|
7903 |
|
7904 | var call = Function.prototype.call;
|
7905 | var apply = Function.prototype.apply;
|
7906 |
|
7907 |
|
7908 |
|
7909 |
|
7910 |
|
7911 |
|
7912 |
|
7913 |
|
7914 |
|
7915 |
|
7916 |
|
7917 |
|
7918 |
|
7919 |
|
7920 |
|
7921 |
|
7922 |
|
7923 |
|
7924 |
|
7925 |
|
7926 |
|
7927 |
|
7928 |
|
7929 |
|
7930 |
|
7931 |
|
7932 |
|
7933 |
|
7934 |
|
7935 |
|
7936 | var addChainableMethod = function addChainableMethod(ctx, name, method, chainingBehavior) {
|
7937 | if (typeof chainingBehavior !== 'function') {
|
7938 | chainingBehavior = function () { };
|
7939 | }
|
7940 |
|
7941 | var chainableBehavior = {
|
7942 | method: method
|
7943 | , chainingBehavior: chainingBehavior
|
7944 | };
|
7945 |
|
7946 |
|
7947 | if (!ctx.__methods) {
|
7948 | ctx.__methods = {};
|
7949 | }
|
7950 | ctx.__methods[name] = chainableBehavior;
|
7951 |
|
7952 | Object.defineProperty(ctx, name,
|
7953 | { get: function chainableMethodGetter() {
|
7954 | chainableBehavior.chainingBehavior.call(this);
|
7955 |
|
7956 | var chainableMethodWrapper = function () {
|
7957 |
|
7958 |
|
7959 |
|
7960 |
|
7961 |
|
7962 |
|
7963 |
|
7964 |
|
7965 |
|
7966 |
|
7967 |
|
7968 |
|
7969 |
|
7970 |
|
7971 |
|
7972 | if (!flag(this, 'lockSsfi')) {
|
7973 | flag(this, 'ssfi', chainableMethodWrapper);
|
7974 | }
|
7975 |
|
7976 | var result = chainableBehavior.method.apply(this, arguments);
|
7977 | if (result !== undefined) {
|
7978 | return result;
|
7979 | }
|
7980 |
|
7981 | var newAssertion = new chai.Assertion();
|
7982 | transferFlags(this, newAssertion);
|
7983 | return newAssertion;
|
7984 | };
|
7985 |
|
7986 | addLengthGuard(chainableMethodWrapper, name, true);
|
7987 |
|
7988 |
|
7989 | if (canSetPrototype) {
|
7990 |
|
7991 | var prototype = Object.create(this);
|
7992 |
|
7993 | prototype.call = call;
|
7994 | prototype.apply = apply;
|
7995 | Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
7996 | }
|
7997 |
|
7998 | else {
|
7999 | var asserterNames = Object.getOwnPropertyNames(ctx);
|
8000 | asserterNames.forEach(function (asserterName) {
|
8001 | if (excludeNames.indexOf(asserterName) !== -1) {
|
8002 | return;
|
8003 | }
|
8004 |
|
8005 | var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
8006 | Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
8007 | });
|
8008 | }
|
8009 |
|
8010 | transferFlags(this, chainableMethodWrapper);
|
8011 | return proxify(chainableMethodWrapper);
|
8012 | }
|
8013 | , configurable: true
|
8014 | });
|
8015 | };
|
8016 |
|
8017 |
|
8018 |
|
8019 |
|
8020 |
|
8021 |
|
8022 |
|
8023 |
|
8024 |
|
8025 |
|
8026 |
|
8027 |
|
8028 |
|
8029 |
|
8030 |
|
8031 |
|
8032 |
|
8033 |
|
8034 |
|
8035 |
|
8036 |
|
8037 |
|
8038 |
|
8039 |
|
8040 |
|
8041 |
|
8042 |
|
8043 |
|
8044 |
|
8045 |
|
8046 |
|
8047 |
|
8048 |
|
8049 |
|
8050 |
|
8051 |
|
8052 |
|
8053 |
|
8054 |
|
8055 |
|
8056 |
|
8057 |
|
8058 |
|
8059 | var overwriteChainableMethod = function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
8060 | var chainableBehavior = ctx.__methods[name];
|
8061 |
|
8062 | var _chainingBehavior = chainableBehavior.chainingBehavior;
|
8063 | chainableBehavior.chainingBehavior = function overwritingChainableMethodGetter() {
|
8064 | var result = chainingBehavior(_chainingBehavior).call(this);
|
8065 | if (result !== undefined) {
|
8066 | return result;
|
8067 | }
|
8068 |
|
8069 | var newAssertion = new chai.Assertion();
|
8070 | transferFlags(this, newAssertion);
|
8071 | return newAssertion;
|
8072 | };
|
8073 |
|
8074 | var _method = chainableBehavior.method;
|
8075 | chainableBehavior.method = function overwritingChainableMethodWrapper() {
|
8076 | var result = method(_method).apply(this, arguments);
|
8077 | if (result !== undefined) {
|
8078 | return result;
|
8079 | }
|
8080 |
|
8081 | var newAssertion = new chai.Assertion();
|
8082 | transferFlags(this, newAssertion);
|
8083 | return newAssertion;
|
8084 | };
|
8085 | };
|
8086 |
|
8087 |
|
8088 |
|
8089 |
|
8090 |
|
8091 |
|
8092 |
|
8093 |
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 |
|
8100 |
|
8101 |
|
8102 |
|
8103 |
|
8104 |
|
8105 |
|
8106 |
|
8107 |
|
8108 |
|
8109 |
|
8110 |
|
8111 |
|
8112 |
|
8113 |
|
8114 |
|
8115 | var compareByInspect = function compareByInspect(a, b) {
|
8116 | return inspect_1(a) < inspect_1(b) ? -1 : 1;
|
8117 | };
|
8118 |
|
8119 |
|
8120 |
|
8121 |
|
8122 |
|
8123 |
|
8124 |
|
8125 |
|
8126 |
|
8127 |
|
8128 |
|
8129 |
|
8130 |
|
8131 |
|
8132 |
|
8133 |
|
8134 |
|
8135 |
|
8136 |
|
8137 |
|
8138 |
|
8139 | var getOwnEnumerablePropertySymbols = function getOwnEnumerablePropertySymbols(obj) {
|
8140 | if (typeof Object.getOwnPropertySymbols !== 'function') return [];
|
8141 |
|
8142 | return Object.getOwnPropertySymbols(obj).filter(function (sym) {
|
8143 | return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
|
8144 | });
|
8145 | };
|
8146 |
|
8147 |
|
8148 |
|
8149 |
|
8150 |
|
8151 |
|
8152 |
|
8153 |
|
8154 |
|
8155 |
|
8156 |
|
8157 |
|
8158 |
|
8159 |
|
8160 |
|
8161 |
|
8162 |
|
8163 |
|
8164 |
|
8165 |
|
8166 |
|
8167 |
|
8168 |
|
8169 |
|
8170 |
|
8171 |
|
8172 |
|
8173 | var getOwnEnumerableProperties = function getOwnEnumerableProperties(obj) {
|
8174 | return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));
|
8175 | };
|
8176 |
|
8177 |
|
8178 |
|
8179 |
|
8180 |
|
8181 |
|
8182 |
|
8183 |
|
8184 |
|
8185 |
|
8186 |
|
8187 |
|
8188 |
|
8189 |
|
8190 |
|
8191 |
|
8192 |
|
8193 |
|
8194 |
|
8195 |
|
8196 |
|
8197 |
|
8198 |
|
8199 |
|
8200 |
|
8201 |
|
8202 |
|
8203 |
|
8204 |
|
8205 | function compatibleInstance(thrown, errorLike) {
|
8206 | return errorLike instanceof Error && thrown === errorLike;
|
8207 | }
|
8208 |
|
8209 |
|
8210 |
|
8211 |
|
8212 |
|
8213 |
|
8214 |
|
8215 |
|
8216 |
|
8217 |
|
8218 |
|
8219 |
|
8220 |
|
8221 |
|
8222 |
|
8223 |
|
8224 |
|
8225 | function compatibleConstructor(thrown, errorLike) {
|
8226 | if (errorLike instanceof Error) {
|
8227 |
|
8228 | return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
|
8229 | } else if (errorLike.prototype instanceof Error || errorLike === Error) {
|
8230 |
|
8231 | return thrown.constructor === errorLike || thrown instanceof errorLike;
|
8232 | }
|
8233 |
|
8234 | return false;
|
8235 | }
|
8236 |
|
8237 |
|
8238 |
|
8239 |
|
8240 |
|
8241 |
|
8242 |
|
8243 |
|
8244 |
|
8245 |
|
8246 |
|
8247 |
|
8248 |
|
8249 |
|
8250 |
|
8251 | function compatibleMessage(thrown, errMatcher) {
|
8252 | var comparisonString = typeof thrown === 'string' ? thrown : thrown.message;
|
8253 | if (errMatcher instanceof RegExp) {
|
8254 | return errMatcher.test(comparisonString);
|
8255 | } else if (typeof errMatcher === 'string') {
|
8256 | return comparisonString.indexOf(errMatcher) !== -1;
|
8257 | }
|
8258 |
|
8259 | return false;
|
8260 | }
|
8261 |
|
8262 |
|
8263 |
|
8264 |
|
8265 |
|
8266 |
|
8267 |
|
8268 |
|
8269 |
|
8270 |
|
8271 |
|
8272 |
|
8273 |
|
8274 | var functionNameMatch$1 = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;
|
8275 | function getFunctionName(constructorFn) {
|
8276 | var name = '';
|
8277 | if (typeof constructorFn.name === 'undefined') {
|
8278 |
|
8279 | var match = String(constructorFn).match(functionNameMatch$1);
|
8280 | if (match) {
|
8281 | name = match[1];
|
8282 | }
|
8283 | } else {
|
8284 | name = constructorFn.name;
|
8285 | }
|
8286 |
|
8287 | return name;
|
8288 | }
|
8289 |
|
8290 |
|
8291 |
|
8292 |
|
8293 |
|
8294 |
|
8295 |
|
8296 |
|
8297 |
|
8298 |
|
8299 |
|
8300 |
|
8301 | function getConstructorName(errorLike) {
|
8302 | var constructorName = errorLike;
|
8303 | if (errorLike instanceof Error) {
|
8304 | constructorName = getFunctionName(errorLike.constructor);
|
8305 | } else if (typeof errorLike === 'function') {
|
8306 |
|
8307 |
|
8308 |
|
8309 | constructorName = getFunctionName(errorLike).trim() ||
|
8310 | getFunctionName(new errorLike());
|
8311 | }
|
8312 |
|
8313 | return constructorName;
|
8314 | }
|
8315 |
|
8316 |
|
8317 |
|
8318 |
|
8319 |
|
8320 |
|
8321 |
|
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 |
|
8327 |
|
8328 |
|
8329 | function getMessage$2(errorLike) {
|
8330 | var msg = '';
|
8331 | if (errorLike && errorLike.message) {
|
8332 | msg = errorLike.message;
|
8333 | } else if (typeof errorLike === 'string') {
|
8334 | msg = errorLike;
|
8335 | }
|
8336 |
|
8337 | return msg;
|
8338 | }
|
8339 |
|
8340 | var checkError = {
|
8341 | compatibleInstance: compatibleInstance,
|
8342 | compatibleConstructor: compatibleConstructor,
|
8343 | compatibleMessage: compatibleMessage,
|
8344 | getMessage: getMessage$2,
|
8345 | getConstructorName: getConstructorName,
|
8346 | };
|
8347 |
|
8348 |
|
8349 |
|
8350 |
|
8351 |
|
8352 |
|
8353 |
|
8354 |
|
8355 |
|
8356 |
|
8357 |
|
8358 |
|
8359 |
|
8360 |
|
8361 |
|
8362 |
|
8363 |
|
8364 |
|
8365 |
|
8366 | function isNaN$1(value) {
|
8367 |
|
8368 |
|
8369 | return value !== value;
|
8370 | }
|
8371 |
|
8372 |
|
8373 | var _isNaN = Number.isNaN || isNaN$1;
|
8374 |
|
8375 |
|
8376 |
|
8377 |
|
8378 |
|
8379 |
|
8380 |
|
8381 |
|
8382 |
|
8383 |
|
8384 |
|
8385 |
|
8386 |
|
8387 |
|
8388 |
|
8389 |
|
8390 |
|
8391 | var test$2 = test;
|
8392 |
|
8393 |
|
8394 |
|
8395 |
|
8396 |
|
8397 | var type = typeDetect;
|
8398 |
|
8399 |
|
8400 |
|
8401 |
|
8402 | var expectTypes$2 = expectTypes;
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 |
|
8408 | var getMessage$3 = getMessage;
|
8409 |
|
8410 |
|
8411 |
|
8412 |
|
8413 |
|
8414 | var getActual$2 = getActual;
|
8415 |
|
8416 |
|
8417 |
|
8418 |
|
8419 |
|
8420 | var inspect = inspect_1;
|
8421 |
|
8422 |
|
8423 |
|
8424 |
|
8425 |
|
8426 | var objDisplay$2 = objDisplay;
|
8427 |
|
8428 |
|
8429 |
|
8430 |
|
8431 |
|
8432 | var flag$2 = flag;
|
8433 |
|
8434 |
|
8435 |
|
8436 |
|
8437 |
|
8438 | var transferFlags$2 = transferFlags;
|
8439 |
|
8440 |
|
8441 |
|
8442 |
|
8443 |
|
8444 | var eql = deepEql;
|
8445 |
|
8446 |
|
8447 |
|
8448 |
|
8449 |
|
8450 | var getPathInfo$1 = pathval.getPathInfo;
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 |
|
8456 | var hasProperty$1 = pathval.hasProperty;
|
8457 |
|
8458 |
|
8459 |
|
8460 |
|
8461 |
|
8462 | var getName = getFuncName_1;
|
8463 |
|
8464 |
|
8465 |
|
8466 |
|
8467 |
|
8468 | var addProperty$2 = addProperty;
|
8469 |
|
8470 |
|
8471 |
|
8472 |
|
8473 |
|
8474 | var addMethod$2 = addMethod;
|
8475 |
|
8476 |
|
8477 |
|
8478 |
|
8479 |
|
8480 | var overwriteProperty$2 = overwriteProperty;
|
8481 |
|
8482 |
|
8483 |
|
8484 |
|
8485 |
|
8486 | var overwriteMethod$2 = overwriteMethod;
|
8487 |
|
8488 |
|
8489 |
|
8490 |
|
8491 |
|
8492 | var addChainableMethod$2 = addChainableMethod;
|
8493 |
|
8494 |
|
8495 |
|
8496 |
|
8497 |
|
8498 | var overwriteChainableMethod$2 = overwriteChainableMethod;
|
8499 |
|
8500 |
|
8501 |
|
8502 |
|
8503 |
|
8504 | var compareByInspect$2 = compareByInspect;
|
8505 |
|
8506 |
|
8507 |
|
8508 |
|
8509 |
|
8510 | var getOwnEnumerablePropertySymbols$2 = getOwnEnumerablePropertySymbols;
|
8511 |
|
8512 |
|
8513 |
|
8514 |
|
8515 |
|
8516 | var getOwnEnumerableProperties$2 = getOwnEnumerableProperties;
|
8517 |
|
8518 |
|
8519 |
|
8520 |
|
8521 |
|
8522 | var checkError$2 = checkError;
|
8523 |
|
8524 |
|
8525 |
|
8526 |
|
8527 |
|
8528 | var proxify$2 = proxify;
|
8529 |
|
8530 |
|
8531 |
|
8532 |
|
8533 |
|
8534 | var addLengthGuard$2 = addLengthGuard;
|
8535 |
|
8536 |
|
8537 |
|
8538 |
|
8539 |
|
8540 | var isProxyEnabled$2 = isProxyEnabled;
|
8541 |
|
8542 |
|
8543 |
|
8544 |
|
8545 |
|
8546 | var isNaN$2 = _isNaN;
|
8547 |
|
8548 | var utils = {
|
8549 | test: test$2,
|
8550 | type: type,
|
8551 | expectTypes: expectTypes$2,
|
8552 | getMessage: getMessage$3,
|
8553 | getActual: getActual$2,
|
8554 | inspect: inspect,
|
8555 | objDisplay: objDisplay$2,
|
8556 | flag: flag$2,
|
8557 | transferFlags: transferFlags$2,
|
8558 | eql: eql,
|
8559 | getPathInfo: getPathInfo$1,
|
8560 | hasProperty: hasProperty$1,
|
8561 | getName: getName,
|
8562 | addProperty: addProperty$2,
|
8563 | addMethod: addMethod$2,
|
8564 | overwriteProperty: overwriteProperty$2,
|
8565 | overwriteMethod: overwriteMethod$2,
|
8566 | addChainableMethod: addChainableMethod$2,
|
8567 | overwriteChainableMethod: overwriteChainableMethod$2,
|
8568 | compareByInspect: compareByInspect$2,
|
8569 | getOwnEnumerablePropertySymbols: getOwnEnumerablePropertySymbols$2,
|
8570 | getOwnEnumerableProperties: getOwnEnumerableProperties$2,
|
8571 | checkError: checkError$2,
|
8572 | proxify: proxify$2,
|
8573 | addLengthGuard: addLengthGuard$2,
|
8574 | isProxyEnabled: isProxyEnabled$2,
|
8575 | isNaN: isNaN$2
|
8576 | };
|
8577 |
|
8578 |
|
8579 |
|
8580 |
|
8581 |
|
8582 |
|
8583 |
|
8584 |
|
8585 |
|
8586 |
|
8587 | var assertion = function (_chai, util) {
|
8588 | |
8589 |
|
8590 |
|
8591 |
|
8592 | var AssertionError = _chai.AssertionError
|
8593 | , flag = util.flag;
|
8594 |
|
8595 | |
8596 |
|
8597 |
|
8598 |
|
8599 | _chai.Assertion = Assertion;
|
8600 |
|
8601 | |
8602 |
|
8603 |
|
8604 |
|
8605 |
|
8606 |
|
8607 |
|
8608 |
|
8609 |
|
8610 |
|
8611 |
|
8612 |
|
8613 |
|
8614 |
|
8615 |
|
8616 |
|
8617 |
|
8618 |
|
8619 |
|
8620 |
|
8621 |
|
8622 |
|
8623 |
|
8624 |
|
8625 |
|
8626 |
|
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
|
8632 |
|
8633 |
|
8634 |
|
8635 |
|
8636 |
|
8637 |
|
8638 |
|
8639 | function Assertion (obj, msg, ssfi, lockSsfi) {
|
8640 | flag(this, 'ssfi', ssfi || Assertion);
|
8641 | flag(this, 'lockSsfi', lockSsfi);
|
8642 | flag(this, 'object', obj);
|
8643 | flag(this, 'message', msg);
|
8644 |
|
8645 | return util.proxify(this);
|
8646 | }
|
8647 |
|
8648 | Object.defineProperty(Assertion, 'includeStack', {
|
8649 | get: function() {
|
8650 | console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
|
8651 | return config.includeStack;
|
8652 | },
|
8653 | set: function(value) {
|
8654 | console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
|
8655 | config.includeStack = value;
|
8656 | }
|
8657 | });
|
8658 |
|
8659 | Object.defineProperty(Assertion, 'showDiff', {
|
8660 | get: function() {
|
8661 | console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
|
8662 | return config.showDiff;
|
8663 | },
|
8664 | set: function(value) {
|
8665 | console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
|
8666 | config.showDiff = value;
|
8667 | }
|
8668 | });
|
8669 |
|
8670 | Assertion.addProperty = function (name, fn) {
|
8671 | util.addProperty(this.prototype, name, fn);
|
8672 | };
|
8673 |
|
8674 | Assertion.addMethod = function (name, fn) {
|
8675 | util.addMethod(this.prototype, name, fn);
|
8676 | };
|
8677 |
|
8678 | Assertion.addChainableMethod = function (name, fn, chainingBehavior) {
|
8679 | util.addChainableMethod(this.prototype, name, fn, chainingBehavior);
|
8680 | };
|
8681 |
|
8682 | Assertion.overwriteProperty = function (name, fn) {
|
8683 | util.overwriteProperty(this.prototype, name, fn);
|
8684 | };
|
8685 |
|
8686 | Assertion.overwriteMethod = function (name, fn) {
|
8687 | util.overwriteMethod(this.prototype, name, fn);
|
8688 | };
|
8689 |
|
8690 | Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
|
8691 | util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
|
8692 | };
|
8693 |
|
8694 | |
8695 |
|
8696 |
|
8697 |
|
8698 |
|
8699 |
|
8700 |
|
8701 |
|
8702 |
|
8703 |
|
8704 |
|
8705 |
|
8706 |
|
8707 |
|
8708 |
|
8709 | Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
|
8710 | var ok = util.test(this, arguments);
|
8711 | if (false !== showDiff) showDiff = true;
|
8712 | if (undefined === expected && undefined === _actual) showDiff = false;
|
8713 | if (true !== config.showDiff) showDiff = false;
|
8714 |
|
8715 | if (!ok) {
|
8716 | msg = util.getMessage(this, arguments);
|
8717 | var actual = util.getActual(this, arguments);
|
8718 | throw new AssertionError(msg, {
|
8719 | actual: actual
|
8720 | , expected: expected
|
8721 | , showDiff: showDiff
|
8722 | }, (config.includeStack) ? this.assert : flag(this, 'ssfi'));
|
8723 | }
|
8724 | };
|
8725 |
|
8726 | |
8727 |
|
8728 |
|
8729 |
|
8730 |
|
8731 |
|
8732 |
|
8733 |
|
8734 | Object.defineProperty(Assertion.prototype, '_obj',
|
8735 | { get: function () {
|
8736 | return flag(this, 'object');
|
8737 | }
|
8738 | , set: function (val) {
|
8739 | flag(this, 'object', val);
|
8740 | }
|
8741 | });
|
8742 | };
|
8743 |
|
8744 |
|
8745 |
|
8746 |
|
8747 |
|
8748 |
|
8749 |
|
8750 |
|
8751 | var assertions = function (chai, _) {
|
8752 | var Assertion = chai.Assertion
|
8753 | , AssertionError = chai.AssertionError
|
8754 | , flag = _.flag;
|
8755 |
|
8756 | |
8757 |
|
8758 |
|
8759 |
|
8760 |
|
8761 |
|
8762 |
|
8763 |
|
8764 |
|
8765 |
|
8766 |
|
8767 |
|
8768 |
|
8769 |
|
8770 |
|
8771 |
|
8772 |
|
8773 |
|
8774 |
|
8775 |
|
8776 |
|
8777 |
|
8778 |
|
8779 |
|
8780 |
|
8781 |
|
8782 |
|
8783 |
|
8784 |
|
8785 | [ 'to', 'be', 'been'
|
8786 | , 'is', 'and', 'has', 'have'
|
8787 | , 'with', 'that', 'which', 'at'
|
8788 | , 'of', 'same', 'but', 'does' ].forEach(function (chain) {
|
8789 | Assertion.addProperty(chain);
|
8790 | });
|
8791 |
|
8792 | |
8793 |
|
8794 |
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 |
|
8800 |
|
8801 |
|
8802 |
|
8803 |
|
8804 |
|
8805 |
|
8806 |
|
8807 |
|
8808 |
|
8809 |
|
8810 |
|
8811 |
|
8812 |
|
8813 |
|
8814 |
|
8815 | Assertion.addProperty('not', function () {
|
8816 | flag(this, 'negate', true);
|
8817 | });
|
8818 |
|
8819 | |
8820 |
|
8821 |
|
8822 |
|
8823 |
|
8824 |
|
8825 |
|
8826 |
|
8827 |
|
8828 |
|
8829 |
|
8830 |
|
8831 |
|
8832 |
|
8833 |
|
8834 |
|
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 |
|
8841 |
|
8842 |
|
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 | Assertion.addProperty('deep', function () {
|
8857 | flag(this, 'deep', true);
|
8858 | });
|
8859 |
|
8860 | |
8861 |
|
8862 |
|
8863 |
|
8864 |
|
8865 |
|
8866 |
|
8867 |
|
8868 |
|
8869 |
|
8870 |
|
8871 |
|
8872 |
|
8873 |
|
8874 |
|
8875 |
|
8876 |
|
8877 |
|
8878 |
|
8879 |
|
8880 |
|
8881 |
|
8882 | Assertion.addProperty('nested', function () {
|
8883 | flag(this, 'nested', true);
|
8884 | });
|
8885 |
|
8886 | |
8887 |
|
8888 |
|
8889 |
|
8890 |
|
8891 |
|
8892 |
|
8893 |
|
8894 |
|
8895 |
|
8896 |
|
8897 |
|
8898 |
|
8899 |
|
8900 |
|
8901 |
|
8902 |
|
8903 |
|
8904 |
|
8905 |
|
8906 |
|
8907 | Assertion.addProperty('own', function () {
|
8908 | flag(this, 'own', true);
|
8909 | });
|
8910 |
|
8911 | |
8912 |
|
8913 |
|
8914 |
|
8915 |
|
8916 |
|
8917 |
|
8918 |
|
8919 |
|
8920 |
|
8921 |
|
8922 |
|
8923 |
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 |
|
8930 |
|
8931 | Assertion.addProperty('ordered', function () {
|
8932 | flag(this, 'ordered', true);
|
8933 | });
|
8934 |
|
8935 | |
8936 |
|
8937 |
|
8938 |
|
8939 |
|
8940 |
|
8941 |
|
8942 |
|
8943 |
|
8944 |
|
8945 |
|
8946 |
|
8947 |
|
8948 |
|
8949 |
|
8950 |
|
8951 | Assertion.addProperty('any', function () {
|
8952 | flag(this, 'any', true);
|
8953 | flag(this, 'all', false);
|
8954 | });
|
8955 |
|
8956 |
|
8957 | |
8958 |
|
8959 |
|
8960 |
|
8961 |
|
8962 |
|
8963 |
|
8964 |
|
8965 |
|
8966 |
|
8967 |
|
8968 |
|
8969 |
|
8970 |
|
8971 |
|
8972 |
|
8973 |
|
8974 |
|
8975 |
|
8976 |
|
8977 | Assertion.addProperty('all', function () {
|
8978 | flag(this, 'all', true);
|
8979 | flag(this, 'any', false);
|
8980 | });
|
8981 |
|
8982 | |
8983 |
|
8984 |
|
8985 |
|
8986 |
|
8987 |
|
8988 |
|
8989 |
|
8990 |
|
8991 |
|
8992 |
|
8993 |
|
8994 |
|
8995 |
|
8996 |
|
8997 |
|
8998 |
|
8999 |
|
9000 |
|
9001 |
|
9002 |
|
9003 |
|
9004 |
|
9005 |
|
9006 |
|
9007 |
|
9008 |
|
9009 |
|
9010 |
|
9011 |
|
9012 |
|
9013 |
|
9014 |
|
9015 |
|
9016 |
|
9017 |
|
9018 |
|
9019 |
|
9020 |
|
9021 |
|
9022 |
|
9023 |
|
9024 |
|
9025 |
|
9026 |
|
9027 |
|
9028 |
|
9029 |
|
9030 |
|
9031 |
|
9032 |
|
9033 |
|
9034 |
|
9035 |
|
9036 |
|
9037 |
|
9038 |
|
9039 |
|
9040 |
|
9041 |
|
9042 | function an (type, msg) {
|
9043 | if (msg) flag(this, 'message', msg);
|
9044 | type = type.toLowerCase();
|
9045 | var obj = flag(this, 'object')
|
9046 | , article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a ';
|
9047 |
|
9048 | this.assert(
|
9049 | type === _.type(obj).toLowerCase()
|
9050 | , 'expected #{this} to be ' + article + type
|
9051 | , 'expected #{this} not to be ' + article + type
|
9052 | );
|
9053 | }
|
9054 |
|
9055 | Assertion.addChainableMethod('an', an);
|
9056 | Assertion.addChainableMethod('a', an);
|
9057 |
|
9058 | |
9059 |
|
9060 |
|
9061 |
|
9062 |
|
9063 |
|
9064 |
|
9065 |
|
9066 |
|
9067 |
|
9068 |
|
9069 |
|
9070 |
|
9071 |
|
9072 |
|
9073 |
|
9074 |
|
9075 |
|
9076 |
|
9077 |
|
9078 |
|
9079 |
|
9080 |
|
9081 |
|
9082 |
|
9083 |
|
9084 |
|
9085 |
|
9086 |
|
9087 |
|
9088 |
|
9089 |
|
9090 |
|
9091 |
|
9092 |
|
9093 |
|
9094 |
|
9095 |
|
9096 |
|
9097 |
|
9098 |
|
9099 |
|
9100 |
|
9101 |
|
9102 |
|
9103 |
|
9104 |
|
9105 |
|
9106 |
|
9107 |
|
9108 |
|
9109 |
|
9110 |
|
9111 |
|
9112 |
|
9113 |
|
9114 |
|
9115 |
|
9116 |
|
9117 |
|
9118 |
|
9119 |
|
9120 |
|
9121 |
|
9122 |
|
9123 |
|
9124 |
|
9125 |
|
9126 |
|
9127 |
|
9128 |
|
9129 |
|
9130 |
|
9131 |
|
9132 |
|
9133 |
|
9134 |
|
9135 |
|
9136 |
|
9137 |
|
9138 |
|
9139 |
|
9140 |
|
9141 |
|
9142 |
|
9143 |
|
9144 |
|
9145 |
|
9146 |
|
9147 |
|
9148 |
|
9149 |
|
9150 |
|
9151 |
|
9152 |
|
9153 |
|
9154 |
|
9155 |
|
9156 |
|
9157 |
|
9158 |
|
9159 |
|
9160 |
|
9161 |
|
9162 |
|
9163 |
|
9164 |
|
9165 |
|
9166 |
|
9167 |
|
9168 |
|
9169 |
|
9170 |
|
9171 |
|
9172 |
|
9173 |
|
9174 |
|
9175 |
|
9176 |
|
9177 |
|
9178 |
|
9179 |
|
9180 |
|
9181 |
|
9182 |
|
9183 |
|
9184 |
|
9185 |
|
9186 |
|
9187 |
|
9188 |
|
9189 |
|
9190 |
|
9191 |
|
9192 |
|
9193 |
|
9194 |
|
9195 |
|
9196 |
|
9197 |
|
9198 |
|
9199 |
|
9200 |
|
9201 |
|
9202 |
|
9203 |
|
9204 |
|
9205 | function SameValueZero(a, b) {
|
9206 | return (_.isNaN(a) && _.isNaN(b)) || a === b;
|
9207 | }
|
9208 |
|
9209 | function includeChainingBehavior () {
|
9210 | flag(this, 'contains', true);
|
9211 | }
|
9212 |
|
9213 | function include (val, msg) {
|
9214 | if (msg) flag(this, 'message', msg);
|
9215 |
|
9216 | var obj = flag(this, 'object')
|
9217 | , objType = _.type(obj).toLowerCase()
|
9218 | , flagMsg = flag(this, 'message')
|
9219 | , negate = flag(this, 'negate')
|
9220 | , ssfi = flag(this, 'ssfi')
|
9221 | , isDeep = flag(this, 'deep')
|
9222 | , descriptor = isDeep ? 'deep ' : '';
|
9223 |
|
9224 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
9225 |
|
9226 | var included = false;
|
9227 |
|
9228 | switch (objType) {
|
9229 | case 'string':
|
9230 | included = obj.indexOf(val) !== -1;
|
9231 | break;
|
9232 |
|
9233 | case 'weakset':
|
9234 | if (isDeep) {
|
9235 | throw new AssertionError(
|
9236 | flagMsg + 'unable to use .deep.include with WeakSet',
|
9237 | undefined,
|
9238 | ssfi
|
9239 | );
|
9240 | }
|
9241 |
|
9242 | included = obj.has(val);
|
9243 | break;
|
9244 |
|
9245 | case 'map':
|
9246 | var isEql = isDeep ? _.eql : SameValueZero;
|
9247 | obj.forEach(function (item) {
|
9248 | included = included || isEql(item, val);
|
9249 | });
|
9250 | break;
|
9251 |
|
9252 | case 'set':
|
9253 | if (isDeep) {
|
9254 | obj.forEach(function (item) {
|
9255 | included = included || _.eql(item, val);
|
9256 | });
|
9257 | } else {
|
9258 | included = obj.has(val);
|
9259 | }
|
9260 | break;
|
9261 |
|
9262 | case 'array':
|
9263 | if (isDeep) {
|
9264 | included = obj.some(function (item) {
|
9265 | return _.eql(item, val);
|
9266 | });
|
9267 | } else {
|
9268 | included = obj.indexOf(val) !== -1;
|
9269 | }
|
9270 | break;
|
9271 |
|
9272 | default:
|
9273 |
|
9274 |
|
9275 |
|
9276 | if (val !== Object(val)) {
|
9277 | throw new AssertionError(
|
9278 | flagMsg + 'object tested must be an array, a map, an object,'
|
9279 | + ' a set, a string, or a weakset, but ' + objType + ' given',
|
9280 | undefined,
|
9281 | ssfi
|
9282 | );
|
9283 | }
|
9284 |
|
9285 | var props = Object.keys(val)
|
9286 | , firstErr = null
|
9287 | , numErrs = 0;
|
9288 |
|
9289 | props.forEach(function (prop) {
|
9290 | var propAssertion = new Assertion(obj);
|
9291 | _.transferFlags(this, propAssertion, true);
|
9292 | flag(propAssertion, 'lockSsfi', true);
|
9293 |
|
9294 | if (!negate || props.length === 1) {
|
9295 | propAssertion.property(prop, val[prop]);
|
9296 | return;
|
9297 | }
|
9298 |
|
9299 | try {
|
9300 | propAssertion.property(prop, val[prop]);
|
9301 | } catch (err) {
|
9302 | if (!_.checkError.compatibleConstructor(err, AssertionError)) {
|
9303 | throw err;
|
9304 | }
|
9305 | if (firstErr === null) firstErr = err;
|
9306 | numErrs++;
|
9307 | }
|
9308 | }, this);
|
9309 |
|
9310 |
|
9311 |
|
9312 |
|
9313 |
|
9314 | if (negate && props.length > 1 && numErrs === props.length) {
|
9315 | throw firstErr;
|
9316 | }
|
9317 | return;
|
9318 | }
|
9319 |
|
9320 |
|
9321 | this.assert(
|
9322 | included
|
9323 | , 'expected #{this} to ' + descriptor + 'include ' + _.inspect(val)
|
9324 | , 'expected #{this} to not ' + descriptor + 'include ' + _.inspect(val));
|
9325 | }
|
9326 |
|
9327 | Assertion.addChainableMethod('include', include, includeChainingBehavior);
|
9328 | Assertion.addChainableMethod('contain', include, includeChainingBehavior);
|
9329 | Assertion.addChainableMethod('contains', include, includeChainingBehavior);
|
9330 | Assertion.addChainableMethod('includes', include, includeChainingBehavior);
|
9331 |
|
9332 | |
9333 |
|
9334 |
|
9335 |
|
9336 |
|
9337 |
|
9338 |
|
9339 |
|
9340 |
|
9341 |
|
9342 |
|
9343 |
|
9344 |
|
9345 |
|
9346 |
|
9347 |
|
9348 |
|
9349 |
|
9350 |
|
9351 |
|
9352 |
|
9353 |
|
9354 |
|
9355 |
|
9356 |
|
9357 |
|
9358 |
|
9359 |
|
9360 |
|
9361 |
|
9362 |
|
9363 |
|
9364 |
|
9365 |
|
9366 |
|
9367 |
|
9368 | Assertion.addProperty('ok', function () {
|
9369 | this.assert(
|
9370 | flag(this, 'object')
|
9371 | , 'expected #{this} to be truthy'
|
9372 | , 'expected #{this} to be falsy');
|
9373 | });
|
9374 |
|
9375 | |
9376 |
|
9377 |
|
9378 |
|
9379 |
|
9380 |
|
9381 |
|
9382 |
|
9383 |
|
9384 |
|
9385 |
|
9386 |
|
9387 |
|
9388 |
|
9389 |
|
9390 |
|
9391 |
|
9392 |
|
9393 |
|
9394 |
|
9395 |
|
9396 |
|
9397 |
|
9398 |
|
9399 |
|
9400 |
|
9401 | Assertion.addProperty('true', function () {
|
9402 | this.assert(
|
9403 | true === flag(this, 'object')
|
9404 | , 'expected #{this} to be true'
|
9405 | , 'expected #{this} to be false'
|
9406 | , flag(this, 'negate') ? false : true
|
9407 | );
|
9408 | });
|
9409 |
|
9410 | |
9411 |
|
9412 |
|
9413 |
|
9414 |
|
9415 |
|
9416 |
|
9417 |
|
9418 |
|
9419 |
|
9420 |
|
9421 |
|
9422 |
|
9423 |
|
9424 |
|
9425 |
|
9426 |
|
9427 |
|
9428 |
|
9429 |
|
9430 |
|
9431 |
|
9432 |
|
9433 |
|
9434 |
|
9435 |
|
9436 | Assertion.addProperty('false', function () {
|
9437 | this.assert(
|
9438 | false === flag(this, 'object')
|
9439 | , 'expected #{this} to be false'
|
9440 | , 'expected #{this} to be true'
|
9441 | , flag(this, 'negate') ? true : false
|
9442 | );
|
9443 | });
|
9444 |
|
9445 | |
9446 |
|
9447 |
|
9448 |
|
9449 |
|
9450 |
|
9451 |
|
9452 |
|
9453 |
|
9454 |
|
9455 |
|
9456 |
|
9457 |
|
9458 |
|
9459 |
|
9460 |
|
9461 |
|
9462 |
|
9463 |
|
9464 |
|
9465 |
|
9466 |
|
9467 |
|
9468 | Assertion.addProperty('null', function () {
|
9469 | this.assert(
|
9470 | null === flag(this, 'object')
|
9471 | , 'expected #{this} to be null'
|
9472 | , 'expected #{this} not to be null'
|
9473 | );
|
9474 | });
|
9475 |
|
9476 | |
9477 |
|
9478 |
|
9479 |
|
9480 |
|
9481 |
|
9482 |
|
9483 |
|
9484 |
|
9485 |
|
9486 |
|
9487 |
|
9488 |
|
9489 |
|
9490 |
|
9491 |
|
9492 |
|
9493 |
|
9494 |
|
9495 |
|
9496 |
|
9497 |
|
9498 |
|
9499 | Assertion.addProperty('undefined', function () {
|
9500 | this.assert(
|
9501 | undefined === flag(this, 'object')
|
9502 | , 'expected #{this} to be undefined'
|
9503 | , 'expected #{this} not to be undefined'
|
9504 | );
|
9505 | });
|
9506 |
|
9507 | |
9508 |
|
9509 |
|
9510 |
|
9511 |
|
9512 |
|
9513 |
|
9514 |
|
9515 |
|
9516 |
|
9517 |
|
9518 |
|
9519 |
|
9520 |
|
9521 |
|
9522 |
|
9523 |
|
9524 |
|
9525 |
|
9526 |
|
9527 |
|
9528 |
|
9529 |
|
9530 | Assertion.addProperty('NaN', function () {
|
9531 | this.assert(
|
9532 | _.isNaN(flag(this, 'object'))
|
9533 | , 'expected #{this} to be NaN'
|
9534 | , 'expected #{this} not to be NaN'
|
9535 | );
|
9536 | });
|
9537 |
|
9538 | |
9539 |
|
9540 |
|
9541 |
|
9542 |
|
9543 |
|
9544 |
|
9545 |
|
9546 |
|
9547 |
|
9548 |
|
9549 |
|
9550 |
|
9551 |
|
9552 |
|
9553 |
|
9554 |
|
9555 |
|
9556 |
|
9557 |
|
9558 |
|
9559 |
|
9560 |
|
9561 |
|
9562 |
|
9563 |
|
9564 |
|
9565 |
|
9566 |
|
9567 |
|
9568 | Assertion.addProperty('exist', function () {
|
9569 | var val = flag(this, 'object');
|
9570 | this.assert(
|
9571 | val !== null && val !== undefined
|
9572 | , 'expected #{this} to exist'
|
9573 | , 'expected #{this} to not exist'
|
9574 | );
|
9575 | });
|
9576 |
|
9577 | |
9578 |
|
9579 |
|
9580 |
|
9581 |
|
9582 |
|
9583 |
|
9584 |
|
9585 |
|
9586 |
|
9587 |
|
9588 |
|
9589 |
|
9590 |
|
9591 |
|
9592 |
|
9593 |
|
9594 |
|
9595 |
|
9596 |
|
9597 |
|
9598 |
|
9599 |
|
9600 |
|
9601 |
|
9602 |
|
9603 |
|
9604 |
|
9605 |
|
9606 |
|
9607 |
|
9608 |
|
9609 |
|
9610 |
|
9611 |
|
9612 |
|
9613 |
|
9614 |
|
9615 |
|
9616 |
|
9617 |
|
9618 |
|
9619 |
|
9620 |
|
9621 |
|
9622 |
|
9623 |
|
9624 |
|
9625 |
|
9626 | Assertion.addProperty('empty', function () {
|
9627 | var val = flag(this, 'object')
|
9628 | , ssfi = flag(this, 'ssfi')
|
9629 | , flagMsg = flag(this, 'message')
|
9630 | , itemsCount;
|
9631 |
|
9632 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
9633 |
|
9634 | switch (_.type(val).toLowerCase()) {
|
9635 | case 'array':
|
9636 | case 'string':
|
9637 | itemsCount = val.length;
|
9638 | break;
|
9639 | case 'map':
|
9640 | case 'set':
|
9641 | itemsCount = val.size;
|
9642 | break;
|
9643 | case 'weakmap':
|
9644 | case 'weakset':
|
9645 | throw new AssertionError(
|
9646 | flagMsg + '.empty was passed a weak collection',
|
9647 | undefined,
|
9648 | ssfi
|
9649 | );
|
9650 | case 'function':
|
9651 | var msg = flagMsg + '.empty was passed a function ' + _.getName(val);
|
9652 | throw new AssertionError(msg.trim(), undefined, ssfi);
|
9653 | default:
|
9654 | if (val !== Object(val)) {
|
9655 | throw new AssertionError(
|
9656 | flagMsg + '.empty was passed non-string primitive ' + _.inspect(val),
|
9657 | undefined,
|
9658 | ssfi
|
9659 | );
|
9660 | }
|
9661 | itemsCount = Object.keys(val).length;
|
9662 | }
|
9663 |
|
9664 | this.assert(
|
9665 | 0 === itemsCount
|
9666 | , 'expected #{this} to be empty'
|
9667 | , 'expected #{this} not to be empty'
|
9668 | );
|
9669 | });
|
9670 |
|
9671 | |
9672 |
|
9673 |
|
9674 |
|
9675 |
|
9676 |
|
9677 |
|
9678 |
|
9679 |
|
9680 |
|
9681 |
|
9682 |
|
9683 |
|
9684 |
|
9685 |
|
9686 |
|
9687 |
|
9688 |
|
9689 |
|
9690 |
|
9691 |
|
9692 |
|
9693 |
|
9694 |
|
9695 |
|
9696 |
|
9697 |
|
9698 |
|
9699 |
|
9700 |
|
9701 | function checkArguments () {
|
9702 | var obj = flag(this, 'object')
|
9703 | , type = _.type(obj);
|
9704 | this.assert(
|
9705 | 'Arguments' === type
|
9706 | , 'expected #{this} to be arguments but got ' + type
|
9707 | , 'expected #{this} to not be arguments'
|
9708 | );
|
9709 | }
|
9710 |
|
9711 | Assertion.addProperty('arguments', checkArguments);
|
9712 | Assertion.addProperty('Arguments', checkArguments);
|
9713 |
|
9714 | |
9715 |
|
9716 |
|
9717 |
|
9718 |
|
9719 |
|
9720 |
|
9721 |
|
9722 |
|
9723 |
|
9724 |
|
9725 |
|
9726 |
|
9727 |
|
9728 |
|
9729 |
|
9730 |
|
9731 |
|
9732 |
|
9733 |
|
9734 |
|
9735 |
|
9736 |
|
9737 |
|
9738 |
|
9739 |
|
9740 |
|
9741 |
|
9742 |
|
9743 |
|
9744 |
|
9745 |
|
9746 |
|
9747 |
|
9748 |
|
9749 |
|
9750 |
|
9751 |
|
9752 |
|
9753 |
|
9754 |
|
9755 |
|
9756 |
|
9757 |
|
9758 |
|
9759 | function assertEqual (val, msg) {
|
9760 | if (msg) flag(this, 'message', msg);
|
9761 | var obj = flag(this, 'object');
|
9762 | if (flag(this, 'deep')) {
|
9763 | return this.eql(val);
|
9764 | } else {
|
9765 | this.assert(
|
9766 | val === obj
|
9767 | , 'expected #{this} to equal #{exp}'
|
9768 | , 'expected #{this} to not equal #{exp}'
|
9769 | , val
|
9770 | , this._obj
|
9771 | , true
|
9772 | );
|
9773 | }
|
9774 | }
|
9775 |
|
9776 | Assertion.addMethod('equal', assertEqual);
|
9777 | Assertion.addMethod('equals', assertEqual);
|
9778 | Assertion.addMethod('eq', assertEqual);
|
9779 |
|
9780 | |
9781 |
|
9782 |
|
9783 |
|
9784 |
|
9785 |
|
9786 |
|
9787 |
|
9788 |
|
9789 |
|
9790 |
|
9791 |
|
9792 |
|
9793 |
|
9794 |
|
9795 |
|
9796 |
|
9797 |
|
9798 |
|
9799 |
|
9800 |
|
9801 |
|
9802 |
|
9803 |
|
9804 |
|
9805 |
|
9806 |
|
9807 |
|
9808 |
|
9809 |
|
9810 |
|
9811 |
|
9812 |
|
9813 |
|
9814 |
|
9815 |
|
9816 |
|
9817 |
|
9818 |
|
9819 |
|
9820 |
|
9821 | function assertEql(obj, msg) {
|
9822 | if (msg) flag(this, 'message', msg);
|
9823 | this.assert(
|
9824 | _.eql(obj, flag(this, 'object'))
|
9825 | , 'expected #{this} to deeply equal #{exp}'
|
9826 | , 'expected #{this} to not deeply equal #{exp}'
|
9827 | , obj
|
9828 | , this._obj
|
9829 | , true
|
9830 | );
|
9831 | }
|
9832 |
|
9833 | Assertion.addMethod('eql', assertEql);
|
9834 | Assertion.addMethod('eqls', assertEql);
|
9835 |
|
9836 | |
9837 |
|
9838 |
|
9839 |
|
9840 |
|
9841 |
|
9842 |
|
9843 |
|
9844 |
|
9845 |
|
9846 |
|
9847 |
|
9848 |
|
9849 |
|
9850 |
|
9851 |
|
9852 |
|
9853 |
|
9854 |
|
9855 |
|
9856 |
|
9857 |
|
9858 |
|
9859 |
|
9860 |
|
9861 |
|
9862 |
|
9863 |
|
9864 |
|
9865 |
|
9866 |
|
9867 |
|
9868 |
|
9869 |
|
9870 |
|
9871 |
|
9872 |
|
9873 |
|
9874 |
|
9875 |
|
9876 |
|
9877 |
|
9878 |
|
9879 | function assertAbove (n, msg) {
|
9880 | if (msg) flag(this, 'message', msg);
|
9881 | var obj = flag(this, 'object')
|
9882 | , doLength = flag(this, 'doLength')
|
9883 | , flagMsg = flag(this, 'message')
|
9884 | , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '')
|
9885 | , ssfi = flag(this, 'ssfi')
|
9886 | , objType = _.type(obj).toLowerCase()
|
9887 | , nType = _.type(n).toLowerCase()
|
9888 | , shouldThrow = true;
|
9889 |
|
9890 | if (doLength) {
|
9891 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
9892 | }
|
9893 |
|
9894 | if (!doLength && (objType === 'date' && nType !== 'date')) {
|
9895 | errorMessage = msgPrefix + 'the argument to above must be a date';
|
9896 | } else if (nType !== 'number' && (doLength || objType === 'number')) {
|
9897 | errorMessage = msgPrefix + 'the argument to above must be a number';
|
9898 | } else if (!doLength && (objType !== 'date' && objType !== 'number')) {
|
9899 | var printObj = (objType === 'string') ? "'" + obj + "'" : obj;
|
9900 | errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
|
9901 | } else {
|
9902 | shouldThrow = false;
|
9903 | }
|
9904 |
|
9905 | if (shouldThrow) {
|
9906 | throw new AssertionError(errorMessage, undefined, ssfi);
|
9907 | }
|
9908 |
|
9909 | if (doLength) {
|
9910 | var len = obj.length;
|
9911 | this.assert(
|
9912 | len > n
|
9913 | , 'expected #{this} to have a length above #{exp} but got #{act}'
|
9914 | , 'expected #{this} to not have a length above #{exp}'
|
9915 | , n
|
9916 | , len
|
9917 | );
|
9918 | } else {
|
9919 | this.assert(
|
9920 | obj > n
|
9921 | , 'expected #{this} to be above #{exp}'
|
9922 | , 'expected #{this} to be at most #{exp}'
|
9923 | , n
|
9924 | );
|
9925 | }
|
9926 | }
|
9927 |
|
9928 | Assertion.addMethod('above', assertAbove);
|
9929 | Assertion.addMethod('gt', assertAbove);
|
9930 | Assertion.addMethod('greaterThan', assertAbove);
|
9931 |
|
9932 | |
9933 |
|
9934 |
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 |
|
9940 |
|
9941 |
|
9942 |
|
9943 |
|
9944 |
|
9945 |
|
9946 |
|
9947 |
|
9948 |
|
9949 |
|
9950 |
|
9951 |
|
9952 |
|
9953 |
|
9954 |
|
9955 |
|
9956 |
|
9957 |
|
9958 |
|
9959 |
|
9960 |
|
9961 |
|
9962 |
|
9963 |
|
9964 |
|
9965 |
|
9966 |
|
9967 |
|
9968 |
|
9969 |
|
9970 |
|
9971 |
|
9972 |
|
9973 |
|
9974 |
|
9975 | function assertLeast (n, msg) {
|
9976 | if (msg) flag(this, 'message', msg);
|
9977 | var obj = flag(this, 'object')
|
9978 | , doLength = flag(this, 'doLength')
|
9979 | , flagMsg = flag(this, 'message')
|
9980 | , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '')
|
9981 | , ssfi = flag(this, 'ssfi')
|
9982 | , objType = _.type(obj).toLowerCase()
|
9983 | , nType = _.type(n).toLowerCase()
|
9984 | , shouldThrow = true;
|
9985 |
|
9986 | if (doLength) {
|
9987 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
9988 | }
|
9989 |
|
9990 | if (!doLength && (objType === 'date' && nType !== 'date')) {
|
9991 | errorMessage = msgPrefix + 'the argument to least must be a date';
|
9992 | } else if (nType !== 'number' && (doLength || objType === 'number')) {
|
9993 | errorMessage = msgPrefix + 'the argument to least must be a number';
|
9994 | } else if (!doLength && (objType !== 'date' && objType !== 'number')) {
|
9995 | var printObj = (objType === 'string') ? "'" + obj + "'" : obj;
|
9996 | errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
|
9997 | } else {
|
9998 | shouldThrow = false;
|
9999 | }
|
10000 |
|
10001 | if (shouldThrow) {
|
10002 | throw new AssertionError(errorMessage, undefined, ssfi);
|
10003 | }
|
10004 |
|
10005 | if (doLength) {
|
10006 | var len = obj.length;
|
10007 | this.assert(
|
10008 | len >= n
|
10009 | , 'expected #{this} to have a length at least #{exp} but got #{act}'
|
10010 | , 'expected #{this} to have a length below #{exp}'
|
10011 | , n
|
10012 | , len
|
10013 | );
|
10014 | } else {
|
10015 | this.assert(
|
10016 | obj >= n
|
10017 | , 'expected #{this} to be at least #{exp}'
|
10018 | , 'expected #{this} to be below #{exp}'
|
10019 | , n
|
10020 | );
|
10021 | }
|
10022 | }
|
10023 |
|
10024 | Assertion.addMethod('least', assertLeast);
|
10025 | Assertion.addMethod('gte', assertLeast);
|
10026 |
|
10027 | |
10028 |
|
10029 |
|
10030 |
|
10031 |
|
10032 |
|
10033 |
|
10034 |
|
10035 |
|
10036 |
|
10037 |
|
10038 |
|
10039 |
|
10040 |
|
10041 |
|
10042 |
|
10043 |
|
10044 |
|
10045 |
|
10046 |
|
10047 |
|
10048 |
|
10049 |
|
10050 |
|
10051 |
|
10052 |
|
10053 |
|
10054 |
|
10055 |
|
10056 |
|
10057 |
|
10058 |
|
10059 |
|
10060 |
|
10061 |
|
10062 |
|
10063 |
|
10064 |
|
10065 |
|
10066 |
|
10067 |
|
10068 |
|
10069 |
|
10070 | function assertBelow (n, msg) {
|
10071 | if (msg) flag(this, 'message', msg);
|
10072 | var obj = flag(this, 'object')
|
10073 | , doLength = flag(this, 'doLength')
|
10074 | , flagMsg = flag(this, 'message')
|
10075 | , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '')
|
10076 | , ssfi = flag(this, 'ssfi')
|
10077 | , objType = _.type(obj).toLowerCase()
|
10078 | , nType = _.type(n).toLowerCase()
|
10079 | , shouldThrow = true;
|
10080 |
|
10081 | if (doLength) {
|
10082 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
10083 | }
|
10084 |
|
10085 | if (!doLength && (objType === 'date' && nType !== 'date')) {
|
10086 | errorMessage = msgPrefix + 'the argument to below must be a date';
|
10087 | } else if (nType !== 'number' && (doLength || objType === 'number')) {
|
10088 | errorMessage = msgPrefix + 'the argument to below must be a number';
|
10089 | } else if (!doLength && (objType !== 'date' && objType !== 'number')) {
|
10090 | var printObj = (objType === 'string') ? "'" + obj + "'" : obj;
|
10091 | errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
|
10092 | } else {
|
10093 | shouldThrow = false;
|
10094 | }
|
10095 |
|
10096 | if (shouldThrow) {
|
10097 | throw new AssertionError(errorMessage, undefined, ssfi);
|
10098 | }
|
10099 |
|
10100 | if (doLength) {
|
10101 | var len = obj.length;
|
10102 | this.assert(
|
10103 | len < n
|
10104 | , 'expected #{this} to have a length below #{exp} but got #{act}'
|
10105 | , 'expected #{this} to not have a length below #{exp}'
|
10106 | , n
|
10107 | , len
|
10108 | );
|
10109 | } else {
|
10110 | this.assert(
|
10111 | obj < n
|
10112 | , 'expected #{this} to be below #{exp}'
|
10113 | , 'expected #{this} to be at least #{exp}'
|
10114 | , n
|
10115 | );
|
10116 | }
|
10117 | }
|
10118 |
|
10119 | Assertion.addMethod('below', assertBelow);
|
10120 | Assertion.addMethod('lt', assertBelow);
|
10121 | Assertion.addMethod('lessThan', assertBelow);
|
10122 |
|
10123 | |
10124 |
|
10125 |
|
10126 |
|
10127 |
|
10128 |
|
10129 |
|
10130 |
|
10131 |
|
10132 |
|
10133 |
|
10134 |
|
10135 |
|
10136 |
|
10137 |
|
10138 |
|
10139 |
|
10140 |
|
10141 |
|
10142 |
|
10143 |
|
10144 |
|
10145 |
|
10146 |
|
10147 |
|
10148 |
|
10149 |
|
10150 |
|
10151 |
|
10152 |
|
10153 |
|
10154 |
|
10155 |
|
10156 |
|
10157 |
|
10158 |
|
10159 |
|
10160 |
|
10161 |
|
10162 |
|
10163 |
|
10164 |
|
10165 | function assertMost (n, msg) {
|
10166 | if (msg) flag(this, 'message', msg);
|
10167 | var obj = flag(this, 'object')
|
10168 | , doLength = flag(this, 'doLength')
|
10169 | , flagMsg = flag(this, 'message')
|
10170 | , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '')
|
10171 | , ssfi = flag(this, 'ssfi')
|
10172 | , objType = _.type(obj).toLowerCase()
|
10173 | , nType = _.type(n).toLowerCase()
|
10174 | , shouldThrow = true;
|
10175 |
|
10176 | if (doLength) {
|
10177 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
10178 | }
|
10179 |
|
10180 | if (!doLength && (objType === 'date' && nType !== 'date')) {
|
10181 | errorMessage = msgPrefix + 'the argument to most must be a date';
|
10182 | } else if (nType !== 'number' && (doLength || objType === 'number')) {
|
10183 | errorMessage = msgPrefix + 'the argument to most must be a number';
|
10184 | } else if (!doLength && (objType !== 'date' && objType !== 'number')) {
|
10185 | var printObj = (objType === 'string') ? "'" + obj + "'" : obj;
|
10186 | errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
|
10187 | } else {
|
10188 | shouldThrow = false;
|
10189 | }
|
10190 |
|
10191 | if (shouldThrow) {
|
10192 | throw new AssertionError(errorMessage, undefined, ssfi);
|
10193 | }
|
10194 |
|
10195 | if (doLength) {
|
10196 | var len = obj.length;
|
10197 | this.assert(
|
10198 | len <= n
|
10199 | , 'expected #{this} to have a length at most #{exp} but got #{act}'
|
10200 | , 'expected #{this} to have a length above #{exp}'
|
10201 | , n
|
10202 | , len
|
10203 | );
|
10204 | } else {
|
10205 | this.assert(
|
10206 | obj <= n
|
10207 | , 'expected #{this} to be at most #{exp}'
|
10208 | , 'expected #{this} to be above #{exp}'
|
10209 | , n
|
10210 | );
|
10211 | }
|
10212 | }
|
10213 |
|
10214 | Assertion.addMethod('most', assertMost);
|
10215 | Assertion.addMethod('lte', assertMost);
|
10216 |
|
10217 | |
10218 |
|
10219 |
|
10220 |
|
10221 |
|
10222 |
|
10223 |
|
10224 |
|
10225 |
|
10226 |
|
10227 |
|
10228 |
|
10229 |
|
10230 |
|
10231 |
|
10232 |
|
10233 |
|
10234 |
|
10235 |
|
10236 |
|
10237 |
|
10238 |
|
10239 |
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 |
|
10245 |
|
10246 |
|
10247 |
|
10248 |
|
10249 |
|
10250 |
|
10251 |
|
10252 |
|
10253 |
|
10254 |
|
10255 |
|
10256 |
|
10257 |
|
10258 |
|
10259 |
|
10260 | Assertion.addMethod('within', function (start, finish, msg) {
|
10261 | if (msg) flag(this, 'message', msg);
|
10262 | var obj = flag(this, 'object')
|
10263 | , doLength = flag(this, 'doLength')
|
10264 | , flagMsg = flag(this, 'message')
|
10265 | , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '')
|
10266 | , ssfi = flag(this, 'ssfi')
|
10267 | , objType = _.type(obj).toLowerCase()
|
10268 | , startType = _.type(start).toLowerCase()
|
10269 | , finishType = _.type(finish).toLowerCase()
|
10270 | , shouldThrow = true
|
10271 | , range = (startType === 'date' && finishType === 'date')
|
10272 | ? start.toUTCString() + '..' + finish.toUTCString()
|
10273 | : start + '..' + finish;
|
10274 |
|
10275 | if (doLength) {
|
10276 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
10277 | }
|
10278 |
|
10279 | if (!doLength && (objType === 'date' && (startType !== 'date' || finishType !== 'date'))) {
|
10280 | errorMessage = msgPrefix + 'the arguments to within must be dates';
|
10281 | } else if ((startType !== 'number' || finishType !== 'number') && (doLength || objType === 'number')) {
|
10282 | errorMessage = msgPrefix + 'the arguments to within must be numbers';
|
10283 | } else if (!doLength && (objType !== 'date' && objType !== 'number')) {
|
10284 | var printObj = (objType === 'string') ? "'" + obj + "'" : obj;
|
10285 | errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
|
10286 | } else {
|
10287 | shouldThrow = false;
|
10288 | }
|
10289 |
|
10290 | if (shouldThrow) {
|
10291 | throw new AssertionError(errorMessage, undefined, ssfi);
|
10292 | }
|
10293 |
|
10294 | if (doLength) {
|
10295 | var len = obj.length;
|
10296 | this.assert(
|
10297 | len >= start && len <= finish
|
10298 | , 'expected #{this} to have a length within ' + range
|
10299 | , 'expected #{this} to not have a length within ' + range
|
10300 | );
|
10301 | } else {
|
10302 | this.assert(
|
10303 | obj >= start && obj <= finish
|
10304 | , 'expected #{this} to be within ' + range
|
10305 | , 'expected #{this} to not be within ' + range
|
10306 | );
|
10307 | }
|
10308 | });
|
10309 |
|
10310 | |
10311 |
|
10312 |
|
10313 |
|
10314 |
|
10315 |
|
10316 |
|
10317 |
|
10318 |
|
10319 |
|
10320 |
|
10321 |
|
10322 |
|
10323 |
|
10324 |
|
10325 |
|
10326 |
|
10327 |
|
10328 |
|
10329 |
|
10330 |
|
10331 |
|
10332 |
|
10333 |
|
10334 |
|
10335 |
|
10336 |
|
10337 |
|
10338 |
|
10339 |
|
10340 |
|
10341 |
|
10342 |
|
10343 |
|
10344 |
|
10345 |
|
10346 |
|
10347 |
|
10348 |
|
10349 | function assertInstanceOf (constructor, msg) {
|
10350 | if (msg) flag(this, 'message', msg);
|
10351 |
|
10352 | var target = flag(this, 'object');
|
10353 | var ssfi = flag(this, 'ssfi');
|
10354 | var flagMsg = flag(this, 'message');
|
10355 |
|
10356 | try {
|
10357 | var isInstanceOf = target instanceof constructor;
|
10358 | } catch (err) {
|
10359 | if (err instanceof TypeError) {
|
10360 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
10361 | throw new AssertionError(
|
10362 | flagMsg + 'The instanceof assertion needs a constructor but '
|
10363 | + _.type(constructor) + ' was given.',
|
10364 | undefined,
|
10365 | ssfi
|
10366 | );
|
10367 | }
|
10368 | throw err;
|
10369 | }
|
10370 |
|
10371 | var name = _.getName(constructor);
|
10372 | if (name === null) {
|
10373 | name = 'an unnamed constructor';
|
10374 | }
|
10375 |
|
10376 | this.assert(
|
10377 | isInstanceOf
|
10378 | , 'expected #{this} to be an instance of ' + name
|
10379 | , 'expected #{this} to not be an instance of ' + name
|
10380 | );
|
10381 | }
|
10382 |
|
10383 | Assertion.addMethod('instanceof', assertInstanceOf);
|
10384 | Assertion.addMethod('instanceOf', assertInstanceOf);
|
10385 |
|
10386 | |
10387 |
|
10388 |
|
10389 |
|
10390 |
|
10391 |
|
10392 |
|
10393 |
|
10394 |
|
10395 |
|
10396 |
|
10397 |
|
10398 |
|
10399 |
|
10400 |
|
10401 |
|
10402 |
|
10403 |
|
10404 |
|
10405 |
|
10406 |
|
10407 |
|
10408 |
|
10409 |
|
10410 |
|
10411 |
|
10412 |
|
10413 |
|
10414 |
|
10415 |
|
10416 |
|
10417 |
|
10418 |
|
10419 |
|
10420 |
|
10421 |
|
10422 |
|
10423 |
|
10424 |
|
10425 |
|
10426 |
|
10427 |
|
10428 |
|
10429 |
|
10430 |
|
10431 |
|
10432 |
|
10433 |
|
10434 |
|
10435 |
|
10436 |
|
10437 |
|
10438 |
|
10439 |
|
10440 |
|
10441 |
|
10442 |
|
10443 |
|
10444 |
|
10445 |
|
10446 |
|
10447 |
|
10448 |
|
10449 |
|
10450 |
|
10451 |
|
10452 |
|
10453 |
|
10454 |
|
10455 |
|
10456 |
|
10457 |
|
10458 |
|
10459 |
|
10460 |
|
10461 |
|
10462 |
|
10463 |
|
10464 |
|
10465 |
|
10466 |
|
10467 |
|
10468 |
|
10469 |
|
10470 |
|
10471 |
|
10472 |
|
10473 |
|
10474 |
|
10475 |
|
10476 |
|
10477 |
|
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 |
|
10483 |
|
10484 |
|
10485 |
|
10486 |
|
10487 |
|
10488 |
|
10489 |
|
10490 |
|
10491 |
|
10492 |
|
10493 |
|
10494 |
|
10495 |
|
10496 |
|
10497 | function assertProperty (name, val, msg) {
|
10498 | if (msg) flag(this, 'message', msg);
|
10499 |
|
10500 | var isNested = flag(this, 'nested')
|
10501 | , isOwn = flag(this, 'own')
|
10502 | , flagMsg = flag(this, 'message')
|
10503 | , obj = flag(this, 'object')
|
10504 | , ssfi = flag(this, 'ssfi');
|
10505 |
|
10506 | if (isNested && isOwn) {
|
10507 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
10508 | throw new AssertionError(
|
10509 | flagMsg + 'The "nested" and "own" flags cannot be combined.',
|
10510 | undefined,
|
10511 | ssfi
|
10512 | );
|
10513 | }
|
10514 |
|
10515 | if (obj === null || obj === undefined) {
|
10516 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
10517 | throw new AssertionError(
|
10518 | flagMsg + 'Target cannot be null or undefined.',
|
10519 | undefined,
|
10520 | ssfi
|
10521 | );
|
10522 | }
|
10523 |
|
10524 | var isDeep = flag(this, 'deep')
|
10525 | , negate = flag(this, 'negate')
|
10526 | , pathInfo = isNested ? _.getPathInfo(obj, name) : null
|
10527 | , value = isNested ? pathInfo.value : obj[name];
|
10528 |
|
10529 | var descriptor = '';
|
10530 | if (isDeep) descriptor += 'deep ';
|
10531 | if (isOwn) descriptor += 'own ';
|
10532 | if (isNested) descriptor += 'nested ';
|
10533 | descriptor += 'property ';
|
10534 |
|
10535 | var hasProperty;
|
10536 | if (isOwn) hasProperty = Object.prototype.hasOwnProperty.call(obj, name);
|
10537 | else if (isNested) hasProperty = pathInfo.exists;
|
10538 | else hasProperty = _.hasProperty(obj, name);
|
10539 |
|
10540 |
|
10541 |
|
10542 |
|
10543 |
|
10544 |
|
10545 | if (!negate || arguments.length === 1) {
|
10546 | this.assert(
|
10547 | hasProperty
|
10548 | , 'expected #{this} to have ' + descriptor + _.inspect(name)
|
10549 | , 'expected #{this} to not have ' + descriptor + _.inspect(name));
|
10550 | }
|
10551 |
|
10552 | if (arguments.length > 1) {
|
10553 | this.assert(
|
10554 | hasProperty && (isDeep ? _.eql(val, value) : val === value)
|
10555 | , 'expected #{this} to have ' + descriptor + _.inspect(name) + ' of #{exp}, but got #{act}'
|
10556 | , 'expected #{this} to not have ' + descriptor + _.inspect(name) + ' of #{act}'
|
10557 | , val
|
10558 | , value
|
10559 | );
|
10560 | }
|
10561 |
|
10562 | flag(this, 'object', value);
|
10563 | }
|
10564 |
|
10565 | Assertion.addMethod('property', assertProperty);
|
10566 |
|
10567 | function assertOwnProperty (name, value, msg) {
|
10568 | flag(this, 'own', true);
|
10569 | assertProperty.apply(this, arguments);
|
10570 | }
|
10571 |
|
10572 | Assertion.addMethod('ownProperty', assertOwnProperty);
|
10573 | Assertion.addMethod('haveOwnProperty', assertOwnProperty);
|
10574 |
|
10575 | |
10576 |
|
10577 |
|
10578 |
|
10579 |
|
10580 |
|
10581 |
|
10582 |
|
10583 |
|
10584 |
|
10585 |
|
10586 |
|
10587 |
|
10588 |
|
10589 |
|
10590 |
|
10591 |
|
10592 |
|
10593 |
|
10594 |
|
10595 |
|
10596 |
|
10597 |
|
10598 |
|
10599 |
|
10600 |
|
10601 |
|
10602 |
|
10603 |
|
10604 |
|
10605 |
|
10606 |
|
10607 |
|
10608 |
|
10609 |
|
10610 |
|
10611 |
|
10612 |
|
10613 |
|
10614 |
|
10615 |
|
10616 |
|
10617 |
|
10618 |
|
10619 |
|
10620 |
|
10621 |
|
10622 |
|
10623 |
|
10624 |
|
10625 |
|
10626 |
|
10627 |
|
10628 |
|
10629 |
|
10630 |
|
10631 |
|
10632 |
|
10633 |
|
10634 |
|
10635 |
|
10636 |
|
10637 |
|
10638 |
|
10639 |
|
10640 |
|
10641 |
|
10642 |
|
10643 |
|
10644 |
|
10645 |
|
10646 |
|
10647 |
|
10648 |
|
10649 |
|
10650 |
|
10651 |
|
10652 |
|
10653 |
|
10654 |
|
10655 |
|
10656 |
|
10657 |
|
10658 |
|
10659 |
|
10660 |
|
10661 |
|
10662 |
|
10663 |
|
10664 |
|
10665 |
|
10666 |
|
10667 |
|
10668 |
|
10669 |
|
10670 |
|
10671 |
|
10672 |
|
10673 |
|
10674 |
|
10675 |
|
10676 |
|
10677 |
|
10678 |
|
10679 |
|
10680 |
|
10681 |
|
10682 |
|
10683 |
|
10684 |
|
10685 |
|
10686 |
|
10687 |
|
10688 |
|
10689 |
|
10690 |
|
10691 |
|
10692 |
|
10693 |
|
10694 | function assertOwnPropertyDescriptor (name, descriptor, msg) {
|
10695 | if (typeof descriptor === 'string') {
|
10696 | msg = descriptor;
|
10697 | descriptor = null;
|
10698 | }
|
10699 | if (msg) flag(this, 'message', msg);
|
10700 | var obj = flag(this, 'object');
|
10701 | var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
|
10702 | if (actualDescriptor && descriptor) {
|
10703 | this.assert(
|
10704 | _.eql(descriptor, actualDescriptor)
|
10705 | , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to match ' + _.inspect(descriptor) + ', got ' + _.inspect(actualDescriptor)
|
10706 | , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to not match ' + _.inspect(descriptor)
|
10707 | , descriptor
|
10708 | , actualDescriptor
|
10709 | , true
|
10710 | );
|
10711 | } else {
|
10712 | this.assert(
|
10713 | actualDescriptor
|
10714 | , 'expected #{this} to have an own property descriptor for ' + _.inspect(name)
|
10715 | , 'expected #{this} to not have an own property descriptor for ' + _.inspect(name)
|
10716 | );
|
10717 | }
|
10718 | flag(this, 'object', actualDescriptor);
|
10719 | }
|
10720 |
|
10721 | Assertion.addMethod('ownPropertyDescriptor', assertOwnPropertyDescriptor);
|
10722 | Assertion.addMethod('haveOwnPropertyDescriptor', assertOwnPropertyDescriptor);
|
10723 |
|
10724 | |
10725 |
|
10726 |
|
10727 |
|
10728 |
|
10729 |
|
10730 |
|
10731 |
|
10732 |
|
10733 |
|
10734 |
|
10735 |
|
10736 |
|
10737 |
|
10738 |
|
10739 |
|
10740 |
|
10741 |
|
10742 |
|
10743 |
|
10744 |
|
10745 |
|
10746 |
|
10747 |
|
10748 |
|
10749 |
|
10750 |
|
10751 |
|
10752 |
|
10753 |
|
10754 |
|
10755 |
|
10756 |
|
10757 |
|
10758 |
|
10759 |
|
10760 |
|
10761 |
|
10762 |
|
10763 |
|
10764 |
|
10765 |
|
10766 |
|
10767 |
|
10768 |
|
10769 |
|
10770 |
|
10771 |
|
10772 |
|
10773 |
|
10774 |
|
10775 |
|
10776 |
|
10777 |
|
10778 |
|
10779 |
|
10780 | function assertLengthChain () {
|
10781 | flag(this, 'doLength', true);
|
10782 | }
|
10783 |
|
10784 | function assertLength (n, msg) {
|
10785 | if (msg) flag(this, 'message', msg);
|
10786 | var obj = flag(this, 'object')
|
10787 | , flagMsg = flag(this, 'message')
|
10788 | , ssfi = flag(this, 'ssfi');
|
10789 | new Assertion(obj, flagMsg, ssfi, true).to.have.property('length');
|
10790 | var len = obj.length;
|
10791 |
|
10792 | this.assert(
|
10793 | len == n
|
10794 | , 'expected #{this} to have a length of #{exp} but got #{act}'
|
10795 | , 'expected #{this} to not have a length of #{act}'
|
10796 | , n
|
10797 | , len
|
10798 | );
|
10799 | }
|
10800 |
|
10801 | Assertion.addChainableMethod('length', assertLength, assertLengthChain);
|
10802 | Assertion.addChainableMethod('lengthOf', assertLength, assertLengthChain);
|
10803 |
|
10804 | |
10805 |
|
10806 |
|
10807 |
|
10808 |
|
10809 |
|
10810 |
|
10811 |
|
10812 |
|
10813 |
|
10814 |
|
10815 |
|
10816 |
|
10817 |
|
10818 |
|
10819 |
|
10820 |
|
10821 |
|
10822 |
|
10823 |
|
10824 |
|
10825 |
|
10826 |
|
10827 |
|
10828 |
|
10829 |
|
10830 |
|
10831 | function assertMatch(re, msg) {
|
10832 | if (msg) flag(this, 'message', msg);
|
10833 | var obj = flag(this, 'object');
|
10834 | this.assert(
|
10835 | re.exec(obj)
|
10836 | , 'expected #{this} to match ' + re
|
10837 | , 'expected #{this} not to match ' + re
|
10838 | );
|
10839 | }
|
10840 |
|
10841 | Assertion.addMethod('match', assertMatch);
|
10842 | Assertion.addMethod('matches', assertMatch);
|
10843 |
|
10844 | |
10845 |
|
10846 |
|
10847 |
|
10848 |
|
10849 |
|
10850 |
|
10851 |
|
10852 |
|
10853 |
|
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 |
|
10859 |
|
10860 |
|
10861 |
|
10862 |
|
10863 |
|
10864 |
|
10865 |
|
10866 |
|
10867 |
|
10868 |
|
10869 | Assertion.addMethod('string', function (str, msg) {
|
10870 | if (msg) flag(this, 'message', msg);
|
10871 | var obj = flag(this, 'object')
|
10872 | , flagMsg = flag(this, 'message')
|
10873 | , ssfi = flag(this, 'ssfi');
|
10874 | new Assertion(obj, flagMsg, ssfi, true).is.a('string');
|
10875 |
|
10876 | this.assert(
|
10877 | ~obj.indexOf(str)
|
10878 | , 'expected #{this} to contain ' + _.inspect(str)
|
10879 | , 'expected #{this} to not contain ' + _.inspect(str)
|
10880 | );
|
10881 | });
|
10882 |
|
10883 | |
10884 |
|
10885 |
|
10886 |
|
10887 |
|
10888 |
|
10889 |
|
10890 |
|
10891 |
|
10892 |
|
10893 |
|
10894 |
|
10895 |
|
10896 |
|
10897 |
|
10898 |
|
10899 |
|
10900 |
|
10901 |
|
10902 |
|
10903 |
|
10904 |
|
10905 |
|
10906 |
|
10907 |
|
10908 |
|
10909 |
|
10910 |
|
10911 |
|
10912 |
|
10913 |
|
10914 |
|
10915 |
|
10916 |
|
10917 |
|
10918 |
|
10919 |
|
10920 |
|
10921 |
|
10922 |
|
10923 |
|
10924 |
|
10925 |
|
10926 |
|
10927 |
|
10928 |
|
10929 |
|
10930 |
|
10931 |
|
10932 |
|
10933 |
|
10934 |
|
10935 |
|
10936 |
|
10937 |
|
10938 |
|
10939 |
|
10940 |
|
10941 |
|
10942 |
|
10943 |
|
10944 |
|
10945 |
|
10946 |
|
10947 |
|
10948 |
|
10949 |
|
10950 |
|
10951 |
|
10952 |
|
10953 |
|
10954 |
|
10955 |
|
10956 |
|
10957 |
|
10958 |
|
10959 |
|
10960 |
|
10961 |
|
10962 |
|
10963 |
|
10964 |
|
10965 |
|
10966 |
|
10967 |
|
10968 |
|
10969 |
|
10970 |
|
10971 |
|
10972 |
|
10973 |
|
10974 |
|
10975 |
|
10976 |
|
10977 |
|
10978 |
|
10979 |
|
10980 |
|
10981 |
|
10982 |
|
10983 |
|
10984 |
|
10985 |
|
10986 |
|
10987 | function assertKeys (keys) {
|
10988 | var obj = flag(this, 'object')
|
10989 | , objType = _.type(obj)
|
10990 | , keysType = _.type(keys)
|
10991 | , ssfi = flag(this, 'ssfi')
|
10992 | , isDeep = flag(this, 'deep')
|
10993 | , str
|
10994 | , deepStr = ''
|
10995 | , ok = true
|
10996 | , flagMsg = flag(this, 'message');
|
10997 |
|
10998 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
10999 | var mixedArgsMsg = flagMsg + 'when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments';
|
11000 |
|
11001 | if (objType === 'Map' || objType === 'Set') {
|
11002 | deepStr = isDeep ? 'deeply ' : '';
|
11003 | actual = [];
|
11004 |
|
11005 |
|
11006 | obj.forEach(function (val, key) { actual.push(key); });
|
11007 |
|
11008 | if (keysType !== 'Array') {
|
11009 | keys = Array.prototype.slice.call(arguments);
|
11010 | }
|
11011 |
|
11012 | } else {
|
11013 | actual = _.getOwnEnumerableProperties(obj);
|
11014 |
|
11015 | switch (keysType) {
|
11016 | case 'Array':
|
11017 | if (arguments.length > 1) {
|
11018 | throw new AssertionError(mixedArgsMsg, undefined, ssfi);
|
11019 | }
|
11020 | break;
|
11021 | case 'Object':
|
11022 | if (arguments.length > 1) {
|
11023 | throw new AssertionError(mixedArgsMsg, undefined, ssfi);
|
11024 | }
|
11025 | keys = Object.keys(keys);
|
11026 | break;
|
11027 | default:
|
11028 | keys = Array.prototype.slice.call(arguments);
|
11029 | }
|
11030 |
|
11031 |
|
11032 | keys = keys.map(function (val) {
|
11033 | return typeof val === 'symbol' ? val : String(val);
|
11034 | });
|
11035 | }
|
11036 |
|
11037 | if (!keys.length) {
|
11038 | throw new AssertionError(flagMsg + 'keys required', undefined, ssfi);
|
11039 | }
|
11040 |
|
11041 | var len = keys.length
|
11042 | , any = flag(this, 'any')
|
11043 | , all = flag(this, 'all')
|
11044 | , expected = keys
|
11045 | , actual;
|
11046 |
|
11047 | if (!any && !all) {
|
11048 | all = true;
|
11049 | }
|
11050 |
|
11051 |
|
11052 | if (any) {
|
11053 | ok = expected.some(function(expectedKey) {
|
11054 | return actual.some(function(actualKey) {
|
11055 | if (isDeep) {
|
11056 | return _.eql(expectedKey, actualKey);
|
11057 | } else {
|
11058 | return expectedKey === actualKey;
|
11059 | }
|
11060 | });
|
11061 | });
|
11062 | }
|
11063 |
|
11064 |
|
11065 | if (all) {
|
11066 | ok = expected.every(function(expectedKey) {
|
11067 | return actual.some(function(actualKey) {
|
11068 | if (isDeep) {
|
11069 | return _.eql(expectedKey, actualKey);
|
11070 | } else {
|
11071 | return expectedKey === actualKey;
|
11072 | }
|
11073 | });
|
11074 | });
|
11075 |
|
11076 | if (!flag(this, 'contains')) {
|
11077 | ok = ok && keys.length == actual.length;
|
11078 | }
|
11079 | }
|
11080 |
|
11081 |
|
11082 | if (len > 1) {
|
11083 | keys = keys.map(function(key) {
|
11084 | return _.inspect(key);
|
11085 | });
|
11086 | var last = keys.pop();
|
11087 | if (all) {
|
11088 | str = keys.join(', ') + ', and ' + last;
|
11089 | }
|
11090 | if (any) {
|
11091 | str = keys.join(', ') + ', or ' + last;
|
11092 | }
|
11093 | } else {
|
11094 | str = _.inspect(keys[0]);
|
11095 | }
|
11096 |
|
11097 |
|
11098 | str = (len > 1 ? 'keys ' : 'key ') + str;
|
11099 |
|
11100 |
|
11101 | str = (flag(this, 'contains') ? 'contain ' : 'have ') + str;
|
11102 |
|
11103 |
|
11104 | this.assert(
|
11105 | ok
|
11106 | , 'expected #{this} to ' + deepStr + str
|
11107 | , 'expected #{this} to not ' + deepStr + str
|
11108 | , expected.slice(0).sort(_.compareByInspect)
|
11109 | , actual.sort(_.compareByInspect)
|
11110 | , true
|
11111 | );
|
11112 | }
|
11113 |
|
11114 | Assertion.addMethod('keys', assertKeys);
|
11115 | Assertion.addMethod('key', assertKeys);
|
11116 |
|
11117 | |
11118 |
|
11119 |
|
11120 |
|
11121 |
|
11122 |
|
11123 |
|
11124 |
|
11125 |
|
11126 |
|
11127 |
|
11128 |
|
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 |
|
11138 |
|
11139 |
|
11140 |
|
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 |
|
11149 |
|
11150 |
|
11151 |
|
11152 |
|
11153 |
|
11154 |
|
11155 |
|
11156 |
|
11157 |
|
11158 |
|
11159 |
|
11160 |
|
11161 |
|
11162 |
|
11163 |
|
11164 |
|
11165 |
|
11166 |
|
11167 |
|
11168 |
|
11169 |
|
11170 |
|
11171 |
|
11172 |
|
11173 |
|
11174 |
|
11175 |
|
11176 |
|
11177 |
|
11178 |
|
11179 |
|
11180 |
|
11181 |
|
11182 |
|
11183 |
|
11184 |
|
11185 |
|
11186 |
|
11187 |
|
11188 |
|
11189 |
|
11190 |
|
11191 |
|
11192 |
|
11193 |
|
11194 |
|
11195 |
|
11196 |
|
11197 |
|
11198 |
|
11199 |
|
11200 |
|
11201 |
|
11202 |
|
11203 |
|
11204 |
|
11205 |
|
11206 |
|
11207 |
|
11208 |
|
11209 |
|
11210 |
|
11211 |
|
11212 |
|
11213 |
|
11214 |
|
11215 |
|
11216 |
|
11217 |
|
11218 |
|
11219 |
|
11220 |
|
11221 |
|
11222 |
|
11223 |
|
11224 |
|
11225 |
|
11226 |
|
11227 |
|
11228 |
|
11229 |
|
11230 |
|
11231 |
|
11232 |
|
11233 |
|
11234 |
|
11235 |
|
11236 |
|
11237 |
|
11238 |
|
11239 |
|
11240 |
|
11241 |
|
11242 |
|
11243 |
|
11244 |
|
11245 |
|
11246 |
|
11247 |
|
11248 |
|
11249 |
|
11250 |
|
11251 |
|
11252 |
|
11253 |
|
11254 |
|
11255 |
|
11256 |
|
11257 |
|
11258 |
|
11259 |
|
11260 |
|
11261 |
|
11262 |
|
11263 |
|
11264 |
|
11265 |
|
11266 |
|
11267 |
|
11268 |
|
11269 |
|
11270 |
|
11271 |
|
11272 |
|
11273 |
|
11274 |
|
11275 |
|
11276 |
|
11277 |
|
11278 |
|
11279 |
|
11280 |
|
11281 |
|
11282 | function assertThrows (errorLike, errMsgMatcher, msg) {
|
11283 | if (msg) flag(this, 'message', msg);
|
11284 | var obj = flag(this, 'object')
|
11285 | , ssfi = flag(this, 'ssfi')
|
11286 | , flagMsg = flag(this, 'message')
|
11287 | , negate = flag(this, 'negate') || false;
|
11288 | new Assertion(obj, flagMsg, ssfi, true).is.a('function');
|
11289 |
|
11290 | if (errorLike instanceof RegExp || typeof errorLike === 'string') {
|
11291 | errMsgMatcher = errorLike;
|
11292 | errorLike = null;
|
11293 | }
|
11294 |
|
11295 | var caughtErr;
|
11296 | try {
|
11297 | obj();
|
11298 | } catch (err) {
|
11299 | caughtErr = err;
|
11300 | }
|
11301 |
|
11302 |
|
11303 |
|
11304 | var everyArgIsUndefined = errorLike === undefined && errMsgMatcher === undefined;
|
11305 |
|
11306 |
|
11307 |
|
11308 | var everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
|
11309 | var errorLikeFail = false;
|
11310 | var errMsgMatcherFail = false;
|
11311 |
|
11312 |
|
11313 | if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
|
11314 |
|
11315 | var errorLikeString = 'an error';
|
11316 | if (errorLike instanceof Error) {
|
11317 | errorLikeString = '#{exp}';
|
11318 | } else if (errorLike) {
|
11319 | errorLikeString = _.checkError.getConstructorName(errorLike);
|
11320 | }
|
11321 |
|
11322 | this.assert(
|
11323 | caughtErr
|
11324 | , 'expected #{this} to throw ' + errorLikeString
|
11325 | , 'expected #{this} to not throw an error but #{act} was thrown'
|
11326 | , errorLike && errorLike.toString()
|
11327 | , (caughtErr instanceof Error ?
|
11328 | caughtErr.toString() : (typeof caughtErr === 'string' ? caughtErr : caughtErr &&
|
11329 | _.checkError.getConstructorName(caughtErr)))
|
11330 | );
|
11331 | }
|
11332 |
|
11333 | if (errorLike && caughtErr) {
|
11334 |
|
11335 | if (errorLike instanceof Error) {
|
11336 | var isCompatibleInstance = _.checkError.compatibleInstance(caughtErr, errorLike);
|
11337 |
|
11338 | if (isCompatibleInstance === negate) {
|
11339 |
|
11340 |
|
11341 | if (everyArgIsDefined && negate) {
|
11342 | errorLikeFail = true;
|
11343 | } else {
|
11344 | this.assert(
|
11345 | negate
|
11346 | , 'expected #{this} to throw #{exp} but #{act} was thrown'
|
11347 | , 'expected #{this} to not throw #{exp}' + (caughtErr && !negate ? ' but #{act} was thrown' : '')
|
11348 | , errorLike.toString()
|
11349 | , caughtErr.toString()
|
11350 | );
|
11351 | }
|
11352 | }
|
11353 | }
|
11354 |
|
11355 | var isCompatibleConstructor = _.checkError.compatibleConstructor(caughtErr, errorLike);
|
11356 | if (isCompatibleConstructor === negate) {
|
11357 | if (everyArgIsDefined && negate) {
|
11358 | errorLikeFail = true;
|
11359 | } else {
|
11360 | this.assert(
|
11361 | negate
|
11362 | , 'expected #{this} to throw #{exp} but #{act} was thrown'
|
11363 | , 'expected #{this} to not throw #{exp}' + (caughtErr ? ' but #{act} was thrown' : '')
|
11364 | , (errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike))
|
11365 | , (caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr))
|
11366 | );
|
11367 | }
|
11368 | }
|
11369 | }
|
11370 |
|
11371 | if (caughtErr && errMsgMatcher !== undefined && errMsgMatcher !== null) {
|
11372 |
|
11373 | var placeholder = 'including';
|
11374 | if (errMsgMatcher instanceof RegExp) {
|
11375 | placeholder = 'matching';
|
11376 | }
|
11377 |
|
11378 | var isCompatibleMessage = _.checkError.compatibleMessage(caughtErr, errMsgMatcher);
|
11379 | if (isCompatibleMessage === negate) {
|
11380 | if (everyArgIsDefined && negate) {
|
11381 | errMsgMatcherFail = true;
|
11382 | } else {
|
11383 | this.assert(
|
11384 | negate
|
11385 | , 'expected #{this} to throw error ' + placeholder + ' #{exp} but got #{act}'
|
11386 | , 'expected #{this} to throw error not ' + placeholder + ' #{exp}'
|
11387 | , errMsgMatcher
|
11388 | , _.checkError.getMessage(caughtErr)
|
11389 | );
|
11390 | }
|
11391 | }
|
11392 | }
|
11393 |
|
11394 |
|
11395 | if (errorLikeFail && errMsgMatcherFail) {
|
11396 | this.assert(
|
11397 | negate
|
11398 | , 'expected #{this} to throw #{exp} but #{act} was thrown'
|
11399 | , 'expected #{this} to not throw #{exp}' + (caughtErr ? ' but #{act} was thrown' : '')
|
11400 | , (errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike))
|
11401 | , (caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr))
|
11402 | );
|
11403 | }
|
11404 |
|
11405 | flag(this, 'object', caughtErr);
|
11406 | }
|
11407 |
|
11408 | Assertion.addMethod('throw', assertThrows);
|
11409 | Assertion.addMethod('throws', assertThrows);
|
11410 | Assertion.addMethod('Throw', assertThrows);
|
11411 |
|
11412 | |
11413 |
|
11414 |
|
11415 |
|
11416 |
|
11417 |
|
11418 |
|
11419 |
|
11420 |
|
11421 |
|
11422 |
|
11423 |
|
11424 |
|
11425 |
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 |
|
11432 |
|
11433 |
|
11434 |
|
11435 |
|
11436 |
|
11437 |
|
11438 |
|
11439 |
|
11440 |
|
11441 |
|
11442 |
|
11443 |
|
11444 |
|
11445 |
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 |
|
11454 |
|
11455 |
|
11456 |
|
11457 |
|
11458 |
|
11459 |
|
11460 |
|
11461 |
|
11462 |
|
11463 |
|
11464 |
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 | function respondTo (method, msg) {
|
11478 | if (msg) flag(this, 'message', msg);
|
11479 | var obj = flag(this, 'object')
|
11480 | , itself = flag(this, 'itself')
|
11481 | , context = ('function' === typeof obj && !itself)
|
11482 | ? obj.prototype[method]
|
11483 | : obj[method];
|
11484 |
|
11485 | this.assert(
|
11486 | 'function' === typeof context
|
11487 | , 'expected #{this} to respond to ' + _.inspect(method)
|
11488 | , 'expected #{this} to not respond to ' + _.inspect(method)
|
11489 | );
|
11490 | }
|
11491 |
|
11492 | Assertion.addMethod('respondTo', respondTo);
|
11493 | Assertion.addMethod('respondsTo', respondTo);
|
11494 |
|
11495 | |
11496 |
|
11497 |
|
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 |
|
11504 |
|
11505 |
|
11506 |
|
11507 |
|
11508 |
|
11509 |
|
11510 |
|
11511 |
|
11512 |
|
11513 |
|
11514 |
|
11515 | Assertion.addProperty('itself', function () {
|
11516 | flag(this, 'itself', true);
|
11517 | });
|
11518 |
|
11519 | |
11520 |
|
11521 |
|
11522 |
|
11523 |
|
11524 |
|
11525 |
|
11526 |
|
11527 |
|
11528 |
|
11529 |
|
11530 |
|
11531 |
|
11532 |
|
11533 |
|
11534 |
|
11535 |
|
11536 |
|
11537 |
|
11538 |
|
11539 |
|
11540 |
|
11541 |
|
11542 |
|
11543 |
|
11544 |
|
11545 |
|
11546 |
|
11547 |
|
11548 |
|
11549 |
|
11550 |
|
11551 |
|
11552 |
|
11553 |
|
11554 |
|
11555 |
|
11556 |
|
11557 | function satisfy (matcher, msg) {
|
11558 | if (msg) flag(this, 'message', msg);
|
11559 | var obj = flag(this, 'object');
|
11560 | var result = matcher(obj);
|
11561 | this.assert(
|
11562 | result
|
11563 | , 'expected #{this} to satisfy ' + _.objDisplay(matcher)
|
11564 | , 'expected #{this} to not satisfy' + _.objDisplay(matcher)
|
11565 | , flag(this, 'negate') ? false : true
|
11566 | , result
|
11567 | );
|
11568 | }
|
11569 |
|
11570 | Assertion.addMethod('satisfy', satisfy);
|
11571 | Assertion.addMethod('satisfies', satisfy);
|
11572 |
|
11573 | |
11574 |
|
11575 |
|
11576 |
|
11577 |
|
11578 |
|
11579 |
|
11580 |
|
11581 |
|
11582 |
|
11583 |
|
11584 |
|
11585 |
|
11586 |
|
11587 |
|
11588 |
|
11589 |
|
11590 |
|
11591 |
|
11592 |
|
11593 |
|
11594 |
|
11595 |
|
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 |
|
11601 |
|
11602 |
|
11603 |
|
11604 |
|
11605 |
|
11606 |
|
11607 |
|
11608 |
|
11609 |
|
11610 |
|
11611 | function closeTo(expected, delta, msg) {
|
11612 | if (msg) flag(this, 'message', msg);
|
11613 | var obj = flag(this, 'object')
|
11614 | , flagMsg = flag(this, 'message')
|
11615 | , ssfi = flag(this, 'ssfi');
|
11616 |
|
11617 | new Assertion(obj, flagMsg, ssfi, true).is.a('number');
|
11618 | if (typeof expected !== 'number' || typeof delta !== 'number') {
|
11619 | flagMsg = flagMsg ? flagMsg + ': ' : '';
|
11620 | throw new AssertionError(
|
11621 | flagMsg + 'the arguments to closeTo or approximately must be numbers',
|
11622 | undefined,
|
11623 | ssfi
|
11624 | );
|
11625 | }
|
11626 |
|
11627 | this.assert(
|
11628 | Math.abs(obj - expected) <= delta
|
11629 | , 'expected #{this} to be close to ' + expected + ' +/- ' + delta
|
11630 | , 'expected #{this} not to be close to ' + expected + ' +/- ' + delta
|
11631 | );
|
11632 | }
|
11633 |
|
11634 | Assertion.addMethod('closeTo', closeTo);
|
11635 | Assertion.addMethod('approximately', closeTo);
|
11636 |
|
11637 |
|
11638 | function isSubsetOf(subset, superset, cmp, contains, ordered) {
|
11639 | if (!contains) {
|
11640 | if (subset.length !== superset.length) return false;
|
11641 | superset = superset.slice();
|
11642 | }
|
11643 |
|
11644 | return subset.every(function(elem, idx) {
|
11645 | if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
|
11646 |
|
11647 | if (!cmp) {
|
11648 | var matchIdx = superset.indexOf(elem);
|
11649 | if (matchIdx === -1) return false;
|
11650 |
|
11651 |
|
11652 | if (!contains) superset.splice(matchIdx, 1);
|
11653 | return true;
|
11654 | }
|
11655 |
|
11656 | return superset.some(function(elem2, matchIdx) {
|
11657 | if (!cmp(elem, elem2)) return false;
|
11658 |
|
11659 |
|
11660 | if (!contains) superset.splice(matchIdx, 1);
|
11661 | return true;
|
11662 | });
|
11663 | });
|
11664 | }
|
11665 |
|
11666 | |
11667 |
|
11668 |
|
11669 |
|
11670 |
|
11671 |
|
11672 |
|
11673 |
|
11674 |
|
11675 |
|
11676 |
|
11677 |
|
11678 |
|
11679 |
|
11680 |
|
11681 |
|
11682 |
|
11683 |
|
11684 |
|
11685 |
|
11686 |
|
11687 |
|
11688 |
|
11689 |
|
11690 |
|
11691 |
|
11692 |
|
11693 |
|
11694 |
|
11695 |
|
11696 |
|
11697 |
|
11698 |
|
11699 |
|
11700 |
|
11701 |
|
11702 |
|
11703 |
|
11704 |
|
11705 |
|
11706 |
|
11707 |
|
11708 |
|
11709 |
|
11710 |
|
11711 |
|
11712 |
|
11713 |
|
11714 |
|
11715 |
|
11716 |
|
11717 |
|
11718 |
|
11719 |
|
11720 |
|
11721 |
|
11722 |
|
11723 |
|
11724 |
|
11725 |
|
11726 |
|
11727 |
|
11728 |
|
11729 |
|
11730 |
|
11731 |
|
11732 |
|
11733 |
|
11734 |
|
11735 | Assertion.addMethod('members', function (subset, msg) {
|
11736 | if (msg) flag(this, 'message', msg);
|
11737 | var obj = flag(this, 'object')
|
11738 | , flagMsg = flag(this, 'message')
|
11739 | , ssfi = flag(this, 'ssfi');
|
11740 |
|
11741 | new Assertion(obj, flagMsg, ssfi, true).to.be.an('array');
|
11742 | new Assertion(subset, flagMsg, ssfi, true).to.be.an('array');
|
11743 |
|
11744 | var contains = flag(this, 'contains');
|
11745 | var ordered = flag(this, 'ordered');
|
11746 |
|
11747 | var subject, failMsg, failNegateMsg;
|
11748 |
|
11749 | if (contains) {
|
11750 | subject = ordered ? 'an ordered superset' : 'a superset';
|
11751 | failMsg = 'expected #{this} to be ' + subject + ' of #{exp}';
|
11752 | failNegateMsg = 'expected #{this} to not be ' + subject + ' of #{exp}';
|
11753 | } else {
|
11754 | subject = ordered ? 'ordered members' : 'members';
|
11755 | failMsg = 'expected #{this} to have the same ' + subject + ' as #{exp}';
|
11756 | failNegateMsg = 'expected #{this} to not have the same ' + subject + ' as #{exp}';
|
11757 | }
|
11758 |
|
11759 | var cmp = flag(this, 'deep') ? _.eql : undefined;
|
11760 |
|
11761 | this.assert(
|
11762 | isSubsetOf(subset, obj, cmp, contains, ordered)
|
11763 | , failMsg
|
11764 | , failNegateMsg
|
11765 | , subset
|
11766 | , obj
|
11767 | , true
|
11768 | );
|
11769 | });
|
11770 |
|
11771 | |
11772 |
|
11773 |
|
11774 |
|
11775 |
|
11776 |
|
11777 |
|
11778 |
|
11779 |
|
11780 |
|
11781 |
|
11782 |
|
11783 |
|
11784 |
|
11785 |
|
11786 |
|
11787 |
|
11788 |
|
11789 |
|
11790 |
|
11791 |
|
11792 |
|
11793 |
|
11794 |
|
11795 |
|
11796 |
|
11797 |
|
11798 |
|
11799 |
|
11800 |
|
11801 | function oneOf (list, msg) {
|
11802 | if (msg) flag(this, 'message', msg);
|
11803 | var expected = flag(this, 'object')
|
11804 | , flagMsg = flag(this, 'message')
|
11805 | , ssfi = flag(this, 'ssfi');
|
11806 | new Assertion(list, flagMsg, ssfi, true).to.be.an('array');
|
11807 |
|
11808 | this.assert(
|
11809 | list.indexOf(expected) > -1
|
11810 | , 'expected #{this} to be one of #{exp}'
|
11811 | , 'expected #{this} to not be one of #{exp}'
|
11812 | , list
|
11813 | , expected
|
11814 | );
|
11815 | }
|
11816 |
|
11817 | Assertion.addMethod('oneOf', oneOf);
|
11818 |
|
11819 |
|
11820 | |
11821 |
|
11822 |
|
11823 |
|
11824 |
|
11825 |
|
11826 |
|
11827 |
|
11828 |
|
11829 |
|
11830 |
|
11831 |
|
11832 |
|
11833 |
|
11834 |
|
11835 |
|
11836 |
|
11837 |
|
11838 |
|
11839 |
|
11840 |
|
11841 |
|
11842 |
|
11843 |
|
11844 |
|
11845 |
|
11846 |
|
11847 |
|
11848 |
|
11849 |
|
11850 |
|
11851 |
|
11852 |
|
11853 |
|
11854 |
|
11855 |
|
11856 |
|
11857 |
|
11858 |
|
11859 |
|
11860 |
|
11861 |
|
11862 |
|
11863 |
|
11864 |
|
11865 |
|
11866 |
|
11867 |
|
11868 |
|
11869 |
|
11870 |
|
11871 |
|
11872 |
|
11873 |
|
11874 |
|
11875 |
|
11876 |
|
11877 |
|
11878 |
|
11879 |
|
11880 |
|
11881 |
|
11882 |
|
11883 |
|
11884 |
|
11885 |
|
11886 |
|
11887 |
|
11888 |
|
11889 |
|
11890 |
|
11891 |
|
11892 |
|
11893 |
|
11894 |
|
11895 |
|
11896 |
|
11897 |
|
11898 |
|
11899 |
|
11900 |
|
11901 |
|
11902 |
|
11903 |
|
11904 |
|
11905 |
|
11906 |
|
11907 |
|
11908 |
|
11909 |
|
11910 |
|
11911 |
|
11912 |
|
11913 |
|
11914 |
|
11915 | function assertChanges (subject, prop, msg) {
|
11916 | if (msg) flag(this, 'message', msg);
|
11917 | var fn = flag(this, 'object')
|
11918 | , flagMsg = flag(this, 'message')
|
11919 | , ssfi = flag(this, 'ssfi');
|
11920 | new Assertion(fn, flagMsg, ssfi, true).is.a('function');
|
11921 |
|
11922 | var initial;
|
11923 | if (!prop) {
|
11924 | new Assertion(subject, flagMsg, ssfi, true).is.a('function');
|
11925 | initial = subject();
|
11926 | } else {
|
11927 | new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
11928 | initial = subject[prop];
|
11929 | }
|
11930 |
|
11931 | fn();
|
11932 |
|
11933 | var final = prop === undefined || prop === null ? subject() : subject[prop];
|
11934 | var msgObj = prop === undefined || prop === null ? initial : '.' + prop;
|
11935 |
|
11936 |
|
11937 | flag(this, 'deltaMsgObj', msgObj);
|
11938 | flag(this, 'initialDeltaValue', initial);
|
11939 | flag(this, 'finalDeltaValue', final);
|
11940 | flag(this, 'deltaBehavior', 'change');
|
11941 | flag(this, 'realDelta', final !== initial);
|
11942 |
|
11943 | this.assert(
|
11944 | initial !== final
|
11945 | , 'expected ' + msgObj + ' to change'
|
11946 | , 'expected ' + msgObj + ' to not change'
|
11947 | );
|
11948 | }
|
11949 |
|
11950 | Assertion.addMethod('change', assertChanges);
|
11951 | Assertion.addMethod('changes', assertChanges);
|
11952 |
|
11953 | |
11954 |
|
11955 |
|
11956 |
|
11957 |
|
11958 |
|
11959 |
|
11960 |
|
11961 |
|
11962 |
|
11963 |
|
11964 |
|
11965 |
|
11966 |
|
11967 |
|
11968 |
|
11969 |
|
11970 |
|
11971 |
|
11972 |
|
11973 |
|
11974 |
|
11975 |
|
11976 |
|
11977 |
|
11978 |
|
11979 |
|
11980 |
|
11981 |
|
11982 |
|
11983 |
|
11984 |
|
11985 |
|
11986 |
|
11987 |
|
11988 |
|
11989 |
|
11990 |
|
11991 |
|
11992 |
|
11993 |
|
11994 |
|
11995 |
|
11996 |
|
11997 |
|
11998 |
|
11999 |
|
12000 |
|
12001 |
|
12002 |
|
12003 |
|
12004 |
|
12005 |
|
12006 |
|
12007 |
|
12008 |
|
12009 |
|
12010 |
|
12011 |
|
12012 |
|
12013 |
|
12014 |
|
12015 |
|
12016 |
|
12017 |
|
12018 |
|
12019 |
|
12020 |
|
12021 |
|
12022 |
|
12023 |
|
12024 |
|
12025 |
|
12026 |
|
12027 |
|
12028 |
|
12029 |
|
12030 |
|
12031 |
|
12032 | function assertIncreases (subject, prop, msg) {
|
12033 | if (msg) flag(this, 'message', msg);
|
12034 | var fn = flag(this, 'object')
|
12035 | , flagMsg = flag(this, 'message')
|
12036 | , ssfi = flag(this, 'ssfi');
|
12037 | new Assertion(fn, flagMsg, ssfi, true).is.a('function');
|
12038 |
|
12039 | var initial;
|
12040 | if (!prop) {
|
12041 | new Assertion(subject, flagMsg, ssfi, true).is.a('function');
|
12042 | initial = subject();
|
12043 | } else {
|
12044 | new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
12045 | initial = subject[prop];
|
12046 | }
|
12047 |
|
12048 |
|
12049 | new Assertion(initial, flagMsg, ssfi, true).is.a('number');
|
12050 |
|
12051 | fn();
|
12052 |
|
12053 | var final = prop === undefined || prop === null ? subject() : subject[prop];
|
12054 | var msgObj = prop === undefined || prop === null ? initial : '.' + prop;
|
12055 |
|
12056 | flag(this, 'deltaMsgObj', msgObj);
|
12057 | flag(this, 'initialDeltaValue', initial);
|
12058 | flag(this, 'finalDeltaValue', final);
|
12059 | flag(this, 'deltaBehavior', 'increase');
|
12060 | flag(this, 'realDelta', final - initial);
|
12061 |
|
12062 | this.assert(
|
12063 | final - initial > 0
|
12064 | , 'expected ' + msgObj + ' to increase'
|
12065 | , 'expected ' + msgObj + ' to not increase'
|
12066 | );
|
12067 | }
|
12068 |
|
12069 | Assertion.addMethod('increase', assertIncreases);
|
12070 | Assertion.addMethod('increases', assertIncreases);
|
12071 |
|
12072 | |
12073 |
|
12074 |
|
12075 |
|
12076 |
|
12077 |
|
12078 |
|
12079 |
|
12080 |
|
12081 |
|
12082 |
|
12083 |
|
12084 |
|
12085 |
|
12086 |
|
12087 |
|
12088 |
|
12089 |
|
12090 |
|
12091 |
|
12092 |
|
12093 |
|
12094 |
|
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 |
|
12103 |
|
12104 |
|
12105 |
|
12106 |
|
12107 |
|
12108 |
|
12109 |
|
12110 |
|
12111 |
|
12112 |
|
12113 |
|
12114 |
|
12115 |
|
12116 |
|
12117 |
|
12118 |
|
12119 |
|
12120 |
|
12121 |
|
12122 |
|
12123 |
|
12124 |
|
12125 |
|
12126 |
|
12127 |
|
12128 |
|
12129 |
|
12130 |
|
12131 |
|
12132 |
|
12133 |
|
12134 |
|
12135 |
|
12136 |
|
12137 |
|
12138 |
|
12139 |
|
12140 |
|
12141 |
|
12142 |
|
12143 |
|
12144 |
|
12145 |
|
12146 |
|
12147 |
|
12148 |
|
12149 |
|
12150 |
|
12151 | function assertDecreases (subject, prop, msg) {
|
12152 | if (msg) flag(this, 'message', msg);
|
12153 | var fn = flag(this, 'object')
|
12154 | , flagMsg = flag(this, 'message')
|
12155 | , ssfi = flag(this, 'ssfi');
|
12156 | new Assertion(fn, flagMsg, ssfi, true).is.a('function');
|
12157 |
|
12158 | var initial;
|
12159 | if (!prop) {
|
12160 | new Assertion(subject, flagMsg, ssfi, true).is.a('function');
|
12161 | initial = subject();
|
12162 | } else {
|
12163 | new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
12164 | initial = subject[prop];
|
12165 | }
|
12166 |
|
12167 |
|
12168 | new Assertion(initial, flagMsg, ssfi, true).is.a('number');
|
12169 |
|
12170 | fn();
|
12171 |
|
12172 | var final = prop === undefined || prop === null ? subject() : subject[prop];
|
12173 | var msgObj = prop === undefined || prop === null ? initial : '.' + prop;
|
12174 |
|
12175 | flag(this, 'deltaMsgObj', msgObj);
|
12176 | flag(this, 'initialDeltaValue', initial);
|
12177 | flag(this, 'finalDeltaValue', final);
|
12178 | flag(this, 'deltaBehavior', 'decrease');
|
12179 | flag(this, 'realDelta', initial - final);
|
12180 |
|
12181 | this.assert(
|
12182 | final - initial < 0
|
12183 | , 'expected ' + msgObj + ' to decrease'
|
12184 | , 'expected ' + msgObj + ' to not decrease'
|
12185 | );
|
12186 | }
|
12187 |
|
12188 | Assertion.addMethod('decrease', assertDecreases);
|
12189 | Assertion.addMethod('decreases', assertDecreases);
|
12190 |
|
12191 | |
12192 |
|
12193 |
|
12194 |
|
12195 |
|
12196 |
|
12197 |
|
12198 |
|
12199 |
|
12200 |
|
12201 |
|
12202 |
|
12203 |
|
12204 |
|
12205 |
|
12206 |
|
12207 |
|
12208 |
|
12209 |
|
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 |
|
12216 |
|
12217 |
|
12218 |
|
12219 |
|
12220 |
|
12221 |
|
12222 |
|
12223 |
|
12224 |
|
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 |
|
12230 |
|
12231 |
|
12232 |
|
12233 |
|
12234 |
|
12235 |
|
12236 |
|
12237 |
|
12238 |
|
12239 |
|
12240 |
|
12241 |
|
12242 |
|
12243 |
|
12244 |
|
12245 |
|
12246 |
|
12247 |
|
12248 |
|
12249 |
|
12250 |
|
12251 |
|
12252 |
|
12253 |
|
12254 |
|
12255 |
|
12256 |
|
12257 | function assertDelta(delta, msg) {
|
12258 | if (msg) flag(this, 'message', msg);
|
12259 |
|
12260 | var msgObj = flag(this, 'deltaMsgObj');
|
12261 | var initial = flag(this, 'initialDeltaValue');
|
12262 | var final = flag(this, 'finalDeltaValue');
|
12263 | var behavior = flag(this, 'deltaBehavior');
|
12264 | var realDelta = flag(this, 'realDelta');
|
12265 |
|
12266 | var expression;
|
12267 | if (behavior === 'change') {
|
12268 | expression = Math.abs(final - initial) === Math.abs(delta);
|
12269 | } else {
|
12270 | expression = realDelta === Math.abs(delta);
|
12271 | }
|
12272 |
|
12273 | this.assert(
|
12274 | expression
|
12275 | , 'expected ' + msgObj + ' to ' + behavior + ' by ' + delta
|
12276 | , 'expected ' + msgObj + ' to not ' + behavior + ' by ' + delta
|
12277 | );
|
12278 | }
|
12279 |
|
12280 | Assertion.addMethod('by', assertDelta);
|
12281 |
|
12282 | |
12283 |
|
12284 |
|
12285 |
|
12286 |
|
12287 |
|
12288 |
|
12289 |
|
12290 |
|
12291 |
|
12292 |
|
12293 |
|
12294 |
|
12295 |
|
12296 |
|
12297 |
|
12298 |
|
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 |
|
12304 |
|
12305 |
|
12306 |
|
12307 |
|
12308 |
|
12309 |
|
12310 | Assertion.addProperty('extensible', function() {
|
12311 | var obj = flag(this, 'object');
|
12312 |
|
12313 |
|
12314 |
|
12315 |
|
12316 |
|
12317 |
|
12318 | var isExtensible = obj === Object(obj) && Object.isExtensible(obj);
|
12319 |
|
12320 | this.assert(
|
12321 | isExtensible
|
12322 | , 'expected #{this} to be extensible'
|
12323 | , 'expected #{this} to not be extensible'
|
12324 | );
|
12325 | });
|
12326 |
|
12327 | |
12328 |
|
12329 |
|
12330 |
|
12331 |
|
12332 |
|
12333 |
|
12334 |
|
12335 |
|
12336 |
|
12337 |
|
12338 |
|
12339 |
|
12340 |
|
12341 |
|
12342 |
|
12343 |
|
12344 |
|
12345 |
|
12346 |
|
12347 |
|
12348 |
|
12349 |
|
12350 |
|
12351 |
|
12352 |
|
12353 |
|
12354 |
|
12355 | Assertion.addProperty('sealed', function() {
|
12356 | var obj = flag(this, 'object');
|
12357 |
|
12358 |
|
12359 |
|
12360 |
|
12361 |
|
12362 |
|
12363 | var isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
|
12364 |
|
12365 | this.assert(
|
12366 | isSealed
|
12367 | , 'expected #{this} to be sealed'
|
12368 | , 'expected #{this} to not be sealed'
|
12369 | );
|
12370 | });
|
12371 |
|
12372 | |
12373 |
|
12374 |
|
12375 |
|
12376 |
|
12377 |
|
12378 |
|
12379 |
|
12380 |
|
12381 |
|
12382 |
|
12383 |
|
12384 |
|
12385 |
|
12386 |
|
12387 |
|
12388 |
|
12389 |
|
12390 |
|
12391 |
|
12392 |
|
12393 |
|
12394 |
|
12395 |
|
12396 |
|
12397 | Assertion.addProperty('frozen', function() {
|
12398 | var obj = flag(this, 'object');
|
12399 |
|
12400 |
|
12401 |
|
12402 |
|
12403 |
|
12404 |
|
12405 | var isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
|
12406 |
|
12407 | this.assert(
|
12408 | isFrozen
|
12409 | , 'expected #{this} to be frozen'
|
12410 | , 'expected #{this} to not be frozen'
|
12411 | );
|
12412 | });
|
12413 |
|
12414 | |
12415 |
|
12416 |
|
12417 |
|
12418 |
|
12419 |
|
12420 |
|
12421 |
|
12422 |
|
12423 |
|
12424 |
|
12425 |
|
12426 |
|
12427 |
|
12428 |
|
12429 |
|
12430 |
|
12431 |
|
12432 |
|
12433 |
|
12434 |
|
12435 |
|
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 |
|
12442 |
|
12443 |
|
12444 |
|
12445 |
|
12446 |
|
12447 |
|
12448 |
|
12449 |
|
12450 |
|
12451 |
|
12452 |
|
12453 |
|
12454 |
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 | Assertion.addProperty('finite', function(msg) {
|
12464 | var obj = flag(this, 'object');
|
12465 |
|
12466 | this.assert(
|
12467 | typeof obj === "number" && isFinite(obj)
|
12468 | , 'expected #{this} to be a finite number'
|
12469 | , 'expected #{this} to not be a finite number'
|
12470 | );
|
12471 | });
|
12472 | };
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 |
|
12480 | var expect = function (chai, util) {
|
12481 | chai.expect = function (val, message) {
|
12482 | return new chai.Assertion(val, message);
|
12483 | };
|
12484 |
|
12485 | |
12486 |
|
12487 |
|
12488 |
|
12489 |
|
12490 |
|
12491 |
|
12492 |
|
12493 |
|
12494 |
|
12495 |
|
12496 |
|
12497 |
|
12498 |
|
12499 | chai.expect.fail = function (actual, expected, message, operator) {
|
12500 | message = message || 'expect.fail()';
|
12501 | throw new chai.AssertionError(message, {
|
12502 | actual: actual
|
12503 | , expected: expected
|
12504 | , operator: operator
|
12505 | }, chai.expect.fail);
|
12506 | };
|
12507 | };
|
12508 |
|
12509 |
|
12510 |
|
12511 |
|
12512 |
|
12513 |
|
12514 |
|
12515 | var should = function (chai, util) {
|
12516 | var Assertion = chai.Assertion;
|
12517 |
|
12518 | function loadShould () {
|
12519 |
|
12520 | function shouldGetter() {
|
12521 | if (this instanceof String
|
12522 | || this instanceof Number
|
12523 | || this instanceof Boolean
|
12524 | || typeof Symbol === 'function' && this instanceof Symbol) {
|
12525 | return new Assertion(this.valueOf(), null, shouldGetter);
|
12526 | }
|
12527 | return new Assertion(this, null, shouldGetter);
|
12528 | }
|
12529 | function shouldSetter(value) {
|
12530 |
|
12531 |
|
12532 |
|
12533 |
|
12534 |
|
12535 |
|
12536 | Object.defineProperty(this, 'should', {
|
12537 | value: value,
|
12538 | enumerable: true,
|
12539 | configurable: true,
|
12540 | writable: true
|
12541 | });
|
12542 | }
|
12543 |
|
12544 | Object.defineProperty(Object.prototype, 'should', {
|
12545 | set: shouldSetter
|
12546 | , get: shouldGetter
|
12547 | , configurable: true
|
12548 | });
|
12549 |
|
12550 | var should = {};
|
12551 |
|
12552 | |
12553 |
|
12554 |
|
12555 |
|
12556 |
|
12557 |
|
12558 |
|
12559 |
|
12560 |
|
12561 |
|
12562 |
|
12563 |
|
12564 |
|
12565 |
|
12566 | should.fail = function (actual, expected, message, operator) {
|
12567 | message = message || 'should.fail()';
|
12568 | throw new chai.AssertionError(message, {
|
12569 | actual: actual
|
12570 | , expected: expected
|
12571 | , operator: operator
|
12572 | }, should.fail);
|
12573 | };
|
12574 |
|
12575 | |
12576 |
|
12577 |
|
12578 |
|
12579 |
|
12580 |
|
12581 |
|
12582 |
|
12583 |
|
12584 |
|
12585 |
|
12586 |
|
12587 |
|
12588 |
|
12589 |
|
12590 | should.equal = function (val1, val2, msg) {
|
12591 | new Assertion(val1, msg).to.equal(val2);
|
12592 | };
|
12593 |
|
12594 | |
12595 |
|
12596 |
|
12597 |
|
12598 |
|
12599 |
|
12600 |
|
12601 |
|
12602 |
|
12603 |
|
12604 |
|
12605 |
|
12606 |
|
12607 |
|
12608 |
|
12609 |
|
12610 |
|
12611 |
|
12612 |
|
12613 |
|
12614 |
|
12615 |
|
12616 |
|
12617 |
|
12618 | should.Throw = function (fn, errt, errs, msg) {
|
12619 | new Assertion(fn, msg).to.Throw(errt, errs);
|
12620 | };
|
12621 |
|
12622 | |
12623 |
|
12624 |
|
12625 |
|
12626 |
|
12627 |
|
12628 |
|
12629 |
|
12630 |
|
12631 |
|
12632 |
|
12633 |
|
12634 |
|
12635 |
|
12636 | should.exist = function (val, msg) {
|
12637 | new Assertion(val, msg).to.exist;
|
12638 | };
|
12639 |
|
12640 |
|
12641 | should.not = {};
|
12642 |
|
12643 | |
12644 |
|
12645 |
|
12646 |
|
12647 |
|
12648 |
|
12649 |
|
12650 |
|
12651 |
|
12652 |
|
12653 |
|
12654 |
|
12655 |
|
12656 |
|
12657 |
|
12658 | should.not.equal = function (val1, val2, msg) {
|
12659 | new Assertion(val1, msg).to.not.equal(val2);
|
12660 | };
|
12661 |
|
12662 | |
12663 |
|
12664 |
|
12665 |
|
12666 |
|
12667 |
|
12668 |
|
12669 |
|
12670 |
|
12671 |
|
12672 |
|
12673 |
|
12674 |
|
12675 |
|
12676 |
|
12677 |
|
12678 |
|
12679 |
|
12680 |
|
12681 |
|
12682 | should.not.Throw = function (fn, errt, errs, msg) {
|
12683 | new Assertion(fn, msg).to.not.Throw(errt, errs);
|
12684 | };
|
12685 |
|
12686 | |
12687 |
|
12688 |
|
12689 |
|
12690 |
|
12691 |
|
12692 |
|
12693 |
|
12694 |
|
12695 |
|
12696 |
|
12697 |
|
12698 |
|
12699 |
|
12700 | should.not.exist = function (val, msg) {
|
12701 | new Assertion(val, msg).to.not.exist;
|
12702 | };
|
12703 |
|
12704 | should['throw'] = should['Throw'];
|
12705 | should.not['throw'] = should.not['Throw'];
|
12706 |
|
12707 | return should;
|
12708 | }
|
12709 |
|
12710 | chai.should = loadShould;
|
12711 | chai.Should = loadShould;
|
12712 | };
|
12713 |
|
12714 |
|
12715 |
|
12716 |
|
12717 |
|
12718 |
|
12719 |
|
12720 |
|
12721 | var assert = function (chai, util) {
|
12722 |
|
12723 | |
12724 |
|
12725 |
|
12726 |
|
12727 | var Assertion = chai.Assertion
|
12728 | , flag = util.flag;
|
12729 |
|
12730 | |
12731 |
|
12732 |
|
12733 |
|
12734 | |
12735 |
|
12736 |
|
12737 |
|
12738 |
|
12739 |
|
12740 |
|
12741 |
|
12742 |
|
12743 |
|
12744 |
|
12745 |
|
12746 |
|
12747 |
|
12748 |
|
12749 | var assert = chai.assert = function (express, errmsg) {
|
12750 | var test = new Assertion(null, null, chai.assert, true);
|
12751 | test.assert(
|
12752 | express
|
12753 | , errmsg
|
12754 | , '[ negation message unavailable ]'
|
12755 | );
|
12756 | };
|
12757 |
|
12758 | |
12759 |
|
12760 |
|
12761 |
|
12762 |
|
12763 |
|
12764 |
|
12765 |
|
12766 |
|
12767 |
|
12768 |
|
12769 |
|
12770 |
|
12771 |
|
12772 | assert.fail = function (actual, expected, message, operator) {
|
12773 | message = message || 'assert.fail()';
|
12774 | throw new chai.AssertionError(message, {
|
12775 | actual: actual
|
12776 | , expected: expected
|
12777 | , operator: operator
|
12778 | }, assert.fail);
|
12779 | };
|
12780 |
|
12781 | |
12782 |
|
12783 |
|
12784 |
|
12785 |
|
12786 |
|
12787 |
|
12788 |
|
12789 |
|
12790 |
|
12791 |
|
12792 |
|
12793 |
|
12794 |
|
12795 |
|
12796 |
|
12797 | assert.isOk = function (val, msg) {
|
12798 | new Assertion(val, msg, assert.isOk, true).is.ok;
|
12799 | };
|
12800 |
|
12801 | |
12802 |
|
12803 |
|
12804 |
|
12805 |
|
12806 |
|
12807 |
|
12808 |
|
12809 |
|
12810 |
|
12811 |
|
12812 |
|
12813 |
|
12814 |
|
12815 |
|
12816 |
|
12817 | assert.isNotOk = function (val, msg) {
|
12818 | new Assertion(val, msg, assert.isNotOk, true).is.not.ok;
|
12819 | };
|
12820 |
|
12821 | |
12822 |
|
12823 |
|
12824 |
|
12825 |
|
12826 |
|
12827 |
|
12828 |
|
12829 |
|
12830 |
|
12831 |
|
12832 |
|
12833 |
|
12834 |
|
12835 |
|
12836 | assert.equal = function (act, exp, msg) {
|
12837 | var test = new Assertion(act, msg, assert.equal, true);
|
12838 |
|
12839 | test.assert(
|
12840 | exp == flag(test, 'object')
|
12841 | , 'expected #{this} to equal #{exp}'
|
12842 | , 'expected #{this} to not equal #{act}'
|
12843 | , exp
|
12844 | , act
|
12845 | , true
|
12846 | );
|
12847 | };
|
12848 |
|
12849 | |
12850 |
|
12851 |
|
12852 |
|
12853 |
|
12854 |
|
12855 |
|
12856 |
|
12857 |
|
12858 |
|
12859 |
|
12860 |
|
12861 |
|
12862 |
|
12863 |
|
12864 | assert.notEqual = function (act, exp, msg) {
|
12865 | var test = new Assertion(act, msg, assert.notEqual, true);
|
12866 |
|
12867 | test.assert(
|
12868 | exp != flag(test, 'object')
|
12869 | , 'expected #{this} to not equal #{exp}'
|
12870 | , 'expected #{this} to equal #{act}'
|
12871 | , exp
|
12872 | , act
|
12873 | , true
|
12874 | );
|
12875 | };
|
12876 |
|
12877 | |
12878 |
|
12879 |
|
12880 |
|
12881 |
|
12882 |
|
12883 |
|
12884 |
|
12885 |
|
12886 |
|
12887 |
|
12888 |
|
12889 |
|
12890 |
|
12891 |
|
12892 | assert.strictEqual = function (act, exp, msg) {
|
12893 | new Assertion(act, msg, assert.strictEqual, true).to.equal(exp);
|
12894 | };
|
12895 |
|
12896 | |
12897 |
|
12898 |
|
12899 |
|
12900 |
|
12901 |
|
12902 |
|
12903 |
|
12904 |
|
12905 |
|
12906 |
|
12907 |
|
12908 |
|
12909 |
|
12910 |
|
12911 | assert.notStrictEqual = function (act, exp, msg) {
|
12912 | new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp);
|
12913 | };
|
12914 |
|
12915 | |
12916 |
|
12917 |
|
12918 |
|
12919 |
|
12920 |
|
12921 |
|
12922 |
|
12923 |
|
12924 |
|
12925 |
|
12926 |
|
12927 |
|
12928 |
|
12929 |
|
12930 |
|
12931 | assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) {
|
12932 | new Assertion(act, msg, assert.deepEqual, true).to.eql(exp);
|
12933 | };
|
12934 |
|
12935 | |
12936 |
|
12937 |
|
12938 |
|
12939 |
|
12940 |
|
12941 |
|
12942 |
|
12943 |
|
12944 |
|
12945 |
|
12946 |
|
12947 |
|
12948 |
|
12949 |
|
12950 | assert.notDeepEqual = function (act, exp, msg) {
|
12951 | new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp);
|
12952 | };
|
12953 |
|
12954 | |
12955 |
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 |
|
12961 |
|
12962 |
|
12963 |
|
12964 |
|
12965 |
|
12966 |
|
12967 |
|
12968 |
|
12969 | assert.isAbove = function (val, abv, msg) {
|
12970 | new Assertion(val, msg, assert.isAbove, true).to.be.above(abv);
|
12971 | };
|
12972 |
|
12973 | |
12974 |
|
12975 |
|
12976 |
|
12977 |
|
12978 |
|
12979 |
|
12980 |
|
12981 |
|
12982 |
|
12983 |
|
12984 |
|
12985 |
|
12986 |
|
12987 |
|
12988 |
|
12989 | assert.isAtLeast = function (val, atlst, msg) {
|
12990 | new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst);
|
12991 | };
|
12992 |
|
12993 | |
12994 |
|
12995 |
|
12996 |
|
12997 |
|
12998 |
|
12999 |
|
13000 |
|
13001 |
|
13002 |
|
13003 |
|
13004 |
|
13005 |
|
13006 |
|
13007 |
|
13008 | assert.isBelow = function (val, blw, msg) {
|
13009 | new Assertion(val, msg, assert.isBelow, true).to.be.below(blw);
|
13010 | };
|
13011 |
|
13012 | |
13013 |
|
13014 |
|
13015 |
|
13016 |
|
13017 |
|
13018 |
|
13019 |
|
13020 |
|
13021 |
|
13022 |
|
13023 |
|
13024 |
|
13025 |
|
13026 |
|
13027 |
|
13028 | assert.isAtMost = function (val, atmst, msg) {
|
13029 | new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst);
|
13030 | };
|
13031 |
|
13032 | |
13033 |
|
13034 |
|
13035 |
|
13036 |
|
13037 |
|
13038 |
|
13039 |
|
13040 |
|
13041 |
|
13042 |
|
13043 |
|
13044 |
|
13045 |
|
13046 |
|
13047 | assert.isTrue = function (val, msg) {
|
13048 | new Assertion(val, msg, assert.isTrue, true).is['true'];
|
13049 | };
|
13050 |
|
13051 | |
13052 |
|
13053 |
|
13054 |
|
13055 |
|
13056 |
|
13057 |
|
13058 |
|
13059 |
|
13060 |
|
13061 |
|
13062 |
|
13063 |
|
13064 |
|
13065 |
|
13066 | assert.isNotTrue = function (val, msg) {
|
13067 | new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true);
|
13068 | };
|
13069 |
|
13070 | |
13071 |
|
13072 |
|
13073 |
|
13074 |
|
13075 |
|
13076 |
|
13077 |
|
13078 |
|
13079 |
|
13080 |
|
13081 |
|
13082 |
|
13083 |
|
13084 |
|
13085 | assert.isFalse = function (val, msg) {
|
13086 | new Assertion(val, msg, assert.isFalse, true).is['false'];
|
13087 | };
|
13088 |
|
13089 | |
13090 |
|
13091 |
|
13092 |
|
13093 |
|
13094 |
|
13095 |
|
13096 |
|
13097 |
|
13098 |
|
13099 |
|
13100 |
|
13101 |
|
13102 |
|
13103 |
|
13104 | assert.isNotFalse = function (val, msg) {
|
13105 | new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false);
|
13106 | };
|
13107 |
|
13108 | |
13109 |
|
13110 |
|
13111 |
|
13112 |
|
13113 |
|
13114 |
|
13115 |
|
13116 |
|
13117 |
|
13118 |
|
13119 |
|
13120 |
|
13121 |
|
13122 | assert.isNull = function (val, msg) {
|
13123 | new Assertion(val, msg, assert.isNull, true).to.equal(null);
|
13124 | };
|
13125 |
|
13126 | |
13127 |
|
13128 |
|
13129 |
|
13130 |
|
13131 |
|
13132 |
|
13133 |
|
13134 |
|
13135 |
|
13136 |
|
13137 |
|
13138 |
|
13139 |
|
13140 |
|
13141 | assert.isNotNull = function (val, msg) {
|
13142 | new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null);
|
13143 | };
|
13144 |
|
13145 | |
13146 |
|
13147 |
|
13148 |
|
13149 |
|
13150 |
|
13151 |
|
13152 |
|
13153 |
|
13154 |
|
13155 |
|
13156 |
|
13157 |
|
13158 |
|
13159 | assert.isNaN = function (val, msg) {
|
13160 | new Assertion(val, msg, assert.isNaN, true).to.be.NaN;
|
13161 | };
|
13162 |
|
13163 | |
13164 |
|
13165 |
|
13166 |
|
13167 |
|
13168 |
|
13169 |
|
13170 |
|
13171 |
|
13172 |
|
13173 |
|
13174 |
|
13175 |
|
13176 | assert.isNotNaN = function (val, msg) {
|
13177 | new Assertion(val, msg, assert.isNotNaN, true).not.to.be.NaN;
|
13178 | };
|
13179 |
|
13180 | |
13181 |
|
13182 |
|
13183 |
|
13184 |
|
13185 |
|
13186 |
|
13187 |
|
13188 |
|
13189 |
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 | assert.exists = function (val, msg) {
|
13197 | new Assertion(val, msg, assert.exists, true).to.exist;
|
13198 | };
|
13199 |
|
13200 | |
13201 |
|
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 |
|
13208 |
|
13209 |
|
13210 |
|
13211 |
|
13212 |
|
13213 |
|
13214 |
|
13215 |
|
13216 |
|
13217 |
|
13218 | assert.notExists = function (val, msg) {
|
13219 | new Assertion(val, msg, assert.notExists, true).to.not.exist;
|
13220 | };
|
13221 |
|
13222 | |
13223 |
|
13224 |
|
13225 |
|
13226 |
|
13227 |
|
13228 |
|
13229 |
|
13230 |
|
13231 |
|
13232 |
|
13233 |
|
13234 |
|
13235 |
|
13236 |
|
13237 | assert.isUndefined = function (val, msg) {
|
13238 | new Assertion(val, msg, assert.isUndefined, true).to.equal(undefined);
|
13239 | };
|
13240 |
|
13241 | |
13242 |
|
13243 |
|
13244 |
|
13245 |
|
13246 |
|
13247 |
|
13248 |
|
13249 |
|
13250 |
|
13251 |
|
13252 |
|
13253 |
|
13254 |
|
13255 |
|
13256 | assert.isDefined = function (val, msg) {
|
13257 | new Assertion(val, msg, assert.isDefined, true).to.not.equal(undefined);
|
13258 | };
|
13259 |
|
13260 | |
13261 |
|
13262 |
|
13263 |
|
13264 |
|
13265 |
|
13266 |
|
13267 |
|
13268 |
|
13269 |
|
13270 |
|
13271 |
|
13272 |
|
13273 |
|
13274 |
|
13275 | assert.isFunction = function (val, msg) {
|
13276 | new Assertion(val, msg, assert.isFunction, true).to.be.a('function');
|
13277 | };
|
13278 |
|
13279 | |
13280 |
|
13281 |
|
13282 |
|
13283 |
|
13284 |
|
13285 |
|
13286 |
|
13287 |
|
13288 |
|
13289 |
|
13290 |
|
13291 |
|
13292 |
|
13293 |
|
13294 | assert.isNotFunction = function (val, msg) {
|
13295 | new Assertion(val, msg, assert.isNotFunction, true).to.not.be.a('function');
|
13296 | };
|
13297 |
|
13298 | |
13299 |
|
13300 |
|
13301 |
|
13302 |
|
13303 |
|
13304 |
|
13305 |
|
13306 |
|
13307 |
|
13308 |
|
13309 |
|
13310 |
|
13311 |
|
13312 |
|
13313 |
|
13314 | assert.isObject = function (val, msg) {
|
13315 | new Assertion(val, msg, assert.isObject, true).to.be.a('object');
|
13316 | };
|
13317 |
|
13318 | |
13319 |
|
13320 |
|
13321 |
|
13322 |
|
13323 |
|
13324 |
|
13325 |
|
13326 |
|
13327 |
|
13328 |
|
13329 |
|
13330 |
|
13331 |
|
13332 |
|
13333 |
|
13334 | assert.isNotObject = function (val, msg) {
|
13335 | new Assertion(val, msg, assert.isNotObject, true).to.not.be.a('object');
|
13336 | };
|
13337 |
|
13338 | |
13339 |
|
13340 |
|
13341 |
|
13342 |
|
13343 |
|
13344 |
|
13345 |
|
13346 |
|
13347 |
|
13348 |
|
13349 |
|
13350 |
|
13351 |
|
13352 |
|
13353 | assert.isArray = function (val, msg) {
|
13354 | new Assertion(val, msg, assert.isArray, true).to.be.an('array');
|
13355 | };
|
13356 |
|
13357 | |
13358 |
|
13359 |
|
13360 |
|
13361 |
|
13362 |
|
13363 |
|
13364 |
|
13365 |
|
13366 |
|
13367 |
|
13368 |
|
13369 |
|
13370 |
|
13371 |
|
13372 | assert.isNotArray = function (val, msg) {
|
13373 | new Assertion(val, msg, assert.isNotArray, true).to.not.be.an('array');
|
13374 | };
|
13375 |
|
13376 | |
13377 |
|
13378 |
|
13379 |
|
13380 |
|
13381 |
|
13382 |
|
13383 |
|
13384 |
|
13385 |
|
13386 |
|
13387 |
|
13388 |
|
13389 |
|
13390 |
|
13391 | assert.isString = function (val, msg) {
|
13392 | new Assertion(val, msg, assert.isString, true).to.be.a('string');
|
13393 | };
|
13394 |
|
13395 | |
13396 |
|
13397 |
|
13398 |
|
13399 |
|
13400 |
|
13401 |
|
13402 |
|
13403 |
|
13404 |
|
13405 |
|
13406 |
|
13407 |
|
13408 |
|
13409 |
|
13410 | assert.isNotString = function (val, msg) {
|
13411 | new Assertion(val, msg, assert.isNotString, true).to.not.be.a('string');
|
13412 | };
|
13413 |
|
13414 | |
13415 |
|
13416 |
|
13417 |
|
13418 |
|
13419 |
|
13420 |
|
13421 |
|
13422 |
|
13423 |
|
13424 |
|
13425 |
|
13426 |
|
13427 |
|
13428 |
|
13429 | assert.isNumber = function (val, msg) {
|
13430 | new Assertion(val, msg, assert.isNumber, true).to.be.a('number');
|
13431 | };
|
13432 |
|
13433 | |
13434 |
|
13435 |
|
13436 |
|
13437 |
|
13438 |
|
13439 |
|
13440 |
|
13441 |
|
13442 |
|
13443 |
|
13444 |
|
13445 |
|
13446 |
|
13447 |
|
13448 | assert.isNotNumber = function (val, msg) {
|
13449 | new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a('number');
|
13450 | };
|
13451 |
|
13452 | |
13453 |
|
13454 |
|
13455 |
|
13456 |
|
13457 |
|
13458 |
|
13459 |
|
13460 |
|
13461 |
|
13462 |
|
13463 |
|
13464 |
|
13465 |
|
13466 |
|
13467 |
|
13468 |
|
13469 | assert.isFinite = function (val, msg) {
|
13470 | new Assertion(val, msg, assert.isFinite, true).to.be.finite;
|
13471 | };
|
13472 |
|
13473 | |
13474 |
|
13475 |
|
13476 |
|
13477 |
|
13478 |
|
13479 |
|
13480 |
|
13481 |
|
13482 |
|
13483 |
|
13484 |
|
13485 |
|
13486 |
|
13487 |
|
13488 |
|
13489 |
|
13490 |
|
13491 | assert.isBoolean = function (val, msg) {
|
13492 | new Assertion(val, msg, assert.isBoolean, true).to.be.a('boolean');
|
13493 | };
|
13494 |
|
13495 | |
13496 |
|
13497 |
|
13498 |
|
13499 |
|
13500 |
|
13501 |
|
13502 |
|
13503 |
|
13504 |
|
13505 |
|
13506 |
|
13507 |
|
13508 |
|
13509 |
|
13510 |
|
13511 |
|
13512 |
|
13513 | assert.isNotBoolean = function (val, msg) {
|
13514 | new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a('boolean');
|
13515 | };
|
13516 |
|
13517 | |
13518 |
|
13519 |
|
13520 |
|
13521 |
|
13522 |
|
13523 |
|
13524 |
|
13525 |
|
13526 |
|
13527 |
|
13528 |
|
13529 |
|
13530 |
|
13531 |
|
13532 |
|
13533 |
|
13534 |
|
13535 |
|
13536 |
|
13537 |
|
13538 | assert.typeOf = function (val, type, msg) {
|
13539 | new Assertion(val, msg, assert.typeOf, true).to.be.a(type);
|
13540 | };
|
13541 |
|
13542 | |
13543 |
|
13544 |
|
13545 |
|
13546 |
|
13547 |
|
13548 |
|
13549 |
|
13550 |
|
13551 |
|
13552 |
|
13553 |
|
13554 |
|
13555 |
|
13556 |
|
13557 |
|
13558 | assert.notTypeOf = function (val, type, msg) {
|
13559 | new Assertion(val, msg, assert.notTypeOf, true).to.not.be.a(type);
|
13560 | };
|
13561 |
|
13562 | |
13563 |
|
13564 |
|
13565 |
|
13566 |
|
13567 |
|
13568 |
|
13569 |
|
13570 |
|
13571 |
|
13572 |
|
13573 |
|
13574 |
|
13575 |
|
13576 |
|
13577 |
|
13578 |
|
13579 |
|
13580 | assert.instanceOf = function (val, type, msg) {
|
13581 | new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type);
|
13582 | };
|
13583 |
|
13584 | |
13585 |
|
13586 |
|
13587 |
|
13588 |
|
13589 |
|
13590 |
|
13591 |
|
13592 |
|
13593 |
|
13594 |
|
13595 |
|
13596 |
|
13597 |
|
13598 |
|
13599 |
|
13600 |
|
13601 |
|
13602 | assert.notInstanceOf = function (val, type, msg) {
|
13603 | new Assertion(val, msg, assert.notInstanceOf, true)
|
13604 | .to.not.be.instanceOf(type);
|
13605 | };
|
13606 |
|
13607 | |
13608 |
|
13609 |
|
13610 |
|
13611 |
|
13612 |
|
13613 |
|
13614 |
|
13615 |
|
13616 |
|
13617 |
|
13618 |
|
13619 |
|
13620 |
|
13621 |
|
13622 |
|
13623 |
|
13624 |
|
13625 |
|
13626 |
|
13627 |
|
13628 |
|
13629 |
|
13630 |
|
13631 |
|
13632 |
|
13633 |
|
13634 |
|
13635 |
|
13636 |
|
13637 |
|
13638 | assert.include = function (exp, inc, msg) {
|
13639 | new Assertion(exp, msg, assert.include, true).include(inc);
|
13640 | };
|
13641 |
|
13642 | |
13643 |
|
13644 |
|
13645 |
|
13646 |
|
13647 |
|
13648 |
|
13649 |
|
13650 |
|
13651 |
|
13652 |
|
13653 |
|
13654 |
|
13655 |
|
13656 |
|
13657 |
|
13658 |
|
13659 |
|
13660 |
|
13661 |
|
13662 |
|
13663 |
|
13664 |
|
13665 |
|
13666 |
|
13667 |
|
13668 |
|
13669 |
|
13670 |
|
13671 |
|
13672 |
|
13673 |
|
13674 | assert.notInclude = function (exp, inc, msg) {
|
13675 | new Assertion(exp, msg, assert.notInclude, true).not.include(inc);
|
13676 | };
|
13677 |
|
13678 | |
13679 |
|
13680 |
|
13681 |
|
13682 |
|
13683 |
|
13684 |
|
13685 |
|
13686 |
|
13687 |
|
13688 |
|
13689 |
|
13690 |
|
13691 |
|
13692 |
|
13693 |
|
13694 |
|
13695 |
|
13696 |
|
13697 |
|
13698 |
|
13699 | assert.deepInclude = function (exp, inc, msg) {
|
13700 | new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc);
|
13701 | };
|
13702 |
|
13703 | |
13704 |
|
13705 |
|
13706 |
|
13707 |
|
13708 |
|
13709 |
|
13710 |
|
13711 |
|
13712 |
|
13713 |
|
13714 |
|
13715 |
|
13716 |
|
13717 |
|
13718 |
|
13719 |
|
13720 |
|
13721 |
|
13722 |
|
13723 |
|
13724 | assert.notDeepInclude = function (exp, inc, msg) {
|
13725 | new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc);
|
13726 | };
|
13727 |
|
13728 | |
13729 |
|
13730 |
|
13731 |
|
13732 |
|
13733 |
|
13734 |
|
13735 |
|
13736 |
|
13737 |
|
13738 |
|
13739 |
|
13740 |
|
13741 |
|
13742 |
|
13743 |
|
13744 |
|
13745 |
|
13746 |
|
13747 |
|
13748 |
|
13749 | assert.nestedInclude = function (exp, inc, msg) {
|
13750 | new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
|
13751 | };
|
13752 |
|
13753 | |
13754 |
|
13755 |
|
13756 |
|
13757 |
|
13758 |
|
13759 |
|
13760 |
|
13761 |
|
13762 |
|
13763 |
|
13764 |
|
13765 |
|
13766 |
|
13767 |
|
13768 |
|
13769 |
|
13770 |
|
13771 |
|
13772 |
|
13773 |
|
13774 | assert.notNestedInclude = function (exp, inc, msg) {
|
13775 | new Assertion(exp, msg, assert.notNestedInclude, true)
|
13776 | .not.nested.include(inc);
|
13777 | };
|
13778 |
|
13779 | |
13780 |
|
13781 |
|
13782 |
|
13783 |
|
13784 |
|
13785 |
|
13786 |
|
13787 |
|
13788 |
|
13789 |
|
13790 |
|
13791 |
|
13792 |
|
13793 |
|
13794 |
|
13795 |
|
13796 |
|
13797 |
|
13798 |
|
13799 |
|
13800 | assert.deepNestedInclude = function(exp, inc, msg) {
|
13801 | new Assertion(exp, msg, assert.deepNestedInclude, true)
|
13802 | .deep.nested.include(inc);
|
13803 | };
|
13804 |
|
13805 | |
13806 |
|
13807 |
|
13808 |
|
13809 |
|
13810 |
|
13811 |
|
13812 |
|
13813 |
|
13814 |
|
13815 |
|
13816 |
|
13817 |
|
13818 |
|
13819 |
|
13820 |
|
13821 |
|
13822 |
|
13823 |
|
13824 |
|
13825 |
|
13826 | assert.notDeepNestedInclude = function(exp, inc, msg) {
|
13827 | new Assertion(exp, msg, assert.notDeepNestedInclude, true)
|
13828 | .not.deep.nested.include(inc);
|
13829 | };
|
13830 |
|
13831 | |
13832 |
|
13833 |
|
13834 |
|
13835 |
|
13836 |
|
13837 |
|
13838 |
|
13839 |
|
13840 |
|
13841 |
|
13842 |
|
13843 |
|
13844 |
|
13845 |
|
13846 |
|
13847 |
|
13848 | assert.ownInclude = function(exp, inc, msg) {
|
13849 | new Assertion(exp, msg, assert.ownInclude, true).own.include(inc);
|
13850 | };
|
13851 |
|
13852 | |
13853 |
|
13854 |
|
13855 |
|
13856 |
|
13857 |
|
13858 |
|
13859 |
|
13860 |
|
13861 |
|
13862 |
|
13863 |
|
13864 |
|
13865 |
|
13866 |
|
13867 |
|
13868 |
|
13869 |
|
13870 |
|
13871 | assert.notOwnInclude = function(exp, inc, msg) {
|
13872 | new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc);
|
13873 | };
|
13874 |
|
13875 | |
13876 |
|
13877 |
|
13878 |
|
13879 |
|
13880 |
|
13881 |
|
13882 |
|
13883 |
|
13884 |
|
13885 |
|
13886 |
|
13887 |
|
13888 |
|
13889 |
|
13890 |
|
13891 |
|
13892 | assert.deepOwnInclude = function(exp, inc, msg) {
|
13893 | new Assertion(exp, msg, assert.deepOwnInclude, true)
|
13894 | .deep.own.include(inc);
|
13895 | };
|
13896 |
|
13897 | |
13898 |
|
13899 |
|
13900 |
|
13901 |
|
13902 |
|
13903 |
|
13904 |
|
13905 |
|
13906 |
|
13907 |
|
13908 |
|
13909 |
|
13910 |
|
13911 |
|
13912 |
|
13913 |
|
13914 | assert.notDeepOwnInclude = function(exp, inc, msg) {
|
13915 | new Assertion(exp, msg, assert.notDeepOwnInclude, true)
|
13916 | .not.deep.own.include(inc);
|
13917 | };
|
13918 |
|
13919 | |
13920 |
|
13921 |
|
13922 |
|
13923 |
|
13924 |
|
13925 |
|
13926 |
|
13927 |
|
13928 |
|
13929 |
|
13930 |
|
13931 |
|
13932 |
|
13933 |
|
13934 | assert.match = function (exp, re, msg) {
|
13935 | new Assertion(exp, msg, assert.match, true).to.match(re);
|
13936 | };
|
13937 |
|
13938 | |
13939 |
|
13940 |
|
13941 |
|
13942 |
|
13943 |
|
13944 |
|
13945 |
|
13946 |
|
13947 |
|
13948 |
|
13949 |
|
13950 |
|
13951 |
|
13952 |
|
13953 | assert.notMatch = function (exp, re, msg) {
|
13954 | new Assertion(exp, msg, assert.notMatch, true).to.not.match(re);
|
13955 | };
|
13956 |
|
13957 | |
13958 |
|
13959 |
|
13960 |
|
13961 |
|
13962 |
|
13963 |
|
13964 |
|
13965 |
|
13966 |
|
13967 |
|
13968 |
|
13969 |
|
13970 |
|
13971 |
|
13972 |
|
13973 |
|
13974 | assert.property = function (obj, prop, msg) {
|
13975 | new Assertion(obj, msg, assert.property, true).to.have.property(prop);
|
13976 | };
|
13977 |
|
13978 | |
13979 |
|
13980 |
|
13981 |
|
13982 |
|
13983 |
|
13984 |
|
13985 |
|
13986 |
|
13987 |
|
13988 |
|
13989 |
|
13990 |
|
13991 |
|
13992 |
|
13993 |
|
13994 | assert.notProperty = function (obj, prop, msg) {
|
13995 | new Assertion(obj, msg, assert.notProperty, true)
|
13996 | .to.not.have.property(prop);
|
13997 | };
|
13998 |
|
13999 | |
14000 |
|
14001 |
|
14002 |
|
14003 |
|
14004 |
|
14005 |
|
14006 |
|
14007 |
|
14008 |
|
14009 |
|
14010 |
|
14011 |
|
14012 |
|
14013 |
|
14014 |
|
14015 |
|
14016 |
|
14017 | assert.propertyVal = function (obj, prop, val, msg) {
|
14018 | new Assertion(obj, msg, assert.propertyVal, true)
|
14019 | .to.have.property(prop, val);
|
14020 | };
|
14021 |
|
14022 | |
14023 |
|
14024 |
|
14025 |
|
14026 |
|
14027 |
|
14028 |
|
14029 |
|
14030 |
|
14031 |
|
14032 |
|
14033 |
|
14034 |
|
14035 |
|
14036 |
|
14037 |
|
14038 |
|
14039 |
|
14040 |
|
14041 | assert.notPropertyVal = function (obj, prop, val, msg) {
|
14042 | new Assertion(obj, msg, assert.notPropertyVal, true)
|
14043 | .to.not.have.property(prop, val);
|
14044 | };
|
14045 |
|
14046 | |
14047 |
|
14048 |
|
14049 |
|
14050 |
|
14051 |
|
14052 |
|
14053 |
|
14054 |
|
14055 |
|
14056 |
|
14057 |
|
14058 |
|
14059 |
|
14060 |
|
14061 |
|
14062 |
|
14063 | assert.deepPropertyVal = function (obj, prop, val, msg) {
|
14064 | new Assertion(obj, msg, assert.deepPropertyVal, true)
|
14065 | .to.have.deep.property(prop, val);
|
14066 | };
|
14067 |
|
14068 | |
14069 |
|
14070 |
|
14071 |
|
14072 |
|
14073 |
|
14074 |
|
14075 |
|
14076 |
|
14077 |
|
14078 |
|
14079 |
|
14080 |
|
14081 |
|
14082 |
|
14083 |
|
14084 |
|
14085 |
|
14086 |
|
14087 | assert.notDeepPropertyVal = function (obj, prop, val, msg) {
|
14088 | new Assertion(obj, msg, assert.notDeepPropertyVal, true)
|
14089 | .to.not.have.deep.property(prop, val);
|
14090 | };
|
14091 |
|
14092 | |
14093 |
|
14094 |
|
14095 |
|
14096 |
|
14097 |
|
14098 |
|
14099 |
|
14100 |
|
14101 |
|
14102 |
|
14103 |
|
14104 |
|
14105 |
|
14106 |
|
14107 | assert.ownProperty = function (obj, prop, msg) {
|
14108 | new Assertion(obj, msg, assert.ownProperty, true)
|
14109 | .to.have.own.property(prop);
|
14110 | };
|
14111 |
|
14112 | |
14113 |
|
14114 |
|
14115 |
|
14116 |
|
14117 |
|
14118 |
|
14119 |
|
14120 |
|
14121 |
|
14122 |
|
14123 |
|
14124 |
|
14125 |
|
14126 |
|
14127 |
|
14128 | assert.notOwnProperty = function (obj, prop, msg) {
|
14129 | new Assertion(obj, msg, assert.notOwnProperty, true)
|
14130 | .to.not.have.own.property(prop);
|
14131 | };
|
14132 |
|
14133 | |
14134 |
|
14135 |
|
14136 |
|
14137 |
|
14138 |
|
14139 |
|
14140 |
|
14141 |
|
14142 |
|
14143 |
|
14144 |
|
14145 |
|
14146 |
|
14147 |
|
14148 |
|
14149 |
|
14150 | assert.ownPropertyVal = function (obj, prop, value, msg) {
|
14151 | new Assertion(obj, msg, assert.ownPropertyVal, true)
|
14152 | .to.have.own.property(prop, value);
|
14153 | };
|
14154 |
|
14155 | |
14156 |
|
14157 |
|
14158 |
|
14159 |
|
14160 |
|
14161 |
|
14162 |
|
14163 |
|
14164 |
|
14165 |
|
14166 |
|
14167 |
|
14168 |
|
14169 |
|
14170 |
|
14171 |
|
14172 |
|
14173 | assert.notOwnPropertyVal = function (obj, prop, value, msg) {
|
14174 | new Assertion(obj, msg, assert.notOwnPropertyVal, true)
|
14175 | .to.not.have.own.property(prop, value);
|
14176 | };
|
14177 |
|
14178 | |
14179 |
|
14180 |
|
14181 |
|
14182 |
|
14183 |
|
14184 |
|
14185 |
|
14186 |
|
14187 |
|
14188 |
|
14189 |
|
14190 |
|
14191 |
|
14192 |
|
14193 |
|
14194 |
|
14195 | assert.deepOwnPropertyVal = function (obj, prop, value, msg) {
|
14196 | new Assertion(obj, msg, assert.deepOwnPropertyVal, true)
|
14197 | .to.have.deep.own.property(prop, value);
|
14198 | };
|
14199 |
|
14200 | |
14201 |
|
14202 |
|
14203 |
|
14204 |
|
14205 |
|
14206 |
|
14207 |
|
14208 |
|
14209 |
|
14210 |
|
14211 |
|
14212 |
|
14213 |
|
14214 |
|
14215 |
|
14216 |
|
14217 |
|
14218 |
|
14219 |
|
14220 | assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) {
|
14221 | new Assertion(obj, msg, assert.notDeepOwnPropertyVal, true)
|
14222 | .to.not.have.deep.own.property(prop, value);
|
14223 | };
|
14224 |
|
14225 | |
14226 |
|
14227 |
|
14228 |
|
14229 |
|
14230 |
|
14231 |
|
14232 |
|
14233 |
|
14234 |
|
14235 |
|
14236 |
|
14237 |
|
14238 |
|
14239 |
|
14240 |
|
14241 |
|
14242 | assert.nestedProperty = function (obj, prop, msg) {
|
14243 | new Assertion(obj, msg, assert.nestedProperty, true)
|
14244 | .to.have.nested.property(prop);
|
14245 | };
|
14246 |
|
14247 | |
14248 |
|
14249 |
|
14250 |
|
14251 |
|
14252 |
|
14253 |
|
14254 |
|
14255 |
|
14256 |
|
14257 |
|
14258 |
|
14259 |
|
14260 |
|
14261 |
|
14262 |
|
14263 |
|
14264 | assert.notNestedProperty = function (obj, prop, msg) {
|
14265 | new Assertion(obj, msg, assert.notNestedProperty, true)
|
14266 | .to.not.have.nested.property(prop);
|
14267 | };
|
14268 |
|
14269 | |
14270 |
|
14271 |
|
14272 |
|
14273 |
|
14274 |
|
14275 |
|
14276 |
|
14277 |
|
14278 |
|
14279 |
|
14280 |
|
14281 |
|
14282 |
|
14283 |
|
14284 |
|
14285 |
|
14286 |
|
14287 | assert.nestedPropertyVal = function (obj, prop, val, msg) {
|
14288 | new Assertion(obj, msg, assert.nestedPropertyVal, true)
|
14289 | .to.have.nested.property(prop, val);
|
14290 | };
|
14291 |
|
14292 | |
14293 |
|
14294 |
|
14295 |
|
14296 |
|
14297 |
|
14298 |
|
14299 |
|
14300 |
|
14301 |
|
14302 |
|
14303 |
|
14304 |
|
14305 |
|
14306 |
|
14307 |
|
14308 |
|
14309 |
|
14310 |
|
14311 | assert.notNestedPropertyVal = function (obj, prop, val, msg) {
|
14312 | new Assertion(obj, msg, assert.notNestedPropertyVal, true)
|
14313 | .to.not.have.nested.property(prop, val);
|
14314 | };
|
14315 |
|
14316 | |
14317 |
|
14318 |
|
14319 |
|
14320 |
|
14321 |
|
14322 |
|
14323 |
|
14324 |
|
14325 |
|
14326 |
|
14327 |
|
14328 |
|
14329 |
|
14330 |
|
14331 |
|
14332 |
|
14333 |
|
14334 | assert.deepNestedPropertyVal = function (obj, prop, val, msg) {
|
14335 | new Assertion(obj, msg, assert.deepNestedPropertyVal, true)
|
14336 | .to.have.deep.nested.property(prop, val);
|
14337 | };
|
14338 |
|
14339 | |
14340 |
|
14341 |
|
14342 |
|
14343 |
|
14344 |
|
14345 |
|
14346 |
|
14347 |
|
14348 |
|
14349 |
|
14350 |
|
14351 |
|
14352 |
|
14353 |
|
14354 |
|
14355 |
|
14356 |
|
14357 |
|
14358 |
|
14359 | assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) {
|
14360 | new Assertion(obj, msg, assert.notDeepNestedPropertyVal, true)
|
14361 | .to.not.have.deep.nested.property(prop, val);
|
14362 | };
|
14363 |
|
14364 | |
14365 |
|
14366 |
|
14367 |
|
14368 |
|
14369 |
|
14370 |
|
14371 |
|
14372 |
|
14373 |
|
14374 |
|
14375 |
|
14376 |
|
14377 |
|
14378 |
|
14379 |
|
14380 | assert.lengthOf = function (exp, len, msg) {
|
14381 | new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len);
|
14382 | };
|
14383 |
|
14384 | |
14385 |
|
14386 |
|
14387 |
|
14388 |
|
14389 |
|
14390 |
|
14391 |
|
14392 |
|
14393 |
|
14394 |
|
14395 |
|
14396 |
|
14397 |
|
14398 |
|
14399 |
|
14400 |
|
14401 |
|
14402 |
|
14403 |
|
14404 | assert.hasAnyKeys = function (obj, keys, msg) {
|
14405 | new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys);
|
14406 | };
|
14407 |
|
14408 | |
14409 |
|
14410 |
|
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 |
|
14417 |
|
14418 |
|
14419 |
|
14420 |
|
14421 |
|
14422 |
|
14423 |
|
14424 |
|
14425 |
|
14426 |
|
14427 |
|
14428 | assert.hasAllKeys = function (obj, keys, msg) {
|
14429 | new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys);
|
14430 | };
|
14431 |
|
14432 | |
14433 |
|
14434 |
|
14435 |
|
14436 |
|
14437 |
|
14438 |
|
14439 |
|
14440 |
|
14441 |
|
14442 |
|
14443 |
|
14444 |
|
14445 |
|
14446 |
|
14447 |
|
14448 |
|
14449 |
|
14450 |
|
14451 |
|
14452 |
|
14453 |
|
14454 |
|
14455 |
|
14456 | assert.containsAllKeys = function (obj, keys, msg) {
|
14457 | new Assertion(obj, msg, assert.containsAllKeys, true)
|
14458 | .to.contain.all.keys(keys);
|
14459 | };
|
14460 |
|
14461 | |
14462 |
|
14463 |
|
14464 |
|
14465 |
|
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 |
|
14471 |
|
14472 |
|
14473 |
|
14474 |
|
14475 |
|
14476 |
|
14477 |
|
14478 |
|
14479 |
|
14480 |
|
14481 | assert.doesNotHaveAnyKeys = function (obj, keys, msg) {
|
14482 | new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true)
|
14483 | .to.not.have.any.keys(keys);
|
14484 | };
|
14485 |
|
14486 | |
14487 |
|
14488 |
|
14489 |
|
14490 |
|
14491 |
|
14492 |
|
14493 |
|
14494 |
|
14495 |
|
14496 |
|
14497 |
|
14498 |
|
14499 |
|
14500 |
|
14501 |
|
14502 |
|
14503 |
|
14504 |
|
14505 |
|
14506 | assert.doesNotHaveAllKeys = function (obj, keys, msg) {
|
14507 | new Assertion(obj, msg, assert.doesNotHaveAllKeys, true)
|
14508 | .to.not.have.all.keys(keys);
|
14509 | };
|
14510 |
|
14511 | |
14512 |
|
14513 |
|
14514 |
|
14515 |
|
14516 |
|
14517 |
|
14518 |
|
14519 |
|
14520 |
|
14521 |
|
14522 |
|
14523 |
|
14524 |
|
14525 |
|
14526 |
|
14527 |
|
14528 |
|
14529 |
|
14530 |
|
14531 |
|
14532 |
|
14533 |
|
14534 |
|
14535 | assert.hasAnyDeepKeys = function (obj, keys, msg) {
|
14536 | new Assertion(obj, msg, assert.hasAnyDeepKeys, true)
|
14537 | .to.have.any.deep.keys(keys);
|
14538 | };
|
14539 |
|
14540 | |
14541 |
|
14542 |
|
14543 |
|
14544 |
|
14545 |
|
14546 |
|
14547 |
|
14548 |
|
14549 |
|
14550 |
|
14551 |
|
14552 |
|
14553 |
|
14554 |
|
14555 |
|
14556 |
|
14557 |
|
14558 |
|
14559 |
|
14560 |
|
14561 |
|
14562 | assert.hasAllDeepKeys = function (obj, keys, msg) {
|
14563 | new Assertion(obj, msg, assert.hasAllDeepKeys, true)
|
14564 | .to.have.all.deep.keys(keys);
|
14565 | };
|
14566 |
|
14567 | |
14568 |
|
14569 |
|
14570 |
|
14571 |
|
14572 |
|
14573 |
|
14574 |
|
14575 |
|
14576 |
|
14577 |
|
14578 |
|
14579 |
|
14580 |
|
14581 |
|
14582 |
|
14583 |
|
14584 |
|
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 | assert.containsAllDeepKeys = function (obj, keys, msg) {
|
14590 | new Assertion(obj, msg, assert.containsAllDeepKeys, true)
|
14591 | .to.contain.all.deep.keys(keys);
|
14592 | };
|
14593 |
|
14594 | |
14595 |
|
14596 |
|
14597 |
|
14598 |
|
14599 |
|
14600 |
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 |
|
14606 |
|
14607 |
|
14608 |
|
14609 |
|
14610 |
|
14611 |
|
14612 |
|
14613 |
|
14614 |
|
14615 |
|
14616 | assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) {
|
14617 | new Assertion(obj, msg, assert.doesNotHaveAnyDeepKeys, true)
|
14618 | .to.not.have.any.deep.keys(keys);
|
14619 | };
|
14620 |
|
14621 | |
14622 |
|
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 |
|
14638 |
|
14639 |
|
14640 |
|
14641 |
|
14642 |
|
14643 | assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) {
|
14644 | new Assertion(obj, msg, assert.doesNotHaveAllDeepKeys, true)
|
14645 | .to.not.have.all.deep.keys(keys);
|
14646 | };
|
14647 |
|
14648 | |
14649 |
|
14650 |
|
14651 |
|
14652 |
|
14653 |
|
14654 |
|
14655 |
|
14656 |
|
14657 |
|
14658 |
|
14659 |
|
14660 |
|
14661 |
|
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 |
|
14670 |
|
14671 |
|
14672 |
|
14673 |
|
14674 |
|
14675 |
|
14676 |
|
14677 |
|
14678 |
|
14679 | assert.throws = function (fn, errorLike, errMsgMatcher, msg) {
|
14680 | if ('string' === typeof errorLike || errorLike instanceof RegExp) {
|
14681 | errMsgMatcher = errorLike;
|
14682 | errorLike = null;
|
14683 | }
|
14684 |
|
14685 | var assertErr = new Assertion(fn, msg, assert.throws, true)
|
14686 | .to.throw(errorLike, errMsgMatcher);
|
14687 | return flag(assertErr, 'object');
|
14688 | };
|
14689 |
|
14690 | |
14691 |
|
14692 |
|
14693 |
|
14694 |
|
14695 |
|
14696 |
|
14697 |
|
14698 |
|
14699 |
|
14700 |
|
14701 |
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 |
|
14715 |
|
14716 |
|
14717 |
|
14718 |
|
14719 | assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) {
|
14720 | if ('string' === typeof errorLike || errorLike instanceof RegExp) {
|
14721 | errMsgMatcher = errorLike;
|
14722 | errorLike = null;
|
14723 | }
|
14724 |
|
14725 | new Assertion(fn, msg, assert.doesNotThrow, true)
|
14726 | .to.not.throw(errorLike, errMsgMatcher);
|
14727 | };
|
14728 |
|
14729 | |
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 |
|
14739 |
|
14740 |
|
14741 |
|
14742 |
|
14743 |
|
14744 |
|
14745 |
|
14746 | assert.operator = function (val, operator, val2, msg) {
|
14747 | var ok;
|
14748 | switch(operator) {
|
14749 | case '==':
|
14750 | ok = val == val2;
|
14751 | break;
|
14752 | case '===':
|
14753 | ok = val === val2;
|
14754 | break;
|
14755 | case '>':
|
14756 | ok = val > val2;
|
14757 | break;
|
14758 | case '>=':
|
14759 | ok = val >= val2;
|
14760 | break;
|
14761 | case '<':
|
14762 | ok = val < val2;
|
14763 | break;
|
14764 | case '<=':
|
14765 | ok = val <= val2;
|
14766 | break;
|
14767 | case '!=':
|
14768 | ok = val != val2;
|
14769 | break;
|
14770 | case '!==':
|
14771 | ok = val !== val2;
|
14772 | break;
|
14773 | default:
|
14774 | msg = msg ? msg + ': ' : msg;
|
14775 | throw new chai.AssertionError(
|
14776 | msg + 'Invalid operator "' + operator + '"',
|
14777 | undefined,
|
14778 | assert.operator
|
14779 | );
|
14780 | }
|
14781 | var test = new Assertion(ok, msg, assert.operator, true);
|
14782 | test.assert(
|
14783 | true === flag(test, 'object')
|
14784 | , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
|
14785 | , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
|
14786 | };
|
14787 |
|
14788 | |
14789 |
|
14790 |
|
14791 |
|
14792 |
|
14793 |
|
14794 |
|
14795 |
|
14796 |
|
14797 |
|
14798 |
|
14799 |
|
14800 |
|
14801 |
|
14802 |
|
14803 |
|
14804 | assert.closeTo = function (act, exp, delta, msg) {
|
14805 | new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta);
|
14806 | };
|
14807 |
|
14808 | |
14809 |
|
14810 |
|
14811 |
|
14812 |
|
14813 |
|
14814 |
|
14815 |
|
14816 |
|
14817 |
|
14818 |
|
14819 |
|
14820 |
|
14821 |
|
14822 |
|
14823 |
|
14824 | assert.approximately = function (act, exp, delta, msg) {
|
14825 | new Assertion(act, msg, assert.approximately, true)
|
14826 | .to.be.approximately(exp, delta);
|
14827 | };
|
14828 |
|
14829 | |
14830 |
|
14831 |
|
14832 |
|
14833 |
|
14834 |
|
14835 |
|
14836 |
|
14837 |
|
14838 |
|
14839 |
|
14840 |
|
14841 |
|
14842 |
|
14843 |
|
14844 |
|
14845 | assert.sameMembers = function (set1, set2, msg) {
|
14846 | new Assertion(set1, msg, assert.sameMembers, true)
|
14847 | .to.have.same.members(set2);
|
14848 | };
|
14849 |
|
14850 | |
14851 |
|
14852 |
|
14853 |
|
14854 |
|
14855 |
|
14856 |
|
14857 |
|
14858 |
|
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 |
|
14865 |
|
14866 | assert.notSameMembers = function (set1, set2, msg) {
|
14867 | new Assertion(set1, msg, assert.notSameMembers, true)
|
14868 | .to.not.have.same.members(set2);
|
14869 | };
|
14870 |
|
14871 | |
14872 |
|
14873 |
|
14874 |
|
14875 |
|
14876 |
|
14877 |
|
14878 |
|
14879 |
|
14880 |
|
14881 |
|
14882 |
|
14883 |
|
14884 |
|
14885 |
|
14886 |
|
14887 | assert.sameDeepMembers = function (set1, set2, msg) {
|
14888 | new Assertion(set1, msg, assert.sameDeepMembers, true)
|
14889 | .to.have.same.deep.members(set2);
|
14890 | };
|
14891 |
|
14892 | |
14893 |
|
14894 |
|
14895 |
|
14896 |
|
14897 |
|
14898 |
|
14899 |
|
14900 |
|
14901 |
|
14902 |
|
14903 |
|
14904 |
|
14905 |
|
14906 |
|
14907 |
|
14908 | assert.notSameDeepMembers = function (set1, set2, msg) {
|
14909 | new Assertion(set1, msg, assert.notSameDeepMembers, true)
|
14910 | .to.not.have.same.deep.members(set2);
|
14911 | };
|
14912 |
|
14913 | |
14914 |
|
14915 |
|
14916 |
|
14917 |
|
14918 |
|
14919 |
|
14920 |
|
14921 |
|
14922 |
|
14923 |
|
14924 |
|
14925 |
|
14926 |
|
14927 |
|
14928 |
|
14929 | assert.sameOrderedMembers = function (set1, set2, msg) {
|
14930 | new Assertion(set1, msg, assert.sameOrderedMembers, true)
|
14931 | .to.have.same.ordered.members(set2);
|
14932 | };
|
14933 |
|
14934 | |
14935 |
|
14936 |
|
14937 |
|
14938 |
|
14939 |
|
14940 |
|
14941 |
|
14942 |
|
14943 |
|
14944 |
|
14945 |
|
14946 |
|
14947 |
|
14948 |
|
14949 |
|
14950 | assert.notSameOrderedMembers = function (set1, set2, msg) {
|
14951 | new Assertion(set1, msg, assert.notSameOrderedMembers, true)
|
14952 | .to.not.have.same.ordered.members(set2);
|
14953 | };
|
14954 |
|
14955 | |
14956 |
|
14957 |
|
14958 |
|
14959 |
|
14960 |
|
14961 |
|
14962 |
|
14963 |
|
14964 |
|
14965 |
|
14966 |
|
14967 |
|
14968 |
|
14969 |
|
14970 |
|
14971 | assert.sameDeepOrderedMembers = function (set1, set2, msg) {
|
14972 | new Assertion(set1, msg, assert.sameDeepOrderedMembers, true)
|
14973 | .to.have.same.deep.ordered.members(set2);
|
14974 | };
|
14975 |
|
14976 | |
14977 |
|
14978 |
|
14979 |
|
14980 |
|
14981 |
|
14982 |
|
14983 |
|
14984 |
|
14985 |
|
14986 |
|
14987 |
|
14988 |
|
14989 |
|
14990 |
|
14991 |
|
14992 |
|
14993 | assert.notSameDeepOrderedMembers = function (set1, set2, msg) {
|
14994 | new Assertion(set1, msg, assert.notSameDeepOrderedMembers, true)
|
14995 | .to.not.have.same.deep.ordered.members(set2);
|
14996 | };
|
14997 |
|
14998 | |
14999 |
|
15000 |
|
15001 |
|
15002 |
|
15003 |
|
15004 |
|
15005 |
|
15006 |
|
15007 |
|
15008 |
|
15009 |
|
15010 |
|
15011 |
|
15012 |
|
15013 |
|
15014 | assert.includeMembers = function (superset, subset, msg) {
|
15015 | new Assertion(superset, msg, assert.includeMembers, true)
|
15016 | .to.include.members(subset);
|
15017 | };
|
15018 |
|
15019 | |
15020 |
|
15021 |
|
15022 |
|
15023 |
|
15024 |
|
15025 |
|
15026 |
|
15027 |
|
15028 |
|
15029 |
|
15030 |
|
15031 |
|
15032 |
|
15033 |
|
15034 |
|
15035 | assert.notIncludeMembers = function (superset, subset, msg) {
|
15036 | new Assertion(superset, msg, assert.notIncludeMembers, true)
|
15037 | .to.not.include.members(subset);
|
15038 | };
|
15039 |
|
15040 | |
15041 |
|
15042 |
|
15043 |
|
15044 |
|
15045 |
|
15046 |
|
15047 |
|
15048 |
|
15049 |
|
15050 |
|
15051 |
|
15052 |
|
15053 |
|
15054 |
|
15055 |
|
15056 | assert.includeDeepMembers = function (superset, subset, msg) {
|
15057 | new Assertion(superset, msg, assert.includeDeepMembers, true)
|
15058 | .to.include.deep.members(subset);
|
15059 | };
|
15060 |
|
15061 | |
15062 |
|
15063 |
|
15064 |
|
15065 |
|
15066 |
|
15067 |
|
15068 |
|
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 |
|
15075 |
|
15076 |
|
15077 | assert.notIncludeDeepMembers = function (superset, subset, msg) {
|
15078 | new Assertion(superset, msg, assert.notIncludeDeepMembers, true)
|
15079 | .to.not.include.deep.members(subset);
|
15080 | };
|
15081 |
|
15082 | |
15083 |
|
15084 |
|
15085 |
|
15086 |
|
15087 |
|
15088 |
|
15089 |
|
15090 |
|
15091 |
|
15092 |
|
15093 |
|
15094 |
|
15095 |
|
15096 |
|
15097 |
|
15098 |
|
15099 | assert.includeOrderedMembers = function (superset, subset, msg) {
|
15100 | new Assertion(superset, msg, assert.includeOrderedMembers, true)
|
15101 | .to.include.ordered.members(subset);
|
15102 | };
|
15103 |
|
15104 | |
15105 |
|
15106 |
|
15107 |
|
15108 |
|
15109 |
|
15110 |
|
15111 |
|
15112 |
|
15113 |
|
15114 |
|
15115 |
|
15116 |
|
15117 |
|
15118 |
|
15119 |
|
15120 |
|
15121 |
|
15122 | assert.notIncludeOrderedMembers = function (superset, subset, msg) {
|
15123 | new Assertion(superset, msg, assert.notIncludeOrderedMembers, true)
|
15124 | .to.not.include.ordered.members(subset);
|
15125 | };
|
15126 |
|
15127 | |
15128 |
|
15129 |
|
15130 |
|
15131 |
|
15132 |
|
15133 |
|
15134 |
|
15135 |
|
15136 |
|
15137 |
|
15138 |
|
15139 |
|
15140 |
|
15141 |
|
15142 |
|
15143 |
|
15144 | assert.includeDeepOrderedMembers = function (superset, subset, msg) {
|
15145 | new Assertion(superset, msg, assert.includeDeepOrderedMembers, true)
|
15146 | .to.include.deep.ordered.members(subset);
|
15147 | };
|
15148 |
|
15149 | |
15150 |
|
15151 |
|
15152 |
|
15153 |
|
15154 |
|
15155 |
|
15156 |
|
15157 |
|
15158 |
|
15159 |
|
15160 |
|
15161 |
|
15162 |
|
15163 |
|
15164 |
|
15165 |
|
15166 |
|
15167 |
|
15168 | assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) {
|
15169 | new Assertion(superset, msg, assert.notIncludeDeepOrderedMembers, true)
|
15170 | .to.not.include.deep.ordered.members(subset);
|
15171 | };
|
15172 |
|
15173 | |
15174 |
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 |
|
15182 |
|
15183 |
|
15184 |
|
15185 |
|
15186 |
|
15187 |
|
15188 | assert.oneOf = function (inList, list, msg) {
|
15189 | new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list);
|
15190 | };
|
15191 |
|
15192 | |
15193 |
|
15194 |
|
15195 |
|
15196 |
|
15197 |
|
15198 |
|
15199 |
|
15200 |
|
15201 |
|
15202 |
|
15203 |
|
15204 |
|
15205 |
|
15206 |
|
15207 |
|
15208 |
|
15209 |
|
15210 | assert.changes = function (fn, obj, prop, msg) {
|
15211 | if (arguments.length === 3 && typeof obj === 'function') {
|
15212 | msg = prop;
|
15213 | prop = null;
|
15214 | }
|
15215 |
|
15216 | new Assertion(fn, msg, assert.changes, true).to.change(obj, prop);
|
15217 | };
|
15218 |
|
15219 | |
15220 |
|
15221 |
|
15222 |
|
15223 |
|
15224 |
|
15225 |
|
15226 |
|
15227 |
|
15228 |
|
15229 |
|
15230 |
|
15231 |
|
15232 |
|
15233 |
|
15234 |
|
15235 |
|
15236 |
|
15237 |
|
15238 | assert.changesBy = function (fn, obj, prop, delta, msg) {
|
15239 | if (arguments.length === 4 && typeof obj === 'function') {
|
15240 | var tmpMsg = delta;
|
15241 | delta = prop;
|
15242 | msg = tmpMsg;
|
15243 | } else if (arguments.length === 3) {
|
15244 | delta = prop;
|
15245 | prop = null;
|
15246 | }
|
15247 |
|
15248 | new Assertion(fn, msg, assert.changesBy, true)
|
15249 | .to.change(obj, prop).by(delta);
|
15250 | };
|
15251 |
|
15252 | |
15253 |
|
15254 |
|
15255 |
|
15256 |
|
15257 |
|
15258 |
|
15259 |
|
15260 |
|
15261 |
|
15262 |
|
15263 |
|
15264 |
|
15265 |
|
15266 |
|
15267 |
|
15268 |
|
15269 |
|
15270 | assert.doesNotChange = function (fn, obj, prop, msg) {
|
15271 | if (arguments.length === 3 && typeof obj === 'function') {
|
15272 | msg = prop;
|
15273 | prop = null;
|
15274 | }
|
15275 |
|
15276 | return new Assertion(fn, msg, assert.doesNotChange, true)
|
15277 | .to.not.change(obj, prop);
|
15278 | };
|
15279 |
|
15280 | |
15281 |
|
15282 |
|
15283 |
|
15284 |
|
15285 |
|
15286 |
|
15287 |
|
15288 |
|
15289 |
|
15290 |
|
15291 |
|
15292 |
|
15293 |
|
15294 |
|
15295 |
|
15296 |
|
15297 |
|
15298 |
|
15299 | assert.changesButNotBy = function (fn, obj, prop, delta, msg) {
|
15300 | if (arguments.length === 4 && typeof obj === 'function') {
|
15301 | var tmpMsg = delta;
|
15302 | delta = prop;
|
15303 | msg = tmpMsg;
|
15304 | } else if (arguments.length === 3) {
|
15305 | delta = prop;
|
15306 | prop = null;
|
15307 | }
|
15308 |
|
15309 | new Assertion(fn, msg, assert.changesButNotBy, true)
|
15310 | .to.change(obj, prop).but.not.by(delta);
|
15311 | };
|
15312 |
|
15313 | |
15314 |
|
15315 |
|
15316 |
|
15317 |
|
15318 |
|
15319 |
|
15320 |
|
15321 |
|
15322 |
|
15323 |
|
15324 |
|
15325 |
|
15326 |
|
15327 |
|
15328 |
|
15329 |
|
15330 |
|
15331 | assert.increases = function (fn, obj, prop, msg) {
|
15332 | if (arguments.length === 3 && typeof obj === 'function') {
|
15333 | msg = prop;
|
15334 | prop = null;
|
15335 | }
|
15336 |
|
15337 | return new Assertion(fn, msg, assert.increases, true)
|
15338 | .to.increase(obj, prop);
|
15339 | };
|
15340 |
|
15341 | |
15342 |
|
15343 |
|
15344 |
|
15345 |
|
15346 |
|
15347 |
|
15348 |
|
15349 |
|
15350 |
|
15351 |
|
15352 |
|
15353 |
|
15354 |
|
15355 |
|
15356 |
|
15357 |
|
15358 |
|
15359 |
|
15360 | assert.increasesBy = function (fn, obj, prop, delta, msg) {
|
15361 | if (arguments.length === 4 && typeof obj === 'function') {
|
15362 | var tmpMsg = delta;
|
15363 | delta = prop;
|
15364 | msg = tmpMsg;
|
15365 | } else if (arguments.length === 3) {
|
15366 | delta = prop;
|
15367 | prop = null;
|
15368 | }
|
15369 |
|
15370 | new Assertion(fn, msg, assert.increasesBy, true)
|
15371 | .to.increase(obj, prop).by(delta);
|
15372 | };
|
15373 |
|
15374 | |
15375 |
|
15376 |
|
15377 |
|
15378 |
|
15379 |
|
15380 |
|
15381 |
|
15382 |
|
15383 |
|
15384 |
|
15385 |
|
15386 |
|
15387 |
|
15388 |
|
15389 |
|
15390 |
|
15391 |
|
15392 | assert.doesNotIncrease = function (fn, obj, prop, msg) {
|
15393 | if (arguments.length === 3 && typeof obj === 'function') {
|
15394 | msg = prop;
|
15395 | prop = null;
|
15396 | }
|
15397 |
|
15398 | return new Assertion(fn, msg, assert.doesNotIncrease, true)
|
15399 | .to.not.increase(obj, prop);
|
15400 | };
|
15401 |
|
15402 | |
15403 |
|
15404 |
|
15405 |
|
15406 |
|
15407 |
|
15408 |
|
15409 |
|
15410 |
|
15411 |
|
15412 |
|
15413 |
|
15414 |
|
15415 |
|
15416 |
|
15417 |
|
15418 |
|
15419 |
|
15420 |
|
15421 | assert.increasesButNotBy = function (fn, obj, prop, delta, msg) {
|
15422 | if (arguments.length === 4 && typeof obj === 'function') {
|
15423 | var tmpMsg = delta;
|
15424 | delta = prop;
|
15425 | msg = tmpMsg;
|
15426 | } else if (arguments.length === 3) {
|
15427 | delta = prop;
|
15428 | prop = null;
|
15429 | }
|
15430 |
|
15431 | new Assertion(fn, msg, assert.increasesButNotBy, true)
|
15432 | .to.increase(obj, prop).but.not.by(delta);
|
15433 | };
|
15434 |
|
15435 | |
15436 |
|
15437 |
|
15438 |
|
15439 |
|
15440 |
|
15441 |
|
15442 |
|
15443 |
|
15444 |
|
15445 |
|
15446 |
|
15447 |
|
15448 |
|
15449 |
|
15450 |
|
15451 |
|
15452 |
|
15453 | assert.decreases = function (fn, obj, prop, msg) {
|
15454 | if (arguments.length === 3 && typeof obj === 'function') {
|
15455 | msg = prop;
|
15456 | prop = null;
|
15457 | }
|
15458 |
|
15459 | return new Assertion(fn, msg, assert.decreases, true)
|
15460 | .to.decrease(obj, prop);
|
15461 | };
|
15462 |
|
15463 | |
15464 |
|
15465 |
|
15466 |
|
15467 |
|
15468 |
|
15469 |
|
15470 |
|
15471 |
|
15472 |
|
15473 |
|
15474 |
|
15475 |
|
15476 |
|
15477 |
|
15478 |
|
15479 |
|
15480 |
|
15481 |
|
15482 | assert.decreasesBy = function (fn, obj, prop, delta, msg) {
|
15483 | if (arguments.length === 4 && typeof obj === 'function') {
|
15484 | var tmpMsg = delta;
|
15485 | delta = prop;
|
15486 | msg = tmpMsg;
|
15487 | } else if (arguments.length === 3) {
|
15488 | delta = prop;
|
15489 | prop = null;
|
15490 | }
|
15491 |
|
15492 | new Assertion(fn, msg, assert.decreasesBy, true)
|
15493 | .to.decrease(obj, prop).by(delta);
|
15494 | };
|
15495 |
|
15496 | |
15497 |
|
15498 |
|
15499 |
|
15500 |
|
15501 |
|
15502 |
|
15503 |
|
15504 |
|
15505 |
|
15506 |
|
15507 |
|
15508 |
|
15509 |
|
15510 |
|
15511 |
|
15512 |
|
15513 |
|
15514 | assert.doesNotDecrease = function (fn, obj, prop, msg) {
|
15515 | if (arguments.length === 3 && typeof obj === 'function') {
|
15516 | msg = prop;
|
15517 | prop = null;
|
15518 | }
|
15519 |
|
15520 | return new Assertion(fn, msg, assert.doesNotDecrease, true)
|
15521 | .to.not.decrease(obj, prop);
|
15522 | };
|
15523 |
|
15524 | |
15525 |
|
15526 |
|
15527 |
|
15528 |
|
15529 |
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 |
|
15537 |
|
15538 |
|
15539 |
|
15540 |
|
15541 |
|
15542 |
|
15543 | assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) {
|
15544 | if (arguments.length === 4 && typeof obj === 'function') {
|
15545 | var tmpMsg = delta;
|
15546 | delta = prop;
|
15547 | msg = tmpMsg;
|
15548 | } else if (arguments.length === 3) {
|
15549 | delta = prop;
|
15550 | prop = null;
|
15551 | }
|
15552 |
|
15553 | return new Assertion(fn, msg, assert.doesNotDecreaseBy, true)
|
15554 | .to.not.decrease(obj, prop).by(delta);
|
15555 | };
|
15556 |
|
15557 | |
15558 |
|
15559 |
|
15560 |
|
15561 |
|
15562 |
|
15563 |
|
15564 |
|
15565 |
|
15566 |
|
15567 |
|
15568 |
|
15569 |
|
15570 |
|
15571 |
|
15572 |
|
15573 |
|
15574 |
|
15575 |
|
15576 | assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
|
15577 | if (arguments.length === 4 && typeof obj === 'function') {
|
15578 | var tmpMsg = delta;
|
15579 | delta = prop;
|
15580 | msg = tmpMsg;
|
15581 | } else if (arguments.length === 3) {
|
15582 | delta = prop;
|
15583 | prop = null;
|
15584 | }
|
15585 |
|
15586 | new Assertion(fn, msg, assert.decreasesButNotBy, true)
|
15587 | .to.decrease(obj, prop).but.not.by(delta);
|
15588 | };
|
15589 |
|
15590 | |
15591 |
|
15592 |
|
15593 |
|
15594 |
|
15595 |
|
15596 |
|
15597 |
|
15598 |
|
15599 |
|
15600 |
|
15601 |
|
15602 |
|
15603 |
|
15604 |
|
15605 |
|
15606 | assert.ifError = function (val) {
|
15607 | if (val) {
|
15608 | throw(val);
|
15609 | }
|
15610 | };
|
15611 |
|
15612 | |
15613 |
|
15614 |
|
15615 |
|
15616 |
|
15617 |
|
15618 |
|
15619 |
|
15620 |
|
15621 |
|
15622 |
|
15623 |
|
15624 |
|
15625 |
|
15626 |
|
15627 | assert.isExtensible = function (obj, msg) {
|
15628 | new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible;
|
15629 | };
|
15630 |
|
15631 | |
15632 |
|
15633 |
|
15634 |
|
15635 |
|
15636 |
|
15637 |
|
15638 |
|
15639 |
|
15640 |
|
15641 |
|
15642 |
|
15643 |
|
15644 |
|
15645 |
|
15646 |
|
15647 |
|
15648 |
|
15649 |
|
15650 |
|
15651 |
|
15652 | assert.isNotExtensible = function (obj, msg) {
|
15653 | new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible;
|
15654 | };
|
15655 |
|
15656 | |
15657 |
|
15658 |
|
15659 |
|
15660 |
|
15661 |
|
15662 |
|
15663 |
|
15664 |
|
15665 |
|
15666 |
|
15667 |
|
15668 |
|
15669 |
|
15670 |
|
15671 |
|
15672 |
|
15673 |
|
15674 |
|
15675 |
|
15676 | assert.isSealed = function (obj, msg) {
|
15677 | new Assertion(obj, msg, assert.isSealed, true).to.be.sealed;
|
15678 | };
|
15679 |
|
15680 | |
15681 |
|
15682 |
|
15683 |
|
15684 |
|
15685 |
|
15686 |
|
15687 |
|
15688 |
|
15689 |
|
15690 |
|
15691 |
|
15692 |
|
15693 |
|
15694 |
|
15695 | assert.isNotSealed = function (obj, msg) {
|
15696 | new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed;
|
15697 | };
|
15698 |
|
15699 | |
15700 |
|
15701 |
|
15702 |
|
15703 |
|
15704 |
|
15705 |
|
15706 |
|
15707 |
|
15708 |
|
15709 |
|
15710 |
|
15711 |
|
15712 |
|
15713 |
|
15714 |
|
15715 |
|
15716 | assert.isFrozen = function (obj, msg) {
|
15717 | new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen;
|
15718 | };
|
15719 |
|
15720 | |
15721 |
|
15722 |
|
15723 |
|
15724 |
|
15725 |
|
15726 |
|
15727 |
|
15728 |
|
15729 |
|
15730 |
|
15731 |
|
15732 |
|
15733 |
|
15734 |
|
15735 | assert.isNotFrozen = function (obj, msg) {
|
15736 | new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen;
|
15737 | };
|
15738 |
|
15739 | |
15740 |
|
15741 |
|
15742 |
|
15743 |
|
15744 |
|
15745 |
|
15746 |
|
15747 |
|
15748 |
|
15749 |
|
15750 |
|
15751 |
|
15752 |
|
15753 |
|
15754 |
|
15755 |
|
15756 |
|
15757 |
|
15758 |
|
15759 |
|
15760 |
|
15761 | assert.isEmpty = function(val, msg) {
|
15762 | new Assertion(val, msg, assert.isEmpty, true).to.be.empty;
|
15763 | };
|
15764 |
|
15765 | |
15766 |
|
15767 |
|
15768 |
|
15769 |
|
15770 |
|
15771 |
|
15772 |
|
15773 |
|
15774 |
|
15775 |
|
15776 |
|
15777 |
|
15778 |
|
15779 |
|
15780 |
|
15781 |
|
15782 |
|
15783 |
|
15784 |
|
15785 |
|
15786 |
|
15787 | assert.isNotEmpty = function(val, msg) {
|
15788 | new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty;
|
15789 | };
|
15790 |
|
15791 | |
15792 |
|
15793 |
|
15794 |
|
15795 | (function alias(name, as){
|
15796 | assert[as] = assert[name];
|
15797 | return alias;
|
15798 | })
|
15799 | ('isOk', 'ok')
|
15800 | ('isNotOk', 'notOk')
|
15801 | ('throws', 'throw')
|
15802 | ('throws', 'Throw')
|
15803 | ('isExtensible', 'extensible')
|
15804 | ('isNotExtensible', 'notExtensible')
|
15805 | ('isSealed', 'sealed')
|
15806 | ('isNotSealed', 'notSealed')
|
15807 | ('isFrozen', 'frozen')
|
15808 | ('isNotFrozen', 'notFrozen')
|
15809 | ('isEmpty', 'empty')
|
15810 | ('isNotEmpty', 'notEmpty');
|
15811 | };
|
15812 |
|
15813 | var chai = createCommonjsModule(function (module, exports) {
|
15814 |
|
15815 |
|
15816 |
|
15817 |
|
15818 |
|
15819 |
|
15820 | var used = [];
|
15821 |
|
15822 |
|
15823 |
|
15824 |
|
15825 |
|
15826 | exports.version = '4.1.2';
|
15827 |
|
15828 |
|
15829 |
|
15830 |
|
15831 |
|
15832 | exports.AssertionError = assertionError;
|
15833 |
|
15834 |
|
15835 |
|
15836 |
|
15837 |
|
15838 |
|
15839 |
|
15840 |
|
15841 |
|
15842 |
|
15843 |
|
15844 |
|
15845 |
|
15846 |
|
15847 |
|
15848 |
|
15849 |
|
15850 | exports.use = function (fn) {
|
15851 | if (!~used.indexOf(fn)) {
|
15852 | fn(exports, utils);
|
15853 | used.push(fn);
|
15854 | }
|
15855 |
|
15856 | return exports;
|
15857 | };
|
15858 |
|
15859 |
|
15860 |
|
15861 |
|
15862 |
|
15863 | exports.util = utils;
|
15864 |
|
15865 |
|
15866 |
|
15867 |
|
15868 |
|
15869 |
|
15870 | exports.config = config;
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 |
|
15877 | exports.use(assertion);
|
15878 |
|
15879 |
|
15880 |
|
15881 |
|
15882 |
|
15883 |
|
15884 | exports.use(assertions);
|
15885 |
|
15886 |
|
15887 |
|
15888 |
|
15889 |
|
15890 |
|
15891 | exports.use(expect);
|
15892 |
|
15893 |
|
15894 |
|
15895 |
|
15896 |
|
15897 |
|
15898 | exports.use(should);
|
15899 |
|
15900 |
|
15901 |
|
15902 |
|
15903 |
|
15904 |
|
15905 | exports.use(assert);
|
15906 | });
|
15907 |
|
15908 | var chai_1 = chai.version;
|
15909 | var chai_2 = chai.AssertionError;
|
15910 | var chai_3 = chai.use;
|
15911 | var chai_4 = chai.util;
|
15912 | var chai_5 = chai.config;
|
15913 |
|
15914 | var chai$2 = chai;
|
15915 |
|
15916 |
|
15917 |
|
15918 |
|
15919 |
|
15920 | var expect$3 = chai$2.expect;
|
15921 |
|
15922 | describe('jsondiffpatch', function () {
|
15923 | before(function () {});
|
15924 | it('has a diff method', function () {
|
15925 | expect$3(diff).to.be.a('function');
|
15926 | });
|
15927 | });
|
15928 |
|
15929 | var DiffPatcher$1 = DiffPatcher;
|
15930 |
|
15931 | var isArray$1$1 = typeof Array.isArray === 'function' ? Array.isArray : function (a) {
|
15932 | return (typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && a instanceof Array;
|
15933 | };
|
15934 |
|
15935 | var valueDescription = function valueDescription(value) {
|
15936 | if (value === null) {
|
15937 | return 'null';
|
15938 | }
|
15939 | if (typeof value === 'boolean') {
|
15940 | return value.toString();
|
15941 | }
|
15942 | if (value instanceof Date) {
|
15943 | return 'Date';
|
15944 | }
|
15945 | if (value instanceof RegExp) {
|
15946 | return 'RegExp';
|
15947 | }
|
15948 | if (isArray$1$1(value)) {
|
15949 | return 'array';
|
15950 | }
|
15951 | if (typeof value === 'string') {
|
15952 | if (value.length >= 60) {
|
15953 | return 'large text';
|
15954 | }
|
15955 | }
|
15956 | return typeof value === 'undefined' ? 'undefined' : _typeof(value);
|
15957 | };
|
15958 |
|
15959 |
|
15960 | var objectKeys = typeof Object.keys === 'function' ? function (obj) {
|
15961 | return Object.keys(obj);
|
15962 | } : function (obj) {
|
15963 | var keys = [];
|
15964 | for (var key in obj) {
|
15965 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
15966 | keys.push(key);
|
15967 | }
|
15968 | }
|
15969 | return keys;
|
15970 | };
|
15971 |
|
15972 |
|
15973 | var arrayForEach = typeof Array.prototype.forEach === 'function' ? function (array, fn) {
|
15974 | return array.forEach(fn);
|
15975 | } : function (array, fn) {
|
15976 | for (var index$$1 = 0, length = array.length; index$$1 < length; index$$1++) {
|
15977 | fn(array[index$$1], index$$1, array);
|
15978 | }
|
15979 | };
|
15980 |
|
15981 | describe('DiffPatcher', function () {
|
15982 | arrayForEach(objectKeys(examples), function (groupName) {
|
15983 | var group = examples[groupName];
|
15984 | describe(groupName, function () {
|
15985 | arrayForEach(group, function (example) {
|
15986 | if (!example) {
|
15987 | return;
|
15988 | }
|
15989 | var name = example.name || valueDescription(example.left) + ' -> ' + valueDescription(example.right);
|
15990 | describe(name, function () {
|
15991 | before(function () {
|
15992 | this.instance = new DiffPatcher$1(example.options);
|
15993 | });
|
15994 | if (example.error) {
|
15995 | it('diff should fail with: ' + example.error, function () {
|
15996 | var instance = this.instance;
|
15997 | expect$3(function () {
|
15998 | instance.diff(example.left, example.right);
|
15999 | }).to.throw(example.error);
|
16000 | });
|
16001 | return;
|
16002 | }
|
16003 | it('can diff', function () {
|
16004 | var delta = this.instance.diff(example.left, example.right);
|
16005 | expect$3(delta).to.deep.equal(example.delta);
|
16006 | });
|
16007 | it('can diff backwards', function () {
|
16008 | var reverse$$1 = this.instance.diff(example.right, example.left);
|
16009 | expect$3(reverse$$1).to.deep.equal(example.reverse);
|
16010 | });
|
16011 | if (!example.noPatch) {
|
16012 | it('can patch', function () {
|
16013 | var right = this.instance.patch(clone$1(example.left), example.delta);
|
16014 | expect$3(right).to.deep.equal(example.right);
|
16015 | });
|
16016 | it('can reverse delta', function () {
|
16017 | var reverse$$1 = this.instance.reverse(example.delta);
|
16018 | if (example.exactReverse !== false) {
|
16019 | expect$3(reverse$$1).to.deep.equal(example.reverse);
|
16020 | } else {
|
16021 |
|
16022 |
|
16023 |
|
16024 | expect$3(this.instance.patch(clone$1(example.right), reverse$$1)).to.deep.equal(example.left);
|
16025 | reverse$$1 = this.instance.diff(example.right, example.left);
|
16026 | expect$3(this.instance.patch(clone$1(example.right), reverse$$1)).to.deep.equal(example.left);
|
16027 | }
|
16028 | });
|
16029 | it('can unpatch', function () {
|
16030 | var left = this.instance.unpatch(clone$1(example.right), example.delta);
|
16031 | expect$3(left).to.deep.equal(example.left);
|
16032 | });
|
16033 | }
|
16034 | });
|
16035 | });
|
16036 | });
|
16037 | });
|
16038 |
|
16039 | describe('.clone', function () {
|
16040 | it('clones complex objects', function () {
|
16041 | var obj = {
|
16042 | name: 'a string',
|
16043 | nested: {
|
16044 | attributes: [{ name: 'one', value: 345, since: new Date(1934, 1, 1) }],
|
16045 | another: 'property',
|
16046 | enabled: true,
|
16047 | nested2: {
|
16048 | name: 'another string'
|
16049 | }
|
16050 | }
|
16051 | };
|
16052 | var cloned = clone$1(obj);
|
16053 | expect$3(cloned).to.deep.equal(obj);
|
16054 | });
|
16055 | it('clones RegExp', function () {
|
16056 | var obj = {
|
16057 | pattern: /expr/gim
|
16058 | };
|
16059 | var cloned = clone$1(obj);
|
16060 | expect$3(cloned).to.deep.equal({
|
16061 | pattern: /expr/gim
|
16062 | });
|
16063 | });
|
16064 | });
|
16065 |
|
16066 | describe('using cloneDiffValues', function () {
|
16067 | before(function () {
|
16068 | this.instance = new DiffPatcher$1({
|
16069 | cloneDiffValues: true
|
16070 | });
|
16071 | });
|
16072 | it("ensures deltas don't reference original objects", function () {
|
16073 | var left = {
|
16074 | oldProp: {
|
16075 | value: 3
|
16076 | }
|
16077 | };
|
16078 | var right = {
|
16079 | newProp: {
|
16080 | value: 5
|
16081 | }
|
16082 | };
|
16083 | var delta = this.instance.diff(left, right);
|
16084 | left.oldProp.value = 1;
|
16085 | right.newProp.value = 8;
|
16086 | expect$3(delta).to.deep.equal({
|
16087 | oldProp: [{ value: 3 }, 0, 0],
|
16088 | newProp: [{ value: 5 }]
|
16089 | });
|
16090 | });
|
16091 | });
|
16092 |
|
16093 | describe('static shortcuts', function () {
|
16094 | it('diff', function () {
|
16095 | var delta = diff(4, 5);
|
16096 | expect$3(delta).to.deep.equal([4, 5]);
|
16097 | });
|
16098 | it('patch', function () {
|
16099 | var right = patch(4, [4, 5]);
|
16100 | expect$3(right).to.eql(5);
|
16101 | });
|
16102 | it('unpatch', function () {
|
16103 | var left = unpatch(5, [4, 5]);
|
16104 | expect$3(left).to.eql(4);
|
16105 | });
|
16106 | it('reverse', function () {
|
16107 | var reverseDelta = reverse([4, 5]);
|
16108 | expect$3(reverseDelta).to.deep.equal([5, 4]);
|
16109 | });
|
16110 | });
|
16111 |
|
16112 | describe('plugins', function () {
|
16113 | before(function () {
|
16114 | this.instance = new DiffPatcher$1();
|
16115 | });
|
16116 |
|
16117 | describe('getting pipe filter list', function () {
|
16118 | it('returns builtin filters', function () {
|
16119 | expect$3(this.instance.processor.pipes.diff.list()).to.deep.equal(['collectChildren', 'trivial', 'dates', 'texts', 'objects', 'arrays']);
|
16120 | });
|
16121 | });
|
16122 |
|
16123 | describe('supporting numeric deltas', function () {
|
16124 | var NUMERIC_DIFFERENCE = -8;
|
16125 |
|
16126 | it('diff', function () {
|
16127 |
|
16128 | function numericDiffFilter(context) {
|
16129 | if (typeof context.left === 'number' && typeof context.right === 'number') {
|
16130 |
|
16131 | context.setResult([0, context.right - context.left, NUMERIC_DIFFERENCE]).exit();
|
16132 | }
|
16133 | }
|
16134 |
|
16135 |
|
16136 | numericDiffFilter.filterName = 'numeric';
|
16137 |
|
16138 |
|
16139 | this.instance.processor.pipes.diff.before('trivial', numericDiffFilter);
|
16140 |
|
16141 | var delta = this.instance.diff({ population: 400 }, { population: 403 });
|
16142 | expect$3(delta).to.deep.equal({ population: [0, 3, NUMERIC_DIFFERENCE] });
|
16143 | });
|
16144 |
|
16145 | it('patch', function () {
|
16146 | function numericPatchFilter(context) {
|
16147 | if (context.delta && Array.isArray(context.delta) && context.delta[2] === NUMERIC_DIFFERENCE) {
|
16148 | context.setResult(context.left + context.delta[1]).exit();
|
16149 | }
|
16150 | }
|
16151 | numericPatchFilter.filterName = 'numeric';
|
16152 | this.instance.processor.pipes.patch.before('trivial', numericPatchFilter);
|
16153 |
|
16154 | var delta = { population: [0, 3, NUMERIC_DIFFERENCE] };
|
16155 | var right = this.instance.patch({ population: 600 }, delta);
|
16156 | expect$3(right).to.deep.equal({ population: 603 });
|
16157 | });
|
16158 |
|
16159 | it('unpatch', function () {
|
16160 | function numericReverseFilter(context) {
|
16161 | if (context.nested) {
|
16162 | return;
|
16163 | }
|
16164 | if (context.delta && Array.isArray(context.delta) && context.delta[2] === NUMERIC_DIFFERENCE) {
|
16165 | context.setResult([0, -context.delta[1], NUMERIC_DIFFERENCE]).exit();
|
16166 | }
|
16167 | }
|
16168 | numericReverseFilter.filterName = 'numeric';
|
16169 | this.instance.processor.pipes.reverse.after('trivial', numericReverseFilter);
|
16170 |
|
16171 | var delta = { population: [0, 3, NUMERIC_DIFFERENCE] };
|
16172 | var reverseDelta = this.instance.reverse(delta);
|
16173 | expect$3(reverseDelta).to.deep.equal({
|
16174 | population: [0, -3, NUMERIC_DIFFERENCE]
|
16175 | });
|
16176 | var right = { population: 703 };
|
16177 | this.instance.unpatch(right, delta);
|
16178 | expect$3(right).to.deep.equal({ population: 700 });
|
16179 | });
|
16180 | });
|
16181 |
|
16182 | describe('removing and replacing pipe filters', function () {
|
16183 | it('removes specified filter', function () {
|
16184 | expect$3(this.instance.processor.pipes.diff.list()).to.deep.equal(['collectChildren', 'numeric', 'trivial', 'dates', 'texts', 'objects', 'arrays']);
|
16185 | this.instance.processor.pipes.diff.remove('dates');
|
16186 | expect$3(this.instance.processor.pipes.diff.list()).to.deep.equal(['collectChildren', 'numeric', 'trivial', 'texts', 'objects', 'arrays']);
|
16187 | });
|
16188 |
|
16189 | it('replaces specified filter', function () {
|
16190 | function fooFilter(context) {
|
16191 | context.setResult(['foo']).exit();
|
16192 | }
|
16193 | fooFilter.filterName = 'foo';
|
16194 | expect$3(this.instance.processor.pipes.diff.list()).to.deep.equal(['collectChildren', 'numeric', 'trivial', 'texts', 'objects', 'arrays']);
|
16195 | this.instance.processor.pipes.diff.replace('trivial', fooFilter);
|
16196 | expect$3(this.instance.processor.pipes.diff.list()).to.deep.equal(['collectChildren', 'numeric', 'foo', 'texts', 'objects', 'arrays']);
|
16197 | });
|
16198 | });
|
16199 | });
|
16200 |
|
16201 | describe('formatters', function () {
|
16202 | describe('jsonpatch', function () {
|
16203 | var instance = void 0;
|
16204 | var formatter = void 0;
|
16205 |
|
16206 | before(function () {
|
16207 | instance = new DiffPatcher$1();
|
16208 | formatter = index.jsonpatch;
|
16209 | });
|
16210 |
|
16211 | var expectFormat = function expectFormat(before, after, expected) {
|
16212 | var diff$$1 = instance.diff(before, after);
|
16213 | var format = formatter.format(diff$$1);
|
16214 | expect$3(format).to.be.eql(expected);
|
16215 | };
|
16216 |
|
16217 | var removeOp = function removeOp(path) {
|
16218 | return {
|
16219 | op: 'remove',
|
16220 | path: path
|
16221 | };
|
16222 | };
|
16223 |
|
16224 | var addOp = function addOp(path, value) {
|
16225 | return {
|
16226 | op: 'add',
|
16227 | path: path,
|
16228 | value: value
|
16229 | };
|
16230 | };
|
16231 |
|
16232 | var replaceOp = function replaceOp(path, value) {
|
16233 | return {
|
16234 | op: 'replace',
|
16235 | path: path,
|
16236 | value: value
|
16237 | };
|
16238 | };
|
16239 |
|
16240 | it('should return empty format for empty diff', function () {
|
16241 | expectFormat([], [], []);
|
16242 | });
|
16243 |
|
16244 | it('should format an add operation for array insertion', function () {
|
16245 | expectFormat([1, 2, 3], [1, 2, 3, 4], [addOp('/3', 4)]);
|
16246 | });
|
16247 |
|
16248 | it('should format an add operation for object insertion', function () {
|
16249 | expectFormat({ a: 'a', b: 'b' }, { a: 'a', b: 'b', c: 'c' }, [addOp('/c', 'c')]);
|
16250 | });
|
16251 |
|
16252 | it('should format for deletion of array', function () {
|
16253 | expectFormat([1, 2, 3, 4], [1, 2, 3], [removeOp('/3')]);
|
16254 | });
|
16255 |
|
16256 | it('should format for deletion of object', function () {
|
16257 | expectFormat({ a: 'a', b: 'b', c: 'c' }, { a: 'a', b: 'b' }, [removeOp('/c')]);
|
16258 | });
|
16259 |
|
16260 | it('should format for replace of object', function () {
|
16261 | expectFormat({ a: 'a', b: 'b' }, { a: 'a', b: 'c' }, [replaceOp('/b', 'c')]);
|
16262 | });
|
16263 |
|
16264 | it('should put add/remove for array with primitive items', function () {
|
16265 | expectFormat([1, 2, 3], [1, 2, 4], [removeOp('/2'), addOp('/2', 4)]);
|
16266 | });
|
16267 |
|
16268 | it('should sort remove by desc order', function () {
|
16269 | expectFormat([1, 2, 3], [1], [removeOp('/2'), removeOp('/1')]);
|
16270 | });
|
16271 |
|
16272 | describe('patcher with comparator', function () {
|
16273 | before(function () {
|
16274 | instance = new DiffPatcher$1({
|
16275 | objectHash: function objectHash(obj) {
|
16276 | if (obj && obj.id) {
|
16277 | return obj.id;
|
16278 | }
|
16279 | }
|
16280 | });
|
16281 | });
|
16282 |
|
16283 | var anObjectWithId = function anObjectWithId(id) {
|
16284 | return {
|
16285 | id: id
|
16286 | };
|
16287 | };
|
16288 |
|
16289 | it('should remove higher level first', function () {
|
16290 | var before = [anObjectWithId('removed'), {
|
16291 | id: 'remaining_outer',
|
16292 | items: [anObjectWithId('removed_inner'), anObjectWithId('remaining_inner')]
|
16293 | }];
|
16294 | var after = [{
|
16295 | id: 'remaining_outer',
|
16296 | items: [anObjectWithId('remaining_inner')]
|
16297 | }];
|
16298 | var expectedDiff = [removeOp('/0'), removeOp('/0/items/0')];
|
16299 | expectFormat(before, after, expectedDiff);
|
16300 | });
|
16301 | });
|
16302 |
|
16303 | it('should annotate as moved op', function () {
|
16304 | expectFormat([1, 2], [2, 1], [{ op: 'move', from: '/1', path: '/0' }]);
|
16305 | });
|
16306 | });
|
16307 | });
|
16308 | });
|
16309 |
|
16310 | })));
|
16311 |
|