chai 4.3.5 → 4.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chai.js +879 -1222
- package/package.json +3 -3
package/chai.js
CHANGED
|
@@ -9430,10 +9430,10 @@ function FakeMap() {
|
|
|
9430
9430
|
}
|
|
9431
9431
|
|
|
9432
9432
|
FakeMap.prototype = {
|
|
9433
|
-
get: function
|
|
9433
|
+
get: function get(key) {
|
|
9434
9434
|
return key[this._key];
|
|
9435
9435
|
},
|
|
9436
|
-
set: function
|
|
9436
|
+
set: function set(key, value) {
|
|
9437
9437
|
if (Object.isExtensible(key)) {
|
|
9438
9438
|
Object.defineProperty(key, this._key, {
|
|
9439
9439
|
value: value,
|
|
@@ -9625,8 +9625,9 @@ function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandTyp
|
|
|
9625
9625
|
case 'function':
|
|
9626
9626
|
case 'WeakMap':
|
|
9627
9627
|
case 'WeakSet':
|
|
9628
|
-
case 'Error':
|
|
9629
9628
|
return leftHandOperand === rightHandOperand;
|
|
9629
|
+
case 'Error':
|
|
9630
|
+
return keysEqual(leftHandOperand, rightHandOperand, [ 'name', 'message', 'code' ], options);
|
|
9630
9631
|
case 'Arguments':
|
|
9631
9632
|
case 'Int8Array':
|
|
9632
9633
|
case 'Uint8Array':
|
|
@@ -9651,6 +9652,19 @@ function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandTyp
|
|
|
9651
9652
|
return entriesEqual(leftHandOperand, rightHandOperand, options);
|
|
9652
9653
|
case 'Map':
|
|
9653
9654
|
return entriesEqual(leftHandOperand, rightHandOperand, options);
|
|
9655
|
+
case 'Temporal.PlainDate':
|
|
9656
|
+
case 'Temporal.PlainTime':
|
|
9657
|
+
case 'Temporal.PlainDateTime':
|
|
9658
|
+
case 'Temporal.Instant':
|
|
9659
|
+
case 'Temporal.ZonedDateTime':
|
|
9660
|
+
case 'Temporal.PlainYearMonth':
|
|
9661
|
+
case 'Temporal.PlainMonthDay':
|
|
9662
|
+
return leftHandOperand.equals(rightHandOperand);
|
|
9663
|
+
case 'Temporal.Duration':
|
|
9664
|
+
return leftHandOperand.total('nanoseconds') === rightHandOperand.total('nanoseconds');
|
|
9665
|
+
case 'Temporal.TimeZone':
|
|
9666
|
+
case 'Temporal.Calendar':
|
|
9667
|
+
return leftHandOperand.toString() === rightHandOperand.toString();
|
|
9654
9668
|
default:
|
|
9655
9669
|
return objectEqual(leftHandOperand, rightHandOperand, options);
|
|
9656
9670
|
}
|
|
@@ -9796,6 +9810,11 @@ function getEnumerableKeys(target) {
|
|
|
9796
9810
|
return keys;
|
|
9797
9811
|
}
|
|
9798
9812
|
|
|
9813
|
+
function getNonEnumerableSymbols(target) {
|
|
9814
|
+
var keys = Object.getOwnPropertySymbols(target);
|
|
9815
|
+
return keys;
|
|
9816
|
+
}
|
|
9817
|
+
|
|
9799
9818
|
/*!
|
|
9800
9819
|
* Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
|
|
9801
9820
|
* each key. If any value of the given key is not equal, the function will return false (early).
|
|
@@ -9828,14 +9847,16 @@ function keysEqual(leftHandOperand, rightHandOperand, keys, options) {
|
|
|
9828
9847
|
* @param {Object} [options] (Optional)
|
|
9829
9848
|
* @return {Boolean} result
|
|
9830
9849
|
*/
|
|
9831
|
-
|
|
9832
9850
|
function objectEqual(leftHandOperand, rightHandOperand, options) {
|
|
9833
9851
|
var leftHandKeys = getEnumerableKeys(leftHandOperand);
|
|
9834
9852
|
var rightHandKeys = getEnumerableKeys(rightHandOperand);
|
|
9853
|
+
var leftHandSymbols = getNonEnumerableSymbols(leftHandOperand);
|
|
9854
|
+
var rightHandSymbols = getNonEnumerableSymbols(rightHandOperand);
|
|
9855
|
+
leftHandKeys = leftHandKeys.concat(leftHandSymbols);
|
|
9856
|
+
rightHandKeys = rightHandKeys.concat(rightHandSymbols);
|
|
9857
|
+
|
|
9835
9858
|
if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
|
|
9836
|
-
leftHandKeys.sort()
|
|
9837
|
-
rightHandKeys.sort();
|
|
9838
|
-
if (iterableEqual(leftHandKeys, rightHandKeys) === false) {
|
|
9859
|
+
if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) {
|
|
9839
9860
|
return false;
|
|
9840
9861
|
}
|
|
9841
9862
|
return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
|
|
@@ -9872,6 +9893,16 @@ function isPrimitive(value) {
|
|
|
9872
9893
|
return value === null || typeof value !== 'object';
|
|
9873
9894
|
}
|
|
9874
9895
|
|
|
9896
|
+
function mapSymbols(arr) {
|
|
9897
|
+
return arr.map(function mapSymbol(entry) {
|
|
9898
|
+
if (typeof entry === 'symbol') {
|
|
9899
|
+
return entry.toString();
|
|
9900
|
+
}
|
|
9901
|
+
|
|
9902
|
+
return entry;
|
|
9903
|
+
});
|
|
9904
|
+
}
|
|
9905
|
+
|
|
9875
9906
|
},{"type-detect":39}],36:[function(require,module,exports){
|
|
9876
9907
|
'use strict';
|
|
9877
9908
|
|
|
@@ -9920,1224 +9951,850 @@ module.exports = getFuncName;
|
|
|
9920
9951
|
|
|
9921
9952
|
},{}],37:[function(require,module,exports){
|
|
9922
9953
|
(function (global, factory) {
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9954
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
9955
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
9956
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.loupe = {}));
|
|
9926
9957
|
}(this, (function (exports) { 'use strict';
|
|
9927
9958
|
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
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
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
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
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
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
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
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
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
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
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
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
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
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
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
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
|
-
return options.stylize("/".concat(truncate(source, sourceLength), "/").concat(flags), 'regexp');
|
|
10766
|
-
}
|
|
10767
|
-
|
|
10768
|
-
function arrayFromSet(set) {
|
|
10769
|
-
var values = [];
|
|
10770
|
-
set.forEach(function (value) {
|
|
10771
|
-
values.push(value);
|
|
10772
|
-
});
|
|
10773
|
-
return values;
|
|
10774
|
-
}
|
|
10775
|
-
|
|
10776
|
-
function inspectSet(set, options) {
|
|
10777
|
-
if (set.size === 0) return 'Set{}';
|
|
10778
|
-
options.truncate -= 7;
|
|
10779
|
-
return "Set{ ".concat(inspectList(arrayFromSet(set), options), " }");
|
|
10780
|
-
}
|
|
10781
|
-
|
|
10782
|
-
var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5" + "\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", 'g');
|
|
10783
|
-
var escapeCharacters = {
|
|
10784
|
-
'\b': '\\b',
|
|
10785
|
-
'\t': '\\t',
|
|
10786
|
-
'\n': '\\n',
|
|
10787
|
-
'\f': '\\f',
|
|
10788
|
-
'\r': '\\r',
|
|
10789
|
-
"'": "\\'",
|
|
10790
|
-
'\\': '\\\\'
|
|
10791
|
-
};
|
|
10792
|
-
var hex = 16;
|
|
10793
|
-
var unicodeLength = 4;
|
|
10794
|
-
|
|
10795
|
-
function escape(char) {
|
|
10796
|
-
return escapeCharacters[char] || "\\u".concat("0000".concat(char.charCodeAt(0).toString(hex)).slice(-unicodeLength));
|
|
10797
|
-
}
|
|
10798
|
-
|
|
10799
|
-
function inspectString(string, options) {
|
|
10800
|
-
if (stringEscapeChars.test(string)) {
|
|
10801
|
-
string = string.replace(stringEscapeChars, escape);
|
|
10802
|
-
}
|
|
10803
|
-
|
|
10804
|
-
return options.stylize("'".concat(truncate(string, options.truncate - 2), "'"), 'string');
|
|
10805
|
-
}
|
|
10806
|
-
|
|
10807
|
-
function inspectSymbol(value) {
|
|
10808
|
-
if ('description' in Symbol.prototype) {
|
|
10809
|
-
return value.description ? "Symbol(".concat(value.description, ")") : 'Symbol()';
|
|
10810
|
-
}
|
|
10811
|
-
|
|
10812
|
-
return value.toString();
|
|
10813
|
-
}
|
|
10814
|
-
|
|
10815
|
-
var getPromiseValue = function getPromiseValue() {
|
|
10816
|
-
return 'Promise{…}';
|
|
10817
|
-
};
|
|
10818
|
-
|
|
10819
|
-
try {
|
|
10820
|
-
var _process$binding = process.binding('util'),
|
|
10821
|
-
getPromiseDetails = _process$binding.getPromiseDetails,
|
|
10822
|
-
kPending = _process$binding.kPending,
|
|
10823
|
-
kRejected = _process$binding.kRejected;
|
|
10824
|
-
|
|
10825
|
-
getPromiseValue = function getPromiseValue(value, options) {
|
|
10826
|
-
var _getPromiseDetails = getPromiseDetails(value),
|
|
10827
|
-
_getPromiseDetails2 = _slicedToArray(_getPromiseDetails, 2),
|
|
10828
|
-
state = _getPromiseDetails2[0],
|
|
10829
|
-
innerValue = _getPromiseDetails2[1];
|
|
10830
|
-
|
|
10831
|
-
if (state === kPending) {
|
|
10832
|
-
return 'Promise{<pending>}';
|
|
10833
|
-
}
|
|
10834
|
-
|
|
10835
|
-
return "Promise".concat(state === kRejected ? '!' : '', "{").concat(options.inspect(innerValue, options), "}");
|
|
10836
|
-
};
|
|
10837
|
-
} catch (notNode) {
|
|
10838
|
-
/* ignore */
|
|
10839
|
-
}
|
|
10840
|
-
|
|
10841
|
-
var inspectPromise = getPromiseValue;
|
|
10842
|
-
|
|
10843
|
-
function inspectObject(object, options) {
|
|
10844
|
-
var properties = Object.getOwnPropertyNames(object);
|
|
10845
|
-
var symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
|
|
10846
|
-
|
|
10847
|
-
if (properties.length === 0 && symbols.length === 0) {
|
|
10848
|
-
return '{}';
|
|
10849
|
-
}
|
|
10850
|
-
|
|
10851
|
-
options.truncate -= 4;
|
|
10852
|
-
options.seen = options.seen || [];
|
|
10853
|
-
|
|
10854
|
-
if (options.seen.indexOf(object) >= 0) {
|
|
10855
|
-
return '[Circular]';
|
|
10856
|
-
}
|
|
10857
|
-
|
|
10858
|
-
options.seen.push(object);
|
|
10859
|
-
var propertyContents = inspectList(properties.map(function (key) {
|
|
10860
|
-
return [key, object[key]];
|
|
10861
|
-
}), options, inspectProperty);
|
|
10862
|
-
var symbolContents = inspectList(symbols.map(function (key) {
|
|
10863
|
-
return [key, object[key]];
|
|
10864
|
-
}), options, inspectProperty);
|
|
10865
|
-
options.seen.pop();
|
|
10866
|
-
var sep = '';
|
|
10867
|
-
|
|
10868
|
-
if (propertyContents && symbolContents) {
|
|
10869
|
-
sep = ', ';
|
|
10870
|
-
}
|
|
10871
|
-
|
|
10872
|
-
return "{ ".concat(propertyContents).concat(sep).concat(symbolContents, " }");
|
|
10873
|
-
}
|
|
10874
|
-
|
|
10875
|
-
var toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
10876
|
-
function inspectClass(value, options) {
|
|
10877
|
-
var name = '';
|
|
10878
|
-
|
|
10879
|
-
if (toStringTag && toStringTag in value) {
|
|
10880
|
-
name = value[toStringTag];
|
|
10881
|
-
}
|
|
10882
|
-
|
|
10883
|
-
name = name || getFuncName_1(value.constructor); // Babel transforms anonymous classes to the name `_class`
|
|
10884
|
-
|
|
10885
|
-
if (!name || name === '_class') {
|
|
10886
|
-
name = '<Anonymous Class>';
|
|
10887
|
-
}
|
|
10888
|
-
|
|
10889
|
-
options.truncate -= name.length;
|
|
10890
|
-
return "".concat(name).concat(inspectObject(value, options));
|
|
10891
|
-
}
|
|
10892
|
-
|
|
10893
|
-
function inspectArguments(args, options) {
|
|
10894
|
-
if (args.length === 0) return 'Arguments[]';
|
|
10895
|
-
options.truncate -= 13;
|
|
10896
|
-
return "Arguments[ ".concat(inspectList(args, options), " ]");
|
|
10897
|
-
}
|
|
10898
|
-
|
|
10899
|
-
var errorKeys = ['stack', 'line', 'column', 'name', 'message', 'fileName', 'lineNumber', 'columnNumber', 'number', 'description'];
|
|
10900
|
-
function inspectObject$1(error, options) {
|
|
10901
|
-
var properties = Object.getOwnPropertyNames(error).filter(function (key) {
|
|
10902
|
-
return errorKeys.indexOf(key) === -1;
|
|
10903
|
-
});
|
|
10904
|
-
var name = error.name;
|
|
10905
|
-
options.truncate -= name.length;
|
|
10906
|
-
var message = '';
|
|
10907
|
-
|
|
10908
|
-
if (typeof error.message === 'string') {
|
|
10909
|
-
message = truncate(error.message, options.truncate);
|
|
10910
|
-
} else {
|
|
10911
|
-
properties.unshift('message');
|
|
10912
|
-
}
|
|
10913
|
-
|
|
10914
|
-
message = message ? ": ".concat(message) : '';
|
|
10915
|
-
options.truncate -= message.length + 5;
|
|
10916
|
-
var propertyContents = inspectList(properties.map(function (key) {
|
|
10917
|
-
return [key, error[key]];
|
|
10918
|
-
}), options, inspectProperty);
|
|
10919
|
-
return "".concat(name).concat(message).concat(propertyContents ? " { ".concat(propertyContents, " }") : '');
|
|
10920
|
-
}
|
|
10921
|
-
|
|
10922
|
-
function inspectAttribute(_ref, options) {
|
|
10923
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
10924
|
-
key = _ref2[0],
|
|
10925
|
-
value = _ref2[1];
|
|
10926
|
-
|
|
10927
|
-
options.truncate -= 3;
|
|
10928
|
-
|
|
10929
|
-
if (!value) {
|
|
10930
|
-
return "".concat(options.stylize(key, 'yellow'));
|
|
10931
|
-
}
|
|
10932
|
-
|
|
10933
|
-
return "".concat(options.stylize(key, 'yellow'), "=").concat(options.stylize("\"".concat(value, "\""), 'string'));
|
|
10934
|
-
}
|
|
10935
|
-
function inspectHTMLCollection(collection, options) {
|
|
10936
|
-
// eslint-disable-next-line no-use-before-define
|
|
10937
|
-
return inspectList(collection, options, inspectHTML, '\n');
|
|
10938
|
-
}
|
|
10939
|
-
function inspectHTML(element, options) {
|
|
10940
|
-
var properties = element.getAttributeNames();
|
|
10941
|
-
var name = element.tagName.toLowerCase();
|
|
10942
|
-
var head = options.stylize("<".concat(name), 'special');
|
|
10943
|
-
var headClose = options.stylize(">", 'special');
|
|
10944
|
-
var tail = options.stylize("</".concat(name, ">"), 'special');
|
|
10945
|
-
options.truncate -= name.length * 2 + 5;
|
|
10946
|
-
var propertyContents = '';
|
|
10947
|
-
|
|
10948
|
-
if (properties.length > 0) {
|
|
10949
|
-
propertyContents += ' ';
|
|
10950
|
-
propertyContents += inspectList(properties.map(function (key) {
|
|
10951
|
-
return [key, element.getAttribute(key)];
|
|
10952
|
-
}), options, inspectAttribute, ' ');
|
|
10953
|
-
}
|
|
10954
|
-
|
|
10955
|
-
options.truncate -= propertyContents.length;
|
|
10956
|
-
var truncate = options.truncate;
|
|
10957
|
-
var children = inspectHTMLCollection(element.children, options);
|
|
10958
|
-
|
|
10959
|
-
if (children && children.length > truncate) {
|
|
10960
|
-
children = "".concat(truncator, "(").concat(element.children.length, ")");
|
|
10961
|
-
}
|
|
10962
|
-
|
|
10963
|
-
return "".concat(head).concat(propertyContents).concat(headClose).concat(children).concat(tail);
|
|
10964
|
-
}
|
|
10965
|
-
|
|
10966
|
-
/* !
|
|
10967
|
-
* loupe
|
|
10968
|
-
* Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
|
|
10969
|
-
* MIT Licensed
|
|
10970
|
-
*/
|
|
10971
|
-
var symbolsSupported = typeof Symbol === 'function' && typeof Symbol.for === 'function';
|
|
10972
|
-
var chaiInspect = symbolsSupported ? Symbol.for('chai/inspect') : '@@chai/inspect';
|
|
10973
|
-
var nodeInspect = false;
|
|
10974
|
-
|
|
10975
|
-
try {
|
|
10976
|
-
// eslint-disable-next-line global-require
|
|
10977
|
-
nodeInspect = require('util').inspect.custom;
|
|
10978
|
-
} catch (noNodeInspect) {
|
|
10979
|
-
nodeInspect = false;
|
|
10980
|
-
}
|
|
10981
|
-
|
|
10982
|
-
var constructorMap = new WeakMap();
|
|
10983
|
-
var stringTagMap = {};
|
|
10984
|
-
var baseTypesMap = {
|
|
10985
|
-
undefined: function undefined$1(value, options) {
|
|
10986
|
-
return options.stylize('undefined', 'undefined');
|
|
10987
|
-
},
|
|
10988
|
-
null: function _null(value, options) {
|
|
10989
|
-
return options.stylize(null, 'null');
|
|
10990
|
-
},
|
|
10991
|
-
boolean: function boolean(value, options) {
|
|
10992
|
-
return options.stylize(value, 'boolean');
|
|
10993
|
-
},
|
|
10994
|
-
Boolean: function Boolean(value, options) {
|
|
10995
|
-
return options.stylize(value, 'boolean');
|
|
10996
|
-
},
|
|
10997
|
-
number: inspectNumber,
|
|
10998
|
-
Number: inspectNumber,
|
|
10999
|
-
bigint: inspectBigInt,
|
|
11000
|
-
BigInt: inspectBigInt,
|
|
11001
|
-
string: inspectString,
|
|
11002
|
-
String: inspectString,
|
|
11003
|
-
function: inspectFunction,
|
|
11004
|
-
Function: inspectFunction,
|
|
11005
|
-
symbol: inspectSymbol,
|
|
11006
|
-
// A Symbol polyfill will return `Symbol` not `symbol` from typedetect
|
|
11007
|
-
Symbol: inspectSymbol,
|
|
11008
|
-
Array: inspectArray,
|
|
11009
|
-
Date: inspectDate,
|
|
11010
|
-
Map: inspectMap,
|
|
11011
|
-
Set: inspectSet,
|
|
11012
|
-
RegExp: inspectRegExp,
|
|
11013
|
-
Promise: inspectPromise,
|
|
11014
|
-
// WeakSet, WeakMap are totally opaque to us
|
|
11015
|
-
WeakSet: function WeakSet(value, options) {
|
|
11016
|
-
return options.stylize('WeakSet{…}', 'special');
|
|
11017
|
-
},
|
|
11018
|
-
WeakMap: function WeakMap(value, options) {
|
|
11019
|
-
return options.stylize('WeakMap{…}', 'special');
|
|
11020
|
-
},
|
|
11021
|
-
Arguments: inspectArguments,
|
|
11022
|
-
Int8Array: inspectTypedArray,
|
|
11023
|
-
Uint8Array: inspectTypedArray,
|
|
11024
|
-
Uint8ClampedArray: inspectTypedArray,
|
|
11025
|
-
Int16Array: inspectTypedArray,
|
|
11026
|
-
Uint16Array: inspectTypedArray,
|
|
11027
|
-
Int32Array: inspectTypedArray,
|
|
11028
|
-
Uint32Array: inspectTypedArray,
|
|
11029
|
-
Float32Array: inspectTypedArray,
|
|
11030
|
-
Float64Array: inspectTypedArray,
|
|
11031
|
-
Generator: function Generator() {
|
|
11032
|
-
return '';
|
|
11033
|
-
},
|
|
11034
|
-
DataView: function DataView() {
|
|
11035
|
-
return '';
|
|
11036
|
-
},
|
|
11037
|
-
ArrayBuffer: function ArrayBuffer() {
|
|
11038
|
-
return '';
|
|
11039
|
-
},
|
|
11040
|
-
Error: inspectObject$1,
|
|
11041
|
-
HTMLCollection: inspectHTMLCollection,
|
|
11042
|
-
NodeList: inspectHTMLCollection
|
|
11043
|
-
}; // eslint-disable-next-line complexity
|
|
11044
|
-
|
|
11045
|
-
var inspectCustom = function inspectCustom(value, options, type) {
|
|
11046
|
-
if (chaiInspect in value && typeof value[chaiInspect] === 'function') {
|
|
11047
|
-
return value[chaiInspect](options);
|
|
11048
|
-
}
|
|
11049
|
-
|
|
11050
|
-
if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === 'function') {
|
|
11051
|
-
return value[nodeInspect](options.depth, options);
|
|
11052
|
-
}
|
|
11053
|
-
|
|
11054
|
-
if ('inspect' in value && typeof value.inspect === 'function') {
|
|
11055
|
-
return value.inspect(options.depth, options);
|
|
11056
|
-
}
|
|
11057
|
-
|
|
11058
|
-
if ('constructor' in value && constructorMap.has(value.constructor)) {
|
|
11059
|
-
return constructorMap.get(value.constructor)(value, options);
|
|
11060
|
-
}
|
|
11061
|
-
|
|
11062
|
-
if (stringTagMap[type]) {
|
|
11063
|
-
return stringTagMap[type](value, options);
|
|
11064
|
-
}
|
|
11065
|
-
|
|
11066
|
-
return '';
|
|
11067
|
-
}; // eslint-disable-next-line complexity
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
function inspect(value, options) {
|
|
11071
|
-
options = normaliseOptions(options);
|
|
11072
|
-
options.inspect = inspect;
|
|
11073
|
-
var _options = options,
|
|
11074
|
-
customInspect = _options.customInspect;
|
|
11075
|
-
var type = typeDetect(value); // If it is a base value that we already support, then use Loupe's inspector
|
|
11076
|
-
|
|
11077
|
-
if (baseTypesMap[type]) {
|
|
11078
|
-
return baseTypesMap[type](value, options);
|
|
11079
|
-
} // If `options.customInspect` is set to true then try to use the custom inspector
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
if (customInspect && value) {
|
|
11083
|
-
var output = inspectCustom(value, options, type);
|
|
11084
|
-
|
|
11085
|
-
if (output) {
|
|
11086
|
-
if (typeof output === 'string') return output;
|
|
11087
|
-
return inspect(output, options);
|
|
11088
|
-
}
|
|
11089
|
-
}
|
|
11090
|
-
|
|
11091
|
-
var proto = value ? Object.getPrototypeOf(value) : false; // If it's a plain Object then use Loupe's inspector
|
|
11092
|
-
|
|
11093
|
-
if (proto === Object.prototype || proto === null) {
|
|
11094
|
-
return inspectObject(value, options);
|
|
11095
|
-
} // Specifically account for HTMLElements
|
|
11096
|
-
// eslint-disable-next-line no-undef
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
if (value && typeof HTMLElement === 'function' && value instanceof HTMLElement) {
|
|
11100
|
-
return inspectHTML(value, options);
|
|
11101
|
-
}
|
|
11102
|
-
|
|
11103
|
-
if ('constructor' in value) {
|
|
11104
|
-
// If it is a class, inspect it like an object but add the constructor name
|
|
11105
|
-
if (value.constructor !== Object) {
|
|
11106
|
-
return inspectClass(value, options);
|
|
11107
|
-
} // If it is an object with an anonymous prototype, display it as an object.
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
return inspectObject(value, options);
|
|
11111
|
-
} // We have run out of options! Just stringify the value
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
return options.stylize(String(value), type);
|
|
11115
|
-
}
|
|
11116
|
-
function registerConstructor(constructor, inspector) {
|
|
11117
|
-
if (constructorMap.has(constructor)) {
|
|
11118
|
-
return false;
|
|
11119
|
-
}
|
|
11120
|
-
|
|
11121
|
-
constructorMap.add(constructor, inspector);
|
|
11122
|
-
return true;
|
|
11123
|
-
}
|
|
11124
|
-
function registerStringTag(stringTag, inspector) {
|
|
11125
|
-
if (stringTag in stringTagMap) {
|
|
11126
|
-
return false;
|
|
11127
|
-
}
|
|
11128
|
-
|
|
11129
|
-
stringTagMap[stringTag] = inspector;
|
|
11130
|
-
return true;
|
|
11131
|
-
}
|
|
11132
|
-
var custom = chaiInspect;
|
|
11133
|
-
|
|
11134
|
-
exports.custom = custom;
|
|
11135
|
-
exports.default = inspect;
|
|
11136
|
-
exports.inspect = inspect;
|
|
11137
|
-
exports.registerConstructor = registerConstructor;
|
|
11138
|
-
exports.registerStringTag = registerStringTag;
|
|
9959
|
+
function _typeof(obj) {
|
|
9960
|
+
"@babel/helpers - typeof";
|
|
9961
|
+
|
|
9962
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
9963
|
+
_typeof = function (obj) {
|
|
9964
|
+
return typeof obj;
|
|
9965
|
+
};
|
|
9966
|
+
} else {
|
|
9967
|
+
_typeof = function (obj) {
|
|
9968
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
9969
|
+
};
|
|
9970
|
+
}
|
|
9971
|
+
|
|
9972
|
+
return _typeof(obj);
|
|
9973
|
+
}
|
|
9974
|
+
|
|
9975
|
+
function _slicedToArray(arr, i) {
|
|
9976
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
9977
|
+
}
|
|
9978
|
+
|
|
9979
|
+
function _arrayWithHoles(arr) {
|
|
9980
|
+
if (Array.isArray(arr)) return arr;
|
|
9981
|
+
}
|
|
9982
|
+
|
|
9983
|
+
function _iterableToArrayLimit(arr, i) {
|
|
9984
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
9985
|
+
var _arr = [];
|
|
9986
|
+
var _n = true;
|
|
9987
|
+
var _d = false;
|
|
9988
|
+
var _e = undefined;
|
|
9989
|
+
|
|
9990
|
+
try {
|
|
9991
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
9992
|
+
_arr.push(_s.value);
|
|
9993
|
+
|
|
9994
|
+
if (i && _arr.length === i) break;
|
|
9995
|
+
}
|
|
9996
|
+
} catch (err) {
|
|
9997
|
+
_d = true;
|
|
9998
|
+
_e = err;
|
|
9999
|
+
} finally {
|
|
10000
|
+
try {
|
|
10001
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
10002
|
+
} finally {
|
|
10003
|
+
if (_d) throw _e;
|
|
10004
|
+
}
|
|
10005
|
+
}
|
|
10006
|
+
|
|
10007
|
+
return _arr;
|
|
10008
|
+
}
|
|
10009
|
+
|
|
10010
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
10011
|
+
if (!o) return;
|
|
10012
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
10013
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
10014
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
10015
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
10016
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
10017
|
+
}
|
|
10018
|
+
|
|
10019
|
+
function _arrayLikeToArray(arr, len) {
|
|
10020
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
10021
|
+
|
|
10022
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
10023
|
+
|
|
10024
|
+
return arr2;
|
|
10025
|
+
}
|
|
10026
|
+
|
|
10027
|
+
function _nonIterableRest() {
|
|
10028
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10029
|
+
}
|
|
10030
|
+
|
|
10031
|
+
var ansiColors = {
|
|
10032
|
+
bold: ['1', '22'],
|
|
10033
|
+
dim: ['2', '22'],
|
|
10034
|
+
italic: ['3', '23'],
|
|
10035
|
+
underline: ['4', '24'],
|
|
10036
|
+
// 5 & 6 are blinking
|
|
10037
|
+
inverse: ['7', '27'],
|
|
10038
|
+
hidden: ['8', '28'],
|
|
10039
|
+
strike: ['9', '29'],
|
|
10040
|
+
// 10-20 are fonts
|
|
10041
|
+
// 21-29 are resets for 1-9
|
|
10042
|
+
black: ['30', '39'],
|
|
10043
|
+
red: ['31', '39'],
|
|
10044
|
+
green: ['32', '39'],
|
|
10045
|
+
yellow: ['33', '39'],
|
|
10046
|
+
blue: ['34', '39'],
|
|
10047
|
+
magenta: ['35', '39'],
|
|
10048
|
+
cyan: ['36', '39'],
|
|
10049
|
+
white: ['37', '39'],
|
|
10050
|
+
brightblack: ['30;1', '39'],
|
|
10051
|
+
brightred: ['31;1', '39'],
|
|
10052
|
+
brightgreen: ['32;1', '39'],
|
|
10053
|
+
brightyellow: ['33;1', '39'],
|
|
10054
|
+
brightblue: ['34;1', '39'],
|
|
10055
|
+
brightmagenta: ['35;1', '39'],
|
|
10056
|
+
brightcyan: ['36;1', '39'],
|
|
10057
|
+
brightwhite: ['37;1', '39'],
|
|
10058
|
+
grey: ['90', '39']
|
|
10059
|
+
};
|
|
10060
|
+
var styles = {
|
|
10061
|
+
special: 'cyan',
|
|
10062
|
+
number: 'yellow',
|
|
10063
|
+
bigint: 'yellow',
|
|
10064
|
+
boolean: 'yellow',
|
|
10065
|
+
undefined: 'grey',
|
|
10066
|
+
null: 'bold',
|
|
10067
|
+
string: 'green',
|
|
10068
|
+
symbol: 'green',
|
|
10069
|
+
date: 'magenta',
|
|
10070
|
+
regexp: 'red'
|
|
10071
|
+
};
|
|
10072
|
+
var truncator = '…';
|
|
10073
|
+
|
|
10074
|
+
function colorise(value, styleType) {
|
|
10075
|
+
var color = ansiColors[styles[styleType]] || ansiColors[styleType];
|
|
10076
|
+
|
|
10077
|
+
if (!color) {
|
|
10078
|
+
return String(value);
|
|
10079
|
+
}
|
|
10080
|
+
|
|
10081
|
+
return "\x1B[".concat(color[0], "m").concat(String(value), "\x1B[").concat(color[1], "m");
|
|
10082
|
+
}
|
|
10083
|
+
|
|
10084
|
+
function normaliseOptions() {
|
|
10085
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
10086
|
+
_ref$showHidden = _ref.showHidden,
|
|
10087
|
+
showHidden = _ref$showHidden === void 0 ? false : _ref$showHidden,
|
|
10088
|
+
_ref$depth = _ref.depth,
|
|
10089
|
+
depth = _ref$depth === void 0 ? 2 : _ref$depth,
|
|
10090
|
+
_ref$colors = _ref.colors,
|
|
10091
|
+
colors = _ref$colors === void 0 ? false : _ref$colors,
|
|
10092
|
+
_ref$customInspect = _ref.customInspect,
|
|
10093
|
+
customInspect = _ref$customInspect === void 0 ? true : _ref$customInspect,
|
|
10094
|
+
_ref$showProxy = _ref.showProxy,
|
|
10095
|
+
showProxy = _ref$showProxy === void 0 ? false : _ref$showProxy,
|
|
10096
|
+
_ref$maxArrayLength = _ref.maxArrayLength,
|
|
10097
|
+
maxArrayLength = _ref$maxArrayLength === void 0 ? Infinity : _ref$maxArrayLength,
|
|
10098
|
+
_ref$breakLength = _ref.breakLength,
|
|
10099
|
+
breakLength = _ref$breakLength === void 0 ? Infinity : _ref$breakLength,
|
|
10100
|
+
_ref$seen = _ref.seen,
|
|
10101
|
+
seen = _ref$seen === void 0 ? [] : _ref$seen,
|
|
10102
|
+
_ref$truncate = _ref.truncate,
|
|
10103
|
+
truncate = _ref$truncate === void 0 ? Infinity : _ref$truncate,
|
|
10104
|
+
_ref$stylize = _ref.stylize,
|
|
10105
|
+
stylize = _ref$stylize === void 0 ? String : _ref$stylize;
|
|
10106
|
+
|
|
10107
|
+
var options = {
|
|
10108
|
+
showHidden: Boolean(showHidden),
|
|
10109
|
+
depth: Number(depth),
|
|
10110
|
+
colors: Boolean(colors),
|
|
10111
|
+
customInspect: Boolean(customInspect),
|
|
10112
|
+
showProxy: Boolean(showProxy),
|
|
10113
|
+
maxArrayLength: Number(maxArrayLength),
|
|
10114
|
+
breakLength: Number(breakLength),
|
|
10115
|
+
truncate: Number(truncate),
|
|
10116
|
+
seen: seen,
|
|
10117
|
+
stylize: stylize
|
|
10118
|
+
};
|
|
10119
|
+
|
|
10120
|
+
if (options.colors) {
|
|
10121
|
+
options.stylize = colorise;
|
|
10122
|
+
}
|
|
10123
|
+
|
|
10124
|
+
return options;
|
|
10125
|
+
}
|
|
10126
|
+
function truncate(string, length) {
|
|
10127
|
+
var tail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : truncator;
|
|
10128
|
+
string = String(string);
|
|
10129
|
+
var tailLength = tail.length;
|
|
10130
|
+
var stringLength = string.length;
|
|
10131
|
+
|
|
10132
|
+
if (tailLength > length && stringLength > tailLength) {
|
|
10133
|
+
return tail;
|
|
10134
|
+
}
|
|
10135
|
+
|
|
10136
|
+
if (stringLength > length && stringLength > tailLength) {
|
|
10137
|
+
return "".concat(string.slice(0, length - tailLength)).concat(tail);
|
|
10138
|
+
}
|
|
10139
|
+
|
|
10140
|
+
return string;
|
|
10141
|
+
} // eslint-disable-next-line complexity
|
|
10142
|
+
|
|
10143
|
+
function inspectList(list, options, inspectItem) {
|
|
10144
|
+
var separator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ', ';
|
|
10145
|
+
inspectItem = inspectItem || options.inspect;
|
|
10146
|
+
var size = list.length;
|
|
10147
|
+
if (size === 0) return '';
|
|
10148
|
+
var originalLength = options.truncate;
|
|
10149
|
+
var output = '';
|
|
10150
|
+
var peek = '';
|
|
10151
|
+
var truncated = '';
|
|
10152
|
+
|
|
10153
|
+
for (var i = 0; i < size; i += 1) {
|
|
10154
|
+
var last = i + 1 === list.length;
|
|
10155
|
+
var secondToLast = i + 2 === list.length;
|
|
10156
|
+
truncated = "".concat(truncator, "(").concat(list.length - i, ")");
|
|
10157
|
+
var value = list[i]; // If there is more than one remaining we need to account for a separator of `, `
|
|
10158
|
+
|
|
10159
|
+
options.truncate = originalLength - output.length - (last ? 0 : separator.length);
|
|
10160
|
+
var string = peek || inspectItem(value, options) + (last ? '' : separator);
|
|
10161
|
+
var nextLength = output.length + string.length;
|
|
10162
|
+
var truncatedLength = nextLength + truncated.length; // If this is the last element, and adding it would
|
|
10163
|
+
// take us over length, but adding the truncator wouldn't - then break now
|
|
10164
|
+
|
|
10165
|
+
if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {
|
|
10166
|
+
break;
|
|
10167
|
+
} // If this isn't the last or second to last element to scan,
|
|
10168
|
+
// but the string is already over length then break here
|
|
10169
|
+
|
|
10170
|
+
|
|
10171
|
+
if (!last && !secondToLast && truncatedLength > originalLength) {
|
|
10172
|
+
break;
|
|
10173
|
+
} // Peek at the next string to determine if we should
|
|
10174
|
+
// break early before adding this item to the output
|
|
10175
|
+
|
|
10176
|
+
|
|
10177
|
+
peek = last ? '' : inspectItem(list[i + 1], options) + (secondToLast ? '' : separator); // If we have one element left, but this element and
|
|
10178
|
+
// the next takes over length, the break early
|
|
10179
|
+
|
|
10180
|
+
if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
|
|
10181
|
+
break;
|
|
10182
|
+
}
|
|
10183
|
+
|
|
10184
|
+
output += string; // If the next element takes us to length -
|
|
10185
|
+
// but there are more after that, then we should truncate now
|
|
10186
|
+
|
|
10187
|
+
if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
|
|
10188
|
+
truncated = "".concat(truncator, "(").concat(list.length - i - 1, ")");
|
|
10189
|
+
break;
|
|
10190
|
+
}
|
|
10191
|
+
|
|
10192
|
+
truncated = '';
|
|
10193
|
+
}
|
|
10194
|
+
|
|
10195
|
+
return "".concat(output).concat(truncated);
|
|
10196
|
+
}
|
|
10197
|
+
|
|
10198
|
+
function quoteComplexKey(key) {
|
|
10199
|
+
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
|
|
10200
|
+
return key;
|
|
10201
|
+
}
|
|
10202
|
+
|
|
10203
|
+
return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
10204
|
+
}
|
|
10205
|
+
|
|
10206
|
+
function inspectProperty(_ref2, options) {
|
|
10207
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
10208
|
+
key = _ref3[0],
|
|
10209
|
+
value = _ref3[1];
|
|
10210
|
+
|
|
10211
|
+
options.truncate -= 2;
|
|
10212
|
+
|
|
10213
|
+
if (typeof key === 'string') {
|
|
10214
|
+
key = quoteComplexKey(key);
|
|
10215
|
+
} else if (typeof key !== 'number') {
|
|
10216
|
+
key = "[".concat(options.inspect(key, options), "]");
|
|
10217
|
+
}
|
|
10218
|
+
|
|
10219
|
+
options.truncate -= key.length;
|
|
10220
|
+
value = options.inspect(value, options);
|
|
10221
|
+
return "".concat(key, ": ").concat(value);
|
|
10222
|
+
}
|
|
10223
|
+
|
|
10224
|
+
function inspectArray(array, options) {
|
|
10225
|
+
// Object.keys will always output the Array indices first, so we can slice by
|
|
10226
|
+
// `array.length` to get non-index properties
|
|
10227
|
+
var nonIndexProperties = Object.keys(array).slice(array.length);
|
|
10228
|
+
if (!array.length && !nonIndexProperties.length) return '[]';
|
|
10229
|
+
options.truncate -= 4;
|
|
10230
|
+
var listContents = inspectList(array, options);
|
|
10231
|
+
options.truncate -= listContents.length;
|
|
10232
|
+
var propertyContents = '';
|
|
10233
|
+
|
|
10234
|
+
if (nonIndexProperties.length) {
|
|
10235
|
+
propertyContents = inspectList(nonIndexProperties.map(function (key) {
|
|
10236
|
+
return [key, array[key]];
|
|
10237
|
+
}), options, inspectProperty);
|
|
10238
|
+
}
|
|
10239
|
+
|
|
10240
|
+
return "[ ".concat(listContents).concat(propertyContents ? ", ".concat(propertyContents) : '', " ]");
|
|
10241
|
+
}
|
|
10242
|
+
|
|
10243
|
+
/* !
|
|
10244
|
+
* Chai - getFuncName utility
|
|
10245
|
+
* Copyright(c) 2012-2016 Jake Luer <jake@alogicalparadox.com>
|
|
10246
|
+
* MIT Licensed
|
|
10247
|
+
*/
|
|
10248
|
+
|
|
10249
|
+
/**
|
|
10250
|
+
* ### .getFuncName(constructorFn)
|
|
10251
|
+
*
|
|
10252
|
+
* Returns the name of a function.
|
|
10253
|
+
* When a non-function instance is passed, returns `null`.
|
|
10254
|
+
* This also includes a polyfill function if `aFunc.name` is not defined.
|
|
10255
|
+
*
|
|
10256
|
+
* @name getFuncName
|
|
10257
|
+
* @param {Function} funct
|
|
10258
|
+
* @namespace Utils
|
|
10259
|
+
* @api public
|
|
10260
|
+
*/
|
|
10261
|
+
|
|
10262
|
+
var toString = Function.prototype.toString;
|
|
10263
|
+
var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;
|
|
10264
|
+
function getFuncName(aFunc) {
|
|
10265
|
+
if (typeof aFunc !== 'function') {
|
|
10266
|
+
return null;
|
|
10267
|
+
}
|
|
10268
|
+
|
|
10269
|
+
var name = '';
|
|
10270
|
+
if (typeof Function.prototype.name === 'undefined' && typeof aFunc.name === 'undefined') {
|
|
10271
|
+
// Here we run a polyfill if Function does not support the `name` property and if aFunc.name is not defined
|
|
10272
|
+
var match = toString.call(aFunc).match(functionNameMatch);
|
|
10273
|
+
if (match) {
|
|
10274
|
+
name = match[1];
|
|
10275
|
+
}
|
|
10276
|
+
} else {
|
|
10277
|
+
// If we've got a `name` property we just use it
|
|
10278
|
+
name = aFunc.name;
|
|
10279
|
+
}
|
|
10280
|
+
|
|
10281
|
+
return name;
|
|
10282
|
+
}
|
|
10283
|
+
|
|
10284
|
+
var getFuncName_1 = getFuncName;
|
|
10285
|
+
|
|
10286
|
+
var getArrayName = function getArrayName(array) {
|
|
10287
|
+
// We need to special case Node.js' Buffers, which report to be Uint8Array
|
|
10288
|
+
if (typeof Buffer === 'function' && array instanceof Buffer) {
|
|
10289
|
+
return 'Buffer';
|
|
10290
|
+
}
|
|
10291
|
+
|
|
10292
|
+
if (array[Symbol.toStringTag]) {
|
|
10293
|
+
return array[Symbol.toStringTag];
|
|
10294
|
+
}
|
|
10295
|
+
|
|
10296
|
+
return getFuncName_1(array.constructor);
|
|
10297
|
+
};
|
|
10298
|
+
|
|
10299
|
+
function inspectTypedArray(array, options) {
|
|
10300
|
+
var name = getArrayName(array);
|
|
10301
|
+
options.truncate -= name.length + 4; // Object.keys will always output the Array indices first, so we can slice by
|
|
10302
|
+
// `array.length` to get non-index properties
|
|
10303
|
+
|
|
10304
|
+
var nonIndexProperties = Object.keys(array).slice(array.length);
|
|
10305
|
+
if (!array.length && !nonIndexProperties.length) return "".concat(name, "[]"); // As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply
|
|
10306
|
+
// stylise the toString() value of them
|
|
10307
|
+
|
|
10308
|
+
var output = '';
|
|
10309
|
+
|
|
10310
|
+
for (var i = 0; i < array.length; i++) {
|
|
10311
|
+
var string = "".concat(options.stylize(truncate(array[i], options.truncate), 'number')).concat(i === array.length - 1 ? '' : ', ');
|
|
10312
|
+
options.truncate -= string.length;
|
|
10313
|
+
|
|
10314
|
+
if (array[i] !== array.length && options.truncate <= 3) {
|
|
10315
|
+
output += "".concat(truncator, "(").concat(array.length - array[i] + 1, ")");
|
|
10316
|
+
break;
|
|
10317
|
+
}
|
|
10318
|
+
|
|
10319
|
+
output += string;
|
|
10320
|
+
}
|
|
10321
|
+
|
|
10322
|
+
var propertyContents = '';
|
|
10323
|
+
|
|
10324
|
+
if (nonIndexProperties.length) {
|
|
10325
|
+
propertyContents = inspectList(nonIndexProperties.map(function (key) {
|
|
10326
|
+
return [key, array[key]];
|
|
10327
|
+
}), options, inspectProperty);
|
|
10328
|
+
}
|
|
10329
|
+
|
|
10330
|
+
return "".concat(name, "[ ").concat(output).concat(propertyContents ? ", ".concat(propertyContents) : '', " ]");
|
|
10331
|
+
}
|
|
10332
|
+
|
|
10333
|
+
function inspectDate(dateObject, options) {
|
|
10334
|
+
// If we need to - truncate the time portion, but never the date
|
|
10335
|
+
var split = dateObject.toJSON().split('T');
|
|
10336
|
+
var date = split[0];
|
|
10337
|
+
return options.stylize("".concat(date, "T").concat(truncate(split[1], options.truncate - date.length - 1)), 'date');
|
|
10338
|
+
}
|
|
10339
|
+
|
|
10340
|
+
function inspectFunction(func, options) {
|
|
10341
|
+
var name = getFuncName_1(func);
|
|
10342
|
+
|
|
10343
|
+
if (!name) {
|
|
10344
|
+
return options.stylize('[Function]', 'special');
|
|
10345
|
+
}
|
|
10346
|
+
|
|
10347
|
+
return options.stylize("[Function ".concat(truncate(name, options.truncate - 11), "]"), 'special');
|
|
10348
|
+
}
|
|
10349
|
+
|
|
10350
|
+
function inspectMapEntry(_ref, options) {
|
|
10351
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
10352
|
+
key = _ref2[0],
|
|
10353
|
+
value = _ref2[1];
|
|
10354
|
+
|
|
10355
|
+
options.truncate -= 4;
|
|
10356
|
+
key = options.inspect(key, options);
|
|
10357
|
+
options.truncate -= key.length;
|
|
10358
|
+
value = options.inspect(value, options);
|
|
10359
|
+
return "".concat(key, " => ").concat(value);
|
|
10360
|
+
} // IE11 doesn't support `map.entries()`
|
|
10361
|
+
|
|
10362
|
+
|
|
10363
|
+
function mapToEntries(map) {
|
|
10364
|
+
var entries = [];
|
|
10365
|
+
map.forEach(function (value, key) {
|
|
10366
|
+
entries.push([key, value]);
|
|
10367
|
+
});
|
|
10368
|
+
return entries;
|
|
10369
|
+
}
|
|
10370
|
+
|
|
10371
|
+
function inspectMap(map, options) {
|
|
10372
|
+
var size = map.size - 1;
|
|
10373
|
+
|
|
10374
|
+
if (size <= 0) {
|
|
10375
|
+
return 'Map{}';
|
|
10376
|
+
}
|
|
10377
|
+
|
|
10378
|
+
options.truncate -= 7;
|
|
10379
|
+
return "Map{ ".concat(inspectList(mapToEntries(map), options, inspectMapEntry), " }");
|
|
10380
|
+
}
|
|
10381
|
+
|
|
10382
|
+
var isNaN = Number.isNaN || function (i) {
|
|
10383
|
+
return i !== i;
|
|
10384
|
+
}; // eslint-disable-line no-self-compare
|
|
10385
|
+
|
|
10386
|
+
|
|
10387
|
+
function inspectNumber(number, options) {
|
|
10388
|
+
if (isNaN(number)) {
|
|
10389
|
+
return options.stylize('NaN', 'number');
|
|
10390
|
+
}
|
|
10391
|
+
|
|
10392
|
+
if (number === Infinity) {
|
|
10393
|
+
return options.stylize('Infinity', 'number');
|
|
10394
|
+
}
|
|
10395
|
+
|
|
10396
|
+
if (number === -Infinity) {
|
|
10397
|
+
return options.stylize('-Infinity', 'number');
|
|
10398
|
+
}
|
|
10399
|
+
|
|
10400
|
+
if (number === 0) {
|
|
10401
|
+
return options.stylize(1 / number === Infinity ? '+0' : '-0', 'number');
|
|
10402
|
+
}
|
|
10403
|
+
|
|
10404
|
+
return options.stylize(truncate(number, options.truncate), 'number');
|
|
10405
|
+
}
|
|
10406
|
+
|
|
10407
|
+
function inspectBigInt(number, options) {
|
|
10408
|
+
var nums = truncate(number.toString(), options.truncate - 1);
|
|
10409
|
+
if (nums !== truncator) nums += 'n';
|
|
10410
|
+
return options.stylize(nums, 'bigint');
|
|
10411
|
+
}
|
|
10412
|
+
|
|
10413
|
+
function inspectRegExp(value, options) {
|
|
10414
|
+
var flags = value.toString().split('/')[2];
|
|
10415
|
+
var sourceLength = options.truncate - (2 + flags.length);
|
|
10416
|
+
var source = value.source;
|
|
10417
|
+
return options.stylize("/".concat(truncate(source, sourceLength), "/").concat(flags), 'regexp');
|
|
10418
|
+
}
|
|
10419
|
+
|
|
10420
|
+
function arrayFromSet(set) {
|
|
10421
|
+
var values = [];
|
|
10422
|
+
set.forEach(function (value) {
|
|
10423
|
+
values.push(value);
|
|
10424
|
+
});
|
|
10425
|
+
return values;
|
|
10426
|
+
}
|
|
10427
|
+
|
|
10428
|
+
function inspectSet(set, options) {
|
|
10429
|
+
if (set.size === 0) return 'Set{}';
|
|
10430
|
+
options.truncate -= 7;
|
|
10431
|
+
return "Set{ ".concat(inspectList(arrayFromSet(set), options), " }");
|
|
10432
|
+
}
|
|
10433
|
+
|
|
10434
|
+
var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5" + "\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", 'g');
|
|
10435
|
+
var escapeCharacters = {
|
|
10436
|
+
'\b': '\\b',
|
|
10437
|
+
'\t': '\\t',
|
|
10438
|
+
'\n': '\\n',
|
|
10439
|
+
'\f': '\\f',
|
|
10440
|
+
'\r': '\\r',
|
|
10441
|
+
"'": "\\'",
|
|
10442
|
+
'\\': '\\\\'
|
|
10443
|
+
};
|
|
10444
|
+
var hex = 16;
|
|
10445
|
+
var unicodeLength = 4;
|
|
10446
|
+
|
|
10447
|
+
function escape(char) {
|
|
10448
|
+
return escapeCharacters[char] || "\\u".concat("0000".concat(char.charCodeAt(0).toString(hex)).slice(-unicodeLength));
|
|
10449
|
+
}
|
|
10450
|
+
|
|
10451
|
+
function inspectString(string, options) {
|
|
10452
|
+
if (stringEscapeChars.test(string)) {
|
|
10453
|
+
string = string.replace(stringEscapeChars, escape);
|
|
10454
|
+
}
|
|
10455
|
+
|
|
10456
|
+
return options.stylize("'".concat(truncate(string, options.truncate - 2), "'"), 'string');
|
|
10457
|
+
}
|
|
10458
|
+
|
|
10459
|
+
function inspectSymbol(value) {
|
|
10460
|
+
if ('description' in Symbol.prototype) {
|
|
10461
|
+
return value.description ? "Symbol(".concat(value.description, ")") : 'Symbol()';
|
|
10462
|
+
}
|
|
10463
|
+
|
|
10464
|
+
return value.toString();
|
|
10465
|
+
}
|
|
10466
|
+
|
|
10467
|
+
var getPromiseValue = function getPromiseValue() {
|
|
10468
|
+
return 'Promise{…}';
|
|
10469
|
+
};
|
|
10470
|
+
|
|
10471
|
+
try {
|
|
10472
|
+
var _process$binding = process.binding('util'),
|
|
10473
|
+
getPromiseDetails = _process$binding.getPromiseDetails,
|
|
10474
|
+
kPending = _process$binding.kPending,
|
|
10475
|
+
kRejected = _process$binding.kRejected;
|
|
10476
|
+
|
|
10477
|
+
if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
|
|
10478
|
+
getPromiseValue = function getPromiseValue(value, options) {
|
|
10479
|
+
var _getPromiseDetails = getPromiseDetails(value),
|
|
10480
|
+
_getPromiseDetails2 = _slicedToArray(_getPromiseDetails, 2),
|
|
10481
|
+
state = _getPromiseDetails2[0],
|
|
10482
|
+
innerValue = _getPromiseDetails2[1];
|
|
10483
|
+
|
|
10484
|
+
if (state === kPending) {
|
|
10485
|
+
return 'Promise{<pending>}';
|
|
10486
|
+
}
|
|
10487
|
+
|
|
10488
|
+
return "Promise".concat(state === kRejected ? '!' : '', "{").concat(options.inspect(innerValue, options), "}");
|
|
10489
|
+
};
|
|
10490
|
+
}
|
|
10491
|
+
} catch (notNode) {
|
|
10492
|
+
/* ignore */
|
|
10493
|
+
}
|
|
10494
|
+
|
|
10495
|
+
var inspectPromise = getPromiseValue;
|
|
10496
|
+
|
|
10497
|
+
function inspectObject(object, options) {
|
|
10498
|
+
var properties = Object.getOwnPropertyNames(object);
|
|
10499
|
+
var symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
|
|
10500
|
+
|
|
10501
|
+
if (properties.length === 0 && symbols.length === 0) {
|
|
10502
|
+
return '{}';
|
|
10503
|
+
}
|
|
10504
|
+
|
|
10505
|
+
options.truncate -= 4;
|
|
10506
|
+
options.seen = options.seen || [];
|
|
10507
|
+
|
|
10508
|
+
if (options.seen.indexOf(object) >= 0) {
|
|
10509
|
+
return '[Circular]';
|
|
10510
|
+
}
|
|
10511
|
+
|
|
10512
|
+
options.seen.push(object);
|
|
10513
|
+
var propertyContents = inspectList(properties.map(function (key) {
|
|
10514
|
+
return [key, object[key]];
|
|
10515
|
+
}), options, inspectProperty);
|
|
10516
|
+
var symbolContents = inspectList(symbols.map(function (key) {
|
|
10517
|
+
return [key, object[key]];
|
|
10518
|
+
}), options, inspectProperty);
|
|
10519
|
+
options.seen.pop();
|
|
10520
|
+
var sep = '';
|
|
10521
|
+
|
|
10522
|
+
if (propertyContents && symbolContents) {
|
|
10523
|
+
sep = ', ';
|
|
10524
|
+
}
|
|
10525
|
+
|
|
10526
|
+
return "{ ".concat(propertyContents).concat(sep).concat(symbolContents, " }");
|
|
10527
|
+
}
|
|
10528
|
+
|
|
10529
|
+
var toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
10530
|
+
function inspectClass(value, options) {
|
|
10531
|
+
var name = '';
|
|
10532
|
+
|
|
10533
|
+
if (toStringTag && toStringTag in value) {
|
|
10534
|
+
name = value[toStringTag];
|
|
10535
|
+
}
|
|
10536
|
+
|
|
10537
|
+
name = name || getFuncName_1(value.constructor); // Babel transforms anonymous classes to the name `_class`
|
|
10538
|
+
|
|
10539
|
+
if (!name || name === '_class') {
|
|
10540
|
+
name = '<Anonymous Class>';
|
|
10541
|
+
}
|
|
10542
|
+
|
|
10543
|
+
options.truncate -= name.length;
|
|
10544
|
+
return "".concat(name).concat(inspectObject(value, options));
|
|
10545
|
+
}
|
|
10546
|
+
|
|
10547
|
+
function inspectArguments(args, options) {
|
|
10548
|
+
if (args.length === 0) return 'Arguments[]';
|
|
10549
|
+
options.truncate -= 13;
|
|
10550
|
+
return "Arguments[ ".concat(inspectList(args, options), " ]");
|
|
10551
|
+
}
|
|
10552
|
+
|
|
10553
|
+
var errorKeys = ['stack', 'line', 'column', 'name', 'message', 'fileName', 'lineNumber', 'columnNumber', 'number', 'description'];
|
|
10554
|
+
function inspectObject$1(error, options) {
|
|
10555
|
+
var properties = Object.getOwnPropertyNames(error).filter(function (key) {
|
|
10556
|
+
return errorKeys.indexOf(key) === -1;
|
|
10557
|
+
});
|
|
10558
|
+
var name = error.name;
|
|
10559
|
+
options.truncate -= name.length;
|
|
10560
|
+
var message = '';
|
|
10561
|
+
|
|
10562
|
+
if (typeof error.message === 'string') {
|
|
10563
|
+
message = truncate(error.message, options.truncate);
|
|
10564
|
+
} else {
|
|
10565
|
+
properties.unshift('message');
|
|
10566
|
+
}
|
|
10567
|
+
|
|
10568
|
+
message = message ? ": ".concat(message) : '';
|
|
10569
|
+
options.truncate -= message.length + 5;
|
|
10570
|
+
var propertyContents = inspectList(properties.map(function (key) {
|
|
10571
|
+
return [key, error[key]];
|
|
10572
|
+
}), options, inspectProperty);
|
|
10573
|
+
return "".concat(name).concat(message).concat(propertyContents ? " { ".concat(propertyContents, " }") : '');
|
|
10574
|
+
}
|
|
10575
|
+
|
|
10576
|
+
function inspectAttribute(_ref, options) {
|
|
10577
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
10578
|
+
key = _ref2[0],
|
|
10579
|
+
value = _ref2[1];
|
|
10580
|
+
|
|
10581
|
+
options.truncate -= 3;
|
|
10582
|
+
|
|
10583
|
+
if (!value) {
|
|
10584
|
+
return "".concat(options.stylize(key, 'yellow'));
|
|
10585
|
+
}
|
|
10586
|
+
|
|
10587
|
+
return "".concat(options.stylize(key, 'yellow'), "=").concat(options.stylize("\"".concat(value, "\""), 'string'));
|
|
10588
|
+
}
|
|
10589
|
+
function inspectHTMLCollection(collection, options) {
|
|
10590
|
+
// eslint-disable-next-line no-use-before-define
|
|
10591
|
+
return inspectList(collection, options, inspectHTML, '\n');
|
|
10592
|
+
}
|
|
10593
|
+
function inspectHTML(element, options) {
|
|
10594
|
+
var properties = element.getAttributeNames();
|
|
10595
|
+
var name = element.tagName.toLowerCase();
|
|
10596
|
+
var head = options.stylize("<".concat(name), 'special');
|
|
10597
|
+
var headClose = options.stylize(">", 'special');
|
|
10598
|
+
var tail = options.stylize("</".concat(name, ">"), 'special');
|
|
10599
|
+
options.truncate -= name.length * 2 + 5;
|
|
10600
|
+
var propertyContents = '';
|
|
10601
|
+
|
|
10602
|
+
if (properties.length > 0) {
|
|
10603
|
+
propertyContents += ' ';
|
|
10604
|
+
propertyContents += inspectList(properties.map(function (key) {
|
|
10605
|
+
return [key, element.getAttribute(key)];
|
|
10606
|
+
}), options, inspectAttribute, ' ');
|
|
10607
|
+
}
|
|
10608
|
+
|
|
10609
|
+
options.truncate -= propertyContents.length;
|
|
10610
|
+
var truncate = options.truncate;
|
|
10611
|
+
var children = inspectHTMLCollection(element.children, options);
|
|
10612
|
+
|
|
10613
|
+
if (children && children.length > truncate) {
|
|
10614
|
+
children = "".concat(truncator, "(").concat(element.children.length, ")");
|
|
10615
|
+
}
|
|
10616
|
+
|
|
10617
|
+
return "".concat(head).concat(propertyContents).concat(headClose).concat(children).concat(tail);
|
|
10618
|
+
}
|
|
10619
|
+
|
|
10620
|
+
var symbolsSupported = typeof Symbol === 'function' && typeof Symbol.for === 'function';
|
|
10621
|
+
var chaiInspect = symbolsSupported ? Symbol.for('chai/inspect') : '@@chai/inspect';
|
|
10622
|
+
var nodeInspect = false;
|
|
10623
|
+
|
|
10624
|
+
try {
|
|
10625
|
+
// eslint-disable-next-line global-require
|
|
10626
|
+
var nodeUtil = require('util');
|
|
10627
|
+
|
|
10628
|
+
nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
|
|
10629
|
+
} catch (noNodeInspect) {
|
|
10630
|
+
nodeInspect = false;
|
|
10631
|
+
}
|
|
10632
|
+
|
|
10633
|
+
var constructorMap = new WeakMap();
|
|
10634
|
+
var stringTagMap = {};
|
|
10635
|
+
var baseTypesMap = {
|
|
10636
|
+
undefined: function undefined$1(value, options) {
|
|
10637
|
+
return options.stylize('undefined', 'undefined');
|
|
10638
|
+
},
|
|
10639
|
+
null: function _null(value, options) {
|
|
10640
|
+
return options.stylize(null, 'null');
|
|
10641
|
+
},
|
|
10642
|
+
boolean: function boolean(value, options) {
|
|
10643
|
+
return options.stylize(value, 'boolean');
|
|
10644
|
+
},
|
|
10645
|
+
Boolean: function Boolean(value, options) {
|
|
10646
|
+
return options.stylize(value, 'boolean');
|
|
10647
|
+
},
|
|
10648
|
+
number: inspectNumber,
|
|
10649
|
+
Number: inspectNumber,
|
|
10650
|
+
bigint: inspectBigInt,
|
|
10651
|
+
BigInt: inspectBigInt,
|
|
10652
|
+
string: inspectString,
|
|
10653
|
+
String: inspectString,
|
|
10654
|
+
function: inspectFunction,
|
|
10655
|
+
Function: inspectFunction,
|
|
10656
|
+
symbol: inspectSymbol,
|
|
10657
|
+
// A Symbol polyfill will return `Symbol` not `symbol` from typedetect
|
|
10658
|
+
Symbol: inspectSymbol,
|
|
10659
|
+
Array: inspectArray,
|
|
10660
|
+
Date: inspectDate,
|
|
10661
|
+
Map: inspectMap,
|
|
10662
|
+
Set: inspectSet,
|
|
10663
|
+
RegExp: inspectRegExp,
|
|
10664
|
+
Promise: inspectPromise,
|
|
10665
|
+
// WeakSet, WeakMap are totally opaque to us
|
|
10666
|
+
WeakSet: function WeakSet(value, options) {
|
|
10667
|
+
return options.stylize('WeakSet{…}', 'special');
|
|
10668
|
+
},
|
|
10669
|
+
WeakMap: function WeakMap(value, options) {
|
|
10670
|
+
return options.stylize('WeakMap{…}', 'special');
|
|
10671
|
+
},
|
|
10672
|
+
Arguments: inspectArguments,
|
|
10673
|
+
Int8Array: inspectTypedArray,
|
|
10674
|
+
Uint8Array: inspectTypedArray,
|
|
10675
|
+
Uint8ClampedArray: inspectTypedArray,
|
|
10676
|
+
Int16Array: inspectTypedArray,
|
|
10677
|
+
Uint16Array: inspectTypedArray,
|
|
10678
|
+
Int32Array: inspectTypedArray,
|
|
10679
|
+
Uint32Array: inspectTypedArray,
|
|
10680
|
+
Float32Array: inspectTypedArray,
|
|
10681
|
+
Float64Array: inspectTypedArray,
|
|
10682
|
+
Generator: function Generator() {
|
|
10683
|
+
return '';
|
|
10684
|
+
},
|
|
10685
|
+
DataView: function DataView() {
|
|
10686
|
+
return '';
|
|
10687
|
+
},
|
|
10688
|
+
ArrayBuffer: function ArrayBuffer() {
|
|
10689
|
+
return '';
|
|
10690
|
+
},
|
|
10691
|
+
Error: inspectObject$1,
|
|
10692
|
+
HTMLCollection: inspectHTMLCollection,
|
|
10693
|
+
NodeList: inspectHTMLCollection
|
|
10694
|
+
}; // eslint-disable-next-line complexity
|
|
10695
|
+
|
|
10696
|
+
var inspectCustom = function inspectCustom(value, options, type) {
|
|
10697
|
+
if (chaiInspect in value && typeof value[chaiInspect] === 'function') {
|
|
10698
|
+
return value[chaiInspect](options);
|
|
10699
|
+
}
|
|
10700
|
+
|
|
10701
|
+
if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === 'function') {
|
|
10702
|
+
return value[nodeInspect](options.depth, options);
|
|
10703
|
+
}
|
|
10704
|
+
|
|
10705
|
+
if ('inspect' in value && typeof value.inspect === 'function') {
|
|
10706
|
+
return value.inspect(options.depth, options);
|
|
10707
|
+
}
|
|
10708
|
+
|
|
10709
|
+
if ('constructor' in value && constructorMap.has(value.constructor)) {
|
|
10710
|
+
return constructorMap.get(value.constructor)(value, options);
|
|
10711
|
+
}
|
|
10712
|
+
|
|
10713
|
+
if (stringTagMap[type]) {
|
|
10714
|
+
return stringTagMap[type](value, options);
|
|
10715
|
+
}
|
|
10716
|
+
|
|
10717
|
+
return '';
|
|
10718
|
+
};
|
|
10719
|
+
|
|
10720
|
+
var toString$1 = Object.prototype.toString; // eslint-disable-next-line complexity
|
|
10721
|
+
|
|
10722
|
+
function inspect(value, options) {
|
|
10723
|
+
options = normaliseOptions(options);
|
|
10724
|
+
options.inspect = inspect;
|
|
10725
|
+
var _options = options,
|
|
10726
|
+
customInspect = _options.customInspect;
|
|
10727
|
+
var type = value === null ? 'null' : _typeof(value);
|
|
10728
|
+
|
|
10729
|
+
if (type === 'object') {
|
|
10730
|
+
type = toString$1.call(value).slice(8, -1);
|
|
10731
|
+
} // If it is a base value that we already support, then use Loupe's inspector
|
|
10732
|
+
|
|
10733
|
+
|
|
10734
|
+
if (baseTypesMap[type]) {
|
|
10735
|
+
return baseTypesMap[type](value, options);
|
|
10736
|
+
} // If `options.customInspect` is set to true then try to use the custom inspector
|
|
10737
|
+
|
|
10738
|
+
|
|
10739
|
+
if (customInspect && value) {
|
|
10740
|
+
var output = inspectCustom(value, options, type);
|
|
10741
|
+
|
|
10742
|
+
if (output) {
|
|
10743
|
+
if (typeof output === 'string') return output;
|
|
10744
|
+
return inspect(output, options);
|
|
10745
|
+
}
|
|
10746
|
+
}
|
|
10747
|
+
|
|
10748
|
+
var proto = value ? Object.getPrototypeOf(value) : false; // If it's a plain Object then use Loupe's inspector
|
|
10749
|
+
|
|
10750
|
+
if (proto === Object.prototype || proto === null) {
|
|
10751
|
+
return inspectObject(value, options);
|
|
10752
|
+
} // Specifically account for HTMLElements
|
|
10753
|
+
// eslint-disable-next-line no-undef
|
|
10754
|
+
|
|
10755
|
+
|
|
10756
|
+
if (value && typeof HTMLElement === 'function' && value instanceof HTMLElement) {
|
|
10757
|
+
return inspectHTML(value, options);
|
|
10758
|
+
}
|
|
10759
|
+
|
|
10760
|
+
if ('constructor' in value) {
|
|
10761
|
+
// If it is a class, inspect it like an object but add the constructor name
|
|
10762
|
+
if (value.constructor !== Object) {
|
|
10763
|
+
return inspectClass(value, options);
|
|
10764
|
+
} // If it is an object with an anonymous prototype, display it as an object.
|
|
10765
|
+
|
|
10766
|
+
|
|
10767
|
+
return inspectObject(value, options);
|
|
10768
|
+
} // We have run out of options! Just stringify the value
|
|
10769
|
+
|
|
10770
|
+
|
|
10771
|
+
return options.stylize(String(value), type);
|
|
10772
|
+
}
|
|
10773
|
+
function registerConstructor(constructor, inspector) {
|
|
10774
|
+
if (constructorMap.has(constructor)) {
|
|
10775
|
+
return false;
|
|
10776
|
+
}
|
|
10777
|
+
|
|
10778
|
+
constructorMap.add(constructor, inspector);
|
|
10779
|
+
return true;
|
|
10780
|
+
}
|
|
10781
|
+
function registerStringTag(stringTag, inspector) {
|
|
10782
|
+
if (stringTag in stringTagMap) {
|
|
10783
|
+
return false;
|
|
10784
|
+
}
|
|
10785
|
+
|
|
10786
|
+
stringTagMap[stringTag] = inspector;
|
|
10787
|
+
return true;
|
|
10788
|
+
}
|
|
10789
|
+
var custom = chaiInspect;
|
|
10790
|
+
|
|
10791
|
+
exports.custom = custom;
|
|
10792
|
+
exports.default = inspect;
|
|
10793
|
+
exports.inspect = inspect;
|
|
10794
|
+
exports.registerConstructor = registerConstructor;
|
|
10795
|
+
exports.registerStringTag = registerStringTag;
|
|
11139
10796
|
|
|
11140
|
-
|
|
10797
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11141
10798
|
|
|
11142
10799
|
})));
|
|
11143
10800
|
|