mocha 2.3.0 → 2.3.4

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/mocha.js CHANGED
@@ -437,7 +437,7 @@ Context.prototype.inspect = function() {
437
437
  */
438
438
 
439
439
  var Runnable = require('./runnable');
440
- var create = require('lodash.create');
440
+ var inherits = require('./utils').inherits;
441
441
 
442
442
  /**
443
443
  * Expose `Hook`.
@@ -460,10 +460,7 @@ function Hook(title, fn) {
460
460
  /**
461
461
  * Inherit from `Runnable.prototype`.
462
462
  */
463
-
464
- Hook.prototype = create(Runnable.prototype, {
465
- constructor: Hook
466
- });
463
+ inherits(Hook, Runnable);
467
464
 
468
465
  /**
469
466
  * Get or set the test `err`.
@@ -482,7 +479,7 @@ Hook.prototype.error = function(err) {
482
479
  this._error = err;
483
480
  };
484
481
 
485
- },{"./runnable":35,"lodash.create":70}],8:[function(require,module,exports){
482
+ },{"./runnable":35,"./utils":39}],8:[function(require,module,exports){
486
483
  /**
487
484
  * Module dependencies.
488
485
  */
@@ -1032,7 +1029,7 @@ function Mocha(options) {
1032
1029
  this.ui(options.ui);
1033
1030
  this.bail(options.bail);
1034
1031
  this.reporter(options.reporter, options.reporterOptions);
1035
- if (options.timeout != null) {
1032
+ if (typeof options.timeout !== 'undefined' && options.timeout !== null) {
1036
1033
  this.timeout(options.timeout);
1037
1034
  }
1038
1035
  this.useColors(options.useColors);
@@ -1754,7 +1751,14 @@ exports.list = function(failures) {
1754
1751
  // msg
1755
1752
  var msg;
1756
1753
  var err = test.err;
1757
- var message = err.message || '';
1754
+ var message;
1755
+ if (err.message) {
1756
+ message = err.message;
1757
+ } else if (typeof err.inspect === 'function') {
1758
+ message = err.inspect() + '';
1759
+ } else {
1760
+ message = '';
1761
+ }
1758
1762
  var stack = err.stack || message;
1759
1763
  var index = stack.indexOf(message);
1760
1764
  var actual = err.actual;
@@ -1986,7 +1990,7 @@ function unifiedDiff(err, escape) {
1986
1990
  return indent + line;
1987
1991
  }
1988
1992
  function notBlank(line) {
1989
- return line != null;
1993
+ return typeof line !== 'undefined' && line !== null;
1990
1994
  }
1991
1995
  var msg = diff.createPatch('string', err.actual, err.expected);
1992
1996
  var lines = msg.split('\n').splice(4);
@@ -2136,7 +2140,7 @@ function Doc(runner) {
2136
2140
  */
2137
2141
 
2138
2142
  var Base = require('./base');
2139
- var create = require('lodash.create');
2143
+ var inherits = require('../utils').inherits;
2140
2144
  var color = Base.color;
2141
2145
 
2142
2146
  /**
@@ -2196,13 +2200,10 @@ function Dot(runner) {
2196
2200
  /**
2197
2201
  * Inherit from `Base.prototype`.
2198
2202
  */
2199
-
2200
- Dot.prototype = create(Base.prototype, {
2201
- constructor: Dot
2202
- });
2203
+ inherits(Dot, Base);
2203
2204
 
2204
2205
  }).call(this,require('_process'))
2205
- },{"./base":17,"_process":51,"lodash.create":70}],20:[function(require,module,exports){
2206
+ },{"../utils":39,"./base":17,"_process":51}],20:[function(require,module,exports){
2206
2207
  (function (process,__dirname){
2207
2208
  /**
2208
2209
  * Module dependencies.
@@ -2930,7 +2931,7 @@ function errorJSON(err) {
2930
2931
  */
2931
2932
 
2932
2933
  var Base = require('./base');
2933
- var create = require('lodash.create');
2934
+ var inherits = require('../utils').inherits;
2934
2935
  var cursor = Base.cursor;
2935
2936
  var color = Base.color;
2936
2937
 
@@ -3016,20 +3017,17 @@ function Landing(runner) {
3016
3017
  /**
3017
3018
  * Inherit from `Base.prototype`.
3018
3019
  */
3019
-
3020
- Landing.prototype = create(Base.prototype, {
3021
- constructor: Landing
3022
- });
3020
+ inherits(Landing, Base);
3023
3021
 
3024
3022
  }).call(this,require('_process'))
3025
- },{"./base":17,"_process":51,"lodash.create":70}],27:[function(require,module,exports){
3023
+ },{"../utils":39,"./base":17,"_process":51}],27:[function(require,module,exports){
3026
3024
  (function (process){
3027
3025
  /**
3028
3026
  * Module dependencies.
3029
3027
  */
3030
3028
 
3031
3029
  var Base = require('./base');
3032
- var create = require('lodash.create');
3030
+ var inherits = require('../utils').inherits;
3033
3031
  var color = Base.color;
3034
3032
  var cursor = Base.cursor;
3035
3033
 
@@ -3084,13 +3082,10 @@ function List(runner) {
3084
3082
  /**
3085
3083
  * Inherit from `Base.prototype`.
3086
3084
  */
3087
-
3088
- List.prototype = create(Base.prototype, {
3089
- constructor: List
3090
- });
3085
+ inherits(List, Base);
3091
3086
 
3092
3087
  }).call(this,require('_process'))
3093
- },{"./base":17,"_process":51,"lodash.create":70}],28:[function(require,module,exports){
3088
+ },{"../utils":39,"./base":17,"_process":51}],28:[function(require,module,exports){
3094
3089
  (function (process){
3095
3090
  /**
3096
3091
  * Module dependencies.
@@ -3132,7 +3127,7 @@ function Markdown(runner) {
3132
3127
  var key = SUITE_PREFIX + suite.title;
3133
3128
 
3134
3129
  obj = obj[key] = obj[key] || { suite: suite };
3135
- suite.suites.forEach(function() {
3130
+ suite.suites.forEach(function(suite) {
3136
3131
  mapTOC(suite, obj);
3137
3132
  });
3138
3133
 
@@ -3198,7 +3193,7 @@ function Markdown(runner) {
3198
3193
  */
3199
3194
 
3200
3195
  var Base = require('./base');
3201
- var create = require('lodash.create');
3196
+ var inherits = require('../utils').inherits;
3202
3197
 
3203
3198
  /**
3204
3199
  * Expose `Min`.
@@ -3228,20 +3223,17 @@ function Min(runner) {
3228
3223
  /**
3229
3224
  * Inherit from `Base.prototype`.
3230
3225
  */
3231
-
3232
- Min.prototype = create(Base.prototype, {
3233
- constructor: Min
3234
- });
3226
+ inherits(Min, Base);
3235
3227
 
3236
3228
  }).call(this,require('_process'))
3237
- },{"./base":17,"_process":51,"lodash.create":70}],30:[function(require,module,exports){
3229
+ },{"../utils":39,"./base":17,"_process":51}],30:[function(require,module,exports){
3238
3230
  (function (process){
3239
3231
  /**
3240
3232
  * Module dependencies.
3241
3233
  */
3242
3234
 
3243
3235
  var Base = require('./base');
3244
- var create = require('lodash.create');
3236
+ var inherits = require('../utils').inherits;
3245
3237
 
3246
3238
  /**
3247
3239
  * Expose `Dot`.
@@ -3300,10 +3292,7 @@ function NyanCat(runner) {
3300
3292
  /**
3301
3293
  * Inherit from `Base.prototype`.
3302
3294
  */
3303
-
3304
- NyanCat.prototype = create(Base.prototype, {
3305
- constructor: NyanCat
3306
- });
3295
+ inherits(NyanCat, Base);
3307
3296
 
3308
3297
  /**
3309
3298
  * Draw the nyan cat
@@ -3502,14 +3491,14 @@ function write(string) {
3502
3491
  }
3503
3492
 
3504
3493
  }).call(this,require('_process'))
3505
- },{"./base":17,"_process":51,"lodash.create":70}],31:[function(require,module,exports){
3494
+ },{"../utils":39,"./base":17,"_process":51}],31:[function(require,module,exports){
3506
3495
  (function (process){
3507
3496
  /**
3508
3497
  * Module dependencies.
3509
3498
  */
3510
3499
 
3511
3500
  var Base = require('./base');
3512
- var create = require('lodash.create');
3501
+ var inherits = require('../utils').inherits;
3513
3502
  var color = Base.color;
3514
3503
  var cursor = Base.cursor;
3515
3504
 
@@ -3592,19 +3581,16 @@ function Progress(runner, options) {
3592
3581
  /**
3593
3582
  * Inherit from `Base.prototype`.
3594
3583
  */
3595
-
3596
- Progress.prototype = create(Base.prototype, {
3597
- constructor: Progress
3598
- });
3584
+ inherits(Progress, Base);
3599
3585
 
3600
3586
  }).call(this,require('_process'))
3601
- },{"./base":17,"_process":51,"lodash.create":70}],32:[function(require,module,exports){
3587
+ },{"../utils":39,"./base":17,"_process":51}],32:[function(require,module,exports){
3602
3588
  /**
3603
3589
  * Module dependencies.
3604
3590
  */
3605
3591
 
3606
3592
  var Base = require('./base');
3607
- var create = require('lodash.create');
3593
+ var inherits = require('../utils').inherits;
3608
3594
  var color = Base.color;
3609
3595
  var cursor = Base.cursor;
3610
3596
 
@@ -3681,12 +3667,9 @@ function Spec(runner) {
3681
3667
  /**
3682
3668
  * Inherit from `Base.prototype`.
3683
3669
  */
3670
+ inherits(Spec, Base);
3684
3671
 
3685
- Spec.prototype = create(Base.prototype, {
3686
- constructor: Spec
3687
- });
3688
-
3689
- },{"./base":17,"lodash.create":70}],33:[function(require,module,exports){
3672
+ },{"../utils":39,"./base":17}],33:[function(require,module,exports){
3690
3673
  /**
3691
3674
  * Module dependencies.
3692
3675
  */
@@ -3763,9 +3746,10 @@ function title(test) {
3763
3746
  */
3764
3747
 
3765
3748
  var Base = require('./base');
3766
- var create = require('lodash.create');
3749
+ var utils = require('../utils');
3750
+ var inherits = utils.inherits;
3767
3751
  var fs = require('fs');
3768
- var escape = require('../utils').escape;
3752
+ var escape = utils.escape;
3769
3753
 
3770
3754
  /**
3771
3755
  * Save timer references to avoid Sinon interfering (see GH-237).
@@ -3836,6 +3820,11 @@ function XUnit(runner, options) {
3836
3820
  });
3837
3821
  }
3838
3822
 
3823
+ /**
3824
+ * Inherit from `Base.prototype`.
3825
+ */
3826
+ inherits(XUnit, Base);
3827
+
3839
3828
  /**
3840
3829
  * Override done to close the stream (if it's a file).
3841
3830
  *
@@ -3852,14 +3841,6 @@ XUnit.prototype.done = function(failures, fn) {
3852
3841
  }
3853
3842
  };
3854
3843
 
3855
- /**
3856
- * Inherit from `Base.prototype`.
3857
- */
3858
-
3859
- XUnit.prototype = create(Base.prototype, {
3860
- constructor: XUnit
3861
- });
3862
-
3863
3844
  /**
3864
3845
  * Write out the given line.
3865
3846
  *
@@ -3931,7 +3912,7 @@ function cdata(str) {
3931
3912
  }
3932
3913
 
3933
3914
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
3934
- },{"../utils":39,"./base":17,"fs":41,"lodash.create":70}],35:[function(require,module,exports){
3915
+ },{"../utils":39,"./base":17,"fs":41}],35:[function(require,module,exports){
3935
3916
  (function (global){
3936
3917
  /**
3937
3918
  * Module dependencies.
@@ -3939,10 +3920,10 @@ function cdata(str) {
3939
3920
 
3940
3921
  var EventEmitter = require('events').EventEmitter;
3941
3922
  var Pending = require('./pending');
3942
- var create = require('lodash.create');
3943
3923
  var debug = require('debug')('mocha:runnable');
3944
3924
  var milliseconds = require('./ms');
3945
3925
  var utils = require('./utils');
3926
+ var inherits = utils.inherits;
3946
3927
 
3947
3928
  /**
3948
3929
  * Save timer references to avoid Sinon interfering (see GH-237).
@@ -3992,10 +3973,7 @@ function Runnable(title, fn) {
3992
3973
  /**
3993
3974
  * Inherit from `EventEmitter.prototype`.
3994
3975
  */
3995
-
3996
- Runnable.prototype = create(EventEmitter.prototype, {
3997
- constructor: Runnable
3998
- });
3976
+ inherits(Runnable, EventEmitter);
3999
3977
 
4000
3978
  /**
4001
3979
  * Set & get timeout `ms`.
@@ -4258,7 +4236,7 @@ Runnable.prototype.run = function(fn) {
4258
4236
  };
4259
4237
 
4260
4238
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4261
- },{"./ms":15,"./pending":16,"./utils":39,"debug":2,"events":3,"lodash.create":70}],36:[function(require,module,exports){
4239
+ },{"./ms":15,"./pending":16,"./utils":39,"debug":2,"events":3}],36:[function(require,module,exports){
4262
4240
  (function (process,global){
4263
4241
  /**
4264
4242
  * Module dependencies.
@@ -4266,15 +4244,17 @@ Runnable.prototype.run = function(fn) {
4266
4244
 
4267
4245
  var EventEmitter = require('events').EventEmitter;
4268
4246
  var Pending = require('./pending');
4269
- var create = require('lodash.create');
4247
+ var utils = require('./utils');
4248
+ var inherits = utils.inherits;
4270
4249
  var debug = require('debug')('mocha:runner');
4271
- var filter = require('./utils').filter;
4272
- var indexOf = require('./utils').indexOf;
4273
- var keys = require('./utils').keys;
4274
- var stackFilter = require('./utils').stackTraceFilter();
4275
- var stringify = require('./utils').stringify;
4276
- var type = require('./utils').type;
4277
- var undefinedError = require('./utils').undefinedError;
4250
+ var Runnable = require('./runnable');
4251
+ var filter = utils.filter;
4252
+ var indexOf = utils.indexOf;
4253
+ var keys = utils.keys;
4254
+ var stackFilter = utils.stackTraceFilter();
4255
+ var stringify = utils.stringify;
4256
+ var type = utils.type;
4257
+ var undefinedError = utils.undefinedError;
4278
4258
 
4279
4259
  /**
4280
4260
  * Non-enumerable globals.
@@ -4325,6 +4305,7 @@ function Runner(suite, delay) {
4325
4305
  this._abort = false;
4326
4306
  this._delay = delay;
4327
4307
  this.suite = suite;
4308
+ this.started = false;
4328
4309
  this.total = suite.total();
4329
4310
  this.failures = 0;
4330
4311
  this.on('test end', function(test) {
@@ -4349,10 +4330,7 @@ Runner.immediately = global.setImmediate || process.nextTick;
4349
4330
  /**
4350
4331
  * Inherit from `EventEmitter.prototype`.
4351
4332
  */
4352
-
4353
- Runner.prototype = create(EventEmitter.prototype, {
4354
- constructor: Runner
4355
- });
4333
+ inherits(Runner, EventEmitter);
4356
4334
 
4357
4335
  /**
4358
4336
  * Run tests with full titles matching `re`. Updates runner.total
@@ -4550,12 +4528,13 @@ Runner.prototype.hook = function(name, fn) {
4550
4528
 
4551
4529
  self.emit('hook', hook);
4552
4530
 
4553
- hook.on('error', function(err) {
4554
- self.failHook(hook, err);
4555
- });
4531
+ if (!hook.listeners('error').length) {
4532
+ hook.on('error', function(err) {
4533
+ self.failHook(hook, err);
4534
+ });
4535
+ }
4556
4536
 
4557
4537
  hook.run(function(err) {
4558
- hook.removeAllListeners('error');
4559
4538
  var testError = hook.error();
4560
4539
  if (testError) {
4561
4540
  self.fail(self.test, testError);
@@ -4650,7 +4629,8 @@ Runner.prototype.hookDown = function(name, fn) {
4650
4629
  Runner.prototype.parents = function() {
4651
4630
  var suite = this.suite;
4652
4631
  var suites = [];
4653
- while (suite = suite.parent) {
4632
+ while (suite.parent) {
4633
+ suite = suite.parent;
4654
4634
  suites.push(suite);
4655
4635
  }
4656
4636
  return suites;
@@ -4831,7 +4811,7 @@ Runner.prototype.runSuite = function(suite, fn) {
4831
4811
 
4832
4812
  debug('run suite %s', suite.fullTitle());
4833
4813
 
4834
- if (!total) {
4814
+ if (!total || (self.failures && suite._bail)) {
4835
4815
  return fn();
4836
4816
  }
4837
4817
 
@@ -4916,7 +4896,20 @@ Runner.prototype.uncaught = function(err) {
4916
4896
  err.uncaught = true;
4917
4897
 
4918
4898
  var runnable = this.currentRunnable;
4899
+
4919
4900
  if (!runnable) {
4901
+ runnable = new Runnable('Uncaught error outside test suite');
4902
+ runnable.parent = this.suite;
4903
+
4904
+ if (this.started) {
4905
+ this.fail(runnable, err);
4906
+ } else {
4907
+ // Can't recover from this failure
4908
+ this.emit('start');
4909
+ this.fail(runnable, err);
4910
+ this.emit('end');
4911
+ }
4912
+
4920
4913
  return;
4921
4914
  }
4922
4915
 
@@ -4975,6 +4968,7 @@ Runner.prototype.run = function(fn) {
4975
4968
  }
4976
4969
 
4977
4970
  function start() {
4971
+ self.started = true;
4978
4972
  self.emit('start');
4979
4973
  self.runSuite(rootSuite, function() {
4980
4974
  debug('finished running');
@@ -5070,7 +5064,8 @@ function filterLeaks(ok, globals) {
5070
5064
  */
5071
5065
  function extraGlobals() {
5072
5066
  if (typeof process === 'object' && typeof process.version === 'string') {
5073
- var nodeVersion = process.version.split('.').reduce(function(a, v) {
5067
+ var parts = process.version.split('.');
5068
+ var nodeVersion = utils.reduce(parts, function(a, v) {
5074
5069
  return a << 8 | v;
5075
5070
  });
5076
5071
 
@@ -5085,17 +5080,17 @@ function extraGlobals() {
5085
5080
  }
5086
5081
 
5087
5082
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5088
- },{"./pending":16,"./utils":39,"_process":51,"debug":2,"events":3,"lodash.create":70}],37:[function(require,module,exports){
5083
+ },{"./pending":16,"./runnable":35,"./utils":39,"_process":51,"debug":2,"events":3}],37:[function(require,module,exports){
5089
5084
  /**
5090
5085
  * Module dependencies.
5091
5086
  */
5092
5087
 
5093
5088
  var EventEmitter = require('events').EventEmitter;
5094
5089
  var Hook = require('./hook');
5095
- var create = require('lodash.create');
5090
+ var utils = require('./utils');
5091
+ var inherits = utils.inherits;
5096
5092
  var debug = require('debug')('mocha:suite');
5097
5093
  var milliseconds = require('./ms');
5098
- var utils = require('./utils');
5099
5094
 
5100
5095
  /**
5101
5096
  * Expose `Suite`.
@@ -5154,10 +5149,7 @@ function Suite(title, parentContext) {
5154
5149
  /**
5155
5150
  * Inherit from `EventEmitter.prototype`.
5156
5151
  */
5157
-
5158
- Suite.prototype = create(EventEmitter.prototype, {
5159
- constructor: Suite
5160
- });
5152
+ inherits(Suite, EventEmitter);
5161
5153
 
5162
5154
  /**
5163
5155
  * Return a clone of this `Suite`.
@@ -5455,13 +5447,13 @@ Suite.prototype.run = function run() {
5455
5447
  }
5456
5448
  };
5457
5449
 
5458
- },{"./hook":7,"./ms":15,"./utils":39,"debug":2,"events":3,"lodash.create":70}],38:[function(require,module,exports){
5450
+ },{"./hook":7,"./ms":15,"./utils":39,"debug":2,"events":3}],38:[function(require,module,exports){
5459
5451
  /**
5460
5452
  * Module dependencies.
5461
5453
  */
5462
5454
 
5463
5455
  var Runnable = require('./runnable');
5464
- var create = require('lodash.create');
5456
+ var inherits = require('./utils').inherits;
5465
5457
 
5466
5458
  /**
5467
5459
  * Expose `Test`.
@@ -5485,12 +5477,9 @@ function Test(title, fn) {
5485
5477
  /**
5486
5478
  * Inherit from `Runnable.prototype`.
5487
5479
  */
5480
+ inherits(Test, Runnable);
5488
5481
 
5489
- Test.prototype = create(Runnable.prototype, {
5490
- constructor: Test
5491
- });
5492
-
5493
- },{"./runnable":35,"lodash.create":70}],39:[function(require,module,exports){
5482
+ },{"./runnable":35,"./utils":39}],39:[function(require,module,exports){
5494
5483
  (function (process,Buffer){
5495
5484
  /* eslint-env browser */
5496
5485
 
@@ -5513,6 +5502,8 @@ var watchFile = require('fs').watchFile;
5513
5502
 
5514
5503
  var ignore = ['node_modules', '.git'];
5515
5504
 
5505
+ exports.inherits = require('util').inherits;
5506
+
5516
5507
  /**
5517
5508
  * Escape special characters in the given string of html.
5518
5509
  *
@@ -6181,7 +6172,7 @@ exports.getError = function(err) {
6181
6172
  * @description
6182
6173
  * When invoking this function you get a filter function that get the Error.stack as an input,
6183
6174
  * and return a prettify output.
6184
- * (i.e: strip Mocha, node_modules, bower and componentJS from stack trace).
6175
+ * (i.e: strip Mocha and internal node functions from stack trace).
6185
6176
  * @returns {Function}
6186
6177
  */
6187
6178
  exports.stackTraceFilter = function() {
@@ -6193,14 +6184,10 @@ exports.stackTraceFilter = function() {
6193
6184
  : (typeof location === 'undefined' ? window.location : location).href.replace(/\/[^\/]*$/, '/');
6194
6185
 
6195
6186
  function isMochaInternal(line) {
6196
- return (~line.indexOf('node_modules' + slash + 'mocha'))
6197
- || (~line.indexOf('components' + slash + 'mochajs'))
6198
- || (~line.indexOf('components' + slash + 'mocha'));
6199
- }
6200
-
6201
- // node_modules, bower, componentJS
6202
- function isBrowserModule(line) {
6203
- return (~line.indexOf('node_modules')) || (~line.indexOf('components'));
6187
+ return (~line.indexOf('node_modules' + slash + 'mocha' + slash))
6188
+ || (~line.indexOf('components' + slash + 'mochajs' + slash))
6189
+ || (~line.indexOf('components' + slash + 'mocha' + slash))
6190
+ || (~line.indexOf(slash + 'mocha.js'));
6204
6191
  }
6205
6192
 
6206
6193
  function isNodeInternal(line) {
@@ -6216,11 +6203,11 @@ exports.stackTraceFilter = function() {
6216
6203
  stack = stack.split('\n');
6217
6204
 
6218
6205
  stack = exports.reduce(stack, function(list, line) {
6219
- if (is.node && (isMochaInternal(line) || isNodeInternal(line))) {
6206
+ if (isMochaInternal(line)) {
6220
6207
  return list;
6221
6208
  }
6222
6209
 
6223
- if (is.browser && (isBrowserModule(line))) {
6210
+ if (is.node && isNodeInternal(line)) {
6224
6211
  return list;
6225
6212
  }
6226
6213
 
@@ -6234,7 +6221,7 @@ exports.stackTraceFilter = function() {
6234
6221
  };
6235
6222
 
6236
6223
  }).call(this,require('_process'),require("buffer").Buffer)
6237
- },{"_process":51,"buffer":43,"debug":2,"fs":41,"glob":41,"path":41}],40:[function(require,module,exports){
6224
+ },{"_process":51,"buffer":43,"debug":2,"fs":41,"glob":41,"path":41,"util":66}],40:[function(require,module,exports){
6238
6225
  (function (process){
6239
6226
  var WritableStream = require('stream').Writable
6240
6227
  var inherits = require('util').inherits
@@ -6294,28 +6281,35 @@ var rootParent = {}
6294
6281
  * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
6295
6282
  * Opera 11.6+, iOS 4.2+.
6296
6283
  *
6284
+ * Due to various browser bugs, sometimes the Object implementation will be used even
6285
+ * when the browser supports typed arrays.
6286
+ *
6297
6287
  * Note:
6298
6288
  *
6299
- * - Implementation must support adding new properties to `Uint8Array` instances.
6300
- * Firefox 4-29 lacked support, fixed in Firefox 30+.
6301
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
6289
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
6290
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
6302
6291
  *
6303
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
6292
+ * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
6293
+ * on objects.
6304
6294
  *
6305
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
6306
- * incorrect length in some situations.
6295
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
6307
6296
  *
6308
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they will
6309
- * get the Object implementation, which is slower but will work correctly.
6297
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
6298
+ * incorrect length in some situations.
6299
+
6300
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
6301
+ * get the Object implementation, which is slower but behaves correctly.
6310
6302
  */
6311
6303
  Buffer.TYPED_ARRAY_SUPPORT = (function () {
6304
+ function Bar () {}
6312
6305
  try {
6313
- var buf = new ArrayBuffer(0)
6314
- var arr = new Uint8Array(buf)
6306
+ var arr = new Uint8Array(1)
6315
6307
  arr.foo = function () { return 42 }
6308
+ arr.constructor = Bar
6316
6309
  return arr.foo() === 42 && // typed array instances can be augmented
6310
+ arr.constructor === Bar && // constructor can be set
6317
6311
  typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
6318
- new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
6312
+ arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
6319
6313
  } catch (e) {
6320
6314
  return false
6321
6315
  }
@@ -6393,8 +6387,13 @@ function fromObject (that, object) {
6393
6387
  throw new TypeError('must start with number, buffer, array or string')
6394
6388
  }
6395
6389
 
6396
- if (typeof ArrayBuffer !== 'undefined' && object.buffer instanceof ArrayBuffer) {
6397
- return fromTypedArray(that, object)
6390
+ if (typeof ArrayBuffer !== 'undefined') {
6391
+ if (object.buffer instanceof ArrayBuffer) {
6392
+ return fromTypedArray(that, object)
6393
+ }
6394
+ if (object instanceof ArrayBuffer) {
6395
+ return fromArrayBuffer(that, object)
6396
+ }
6398
6397
  }
6399
6398
 
6400
6399
  if (object.length) return fromArrayLike(that, object)
@@ -6431,6 +6430,18 @@ function fromTypedArray (that, array) {
6431
6430
  return that
6432
6431
  }
6433
6432
 
6433
+ function fromArrayBuffer (that, array) {
6434
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
6435
+ // Return an augmented `Uint8Array` instance, for best performance
6436
+ array.byteLength
6437
+ that = Buffer._augment(new Uint8Array(array))
6438
+ } else {
6439
+ // Fallback: Return an object instance of the Buffer class
6440
+ that = fromTypedArray(that, new Uint8Array(array))
6441
+ }
6442
+ return that
6443
+ }
6444
+
6434
6445
  function fromArrayLike (that, array) {
6435
6446
  var length = checked(array.length) | 0
6436
6447
  that = allocate(that, length)
@@ -6548,8 +6559,6 @@ Buffer.concat = function concat (list, length) {
6548
6559
 
6549
6560
  if (list.length === 0) {
6550
6561
  return new Buffer(0)
6551
- } else if (list.length === 1) {
6552
- return list[0]
6553
6562
  }
6554
6563
 
6555
6564
  var i
@@ -6724,13 +6733,13 @@ Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
6724
6733
  throw new TypeError('val must be string, number or Buffer')
6725
6734
  }
6726
6735
 
6727
- // `get` will be removed in Node 0.13+
6736
+ // `get` is deprecated
6728
6737
  Buffer.prototype.get = function get (offset) {
6729
6738
  console.log('.get() is deprecated. Access using array indexes instead.')
6730
6739
  return this.readUInt8(offset)
6731
6740
  }
6732
6741
 
6733
- // `set` will be removed in Node 0.13+
6742
+ // `set` is deprecated
6734
6743
  Buffer.prototype.set = function set (v, offset) {
6735
6744
  console.log('.set() is deprecated. Access using array indexes instead.')
6736
6745
  return this.writeUInt8(v, offset)
@@ -6871,20 +6880,99 @@ function base64Slice (buf, start, end) {
6871
6880
  }
6872
6881
 
6873
6882
  function utf8Slice (buf, start, end) {
6874
- var res = ''
6875
- var tmp = ''
6876
6883
  end = Math.min(buf.length, end)
6884
+ var res = []
6885
+
6886
+ var i = start
6887
+ while (i < end) {
6888
+ var firstByte = buf[i]
6889
+ var codePoint = null
6890
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
6891
+ : (firstByte > 0xDF) ? 3
6892
+ : (firstByte > 0xBF) ? 2
6893
+ : 1
6894
+
6895
+ if (i + bytesPerSequence <= end) {
6896
+ var secondByte, thirdByte, fourthByte, tempCodePoint
6897
+
6898
+ switch (bytesPerSequence) {
6899
+ case 1:
6900
+ if (firstByte < 0x80) {
6901
+ codePoint = firstByte
6902
+ }
6903
+ break
6904
+ case 2:
6905
+ secondByte = buf[i + 1]
6906
+ if ((secondByte & 0xC0) === 0x80) {
6907
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
6908
+ if (tempCodePoint > 0x7F) {
6909
+ codePoint = tempCodePoint
6910
+ }
6911
+ }
6912
+ break
6913
+ case 3:
6914
+ secondByte = buf[i + 1]
6915
+ thirdByte = buf[i + 2]
6916
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
6917
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
6918
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
6919
+ codePoint = tempCodePoint
6920
+ }
6921
+ }
6922
+ break
6923
+ case 4:
6924
+ secondByte = buf[i + 1]
6925
+ thirdByte = buf[i + 2]
6926
+ fourthByte = buf[i + 3]
6927
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
6928
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
6929
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
6930
+ codePoint = tempCodePoint
6931
+ }
6932
+ }
6933
+ }
6934
+ }
6877
6935
 
6878
- for (var i = start; i < end; i++) {
6879
- if (buf[i] <= 0x7F) {
6880
- res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
6881
- tmp = ''
6882
- } else {
6883
- tmp += '%' + buf[i].toString(16)
6936
+ if (codePoint === null) {
6937
+ // we did not generate a valid codePoint so insert a
6938
+ // replacement char (U+FFFD) and advance only 1 byte
6939
+ codePoint = 0xFFFD
6940
+ bytesPerSequence = 1
6941
+ } else if (codePoint > 0xFFFF) {
6942
+ // encode to utf16 (surrogate pair dance)
6943
+ codePoint -= 0x10000
6944
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
6945
+ codePoint = 0xDC00 | codePoint & 0x3FF
6884
6946
  }
6947
+
6948
+ res.push(codePoint)
6949
+ i += bytesPerSequence
6885
6950
  }
6886
6951
 
6887
- return res + decodeUtf8Char(tmp)
6952
+ return decodeCodePointsArray(res)
6953
+ }
6954
+
6955
+ // Based on http://stackoverflow.com/a/22747272/680742, the browser with
6956
+ // the lowest limit is Chrome, with 0x10000 args.
6957
+ // We go 1 magnitude less, for safety
6958
+ var MAX_ARGUMENTS_LENGTH = 0x1000
6959
+
6960
+ function decodeCodePointsArray (codePoints) {
6961
+ var len = codePoints.length
6962
+ if (len <= MAX_ARGUMENTS_LENGTH) {
6963
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
6964
+ }
6965
+
6966
+ // Decode in chunks to avoid "call stack size exceeded".
6967
+ var res = ''
6968
+ var i = 0
6969
+ while (i < len) {
6970
+ res += String.fromCharCode.apply(
6971
+ String,
6972
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
6973
+ )
6974
+ }
6975
+ return res
6888
6976
  }
6889
6977
 
6890
6978
  function asciiSlice (buf, start, end) {
@@ -7419,9 +7507,16 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
7419
7507
  }
7420
7508
 
7421
7509
  var len = end - start
7510
+ var i
7422
7511
 
7423
- if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
7424
- for (var i = 0; i < len; i++) {
7512
+ if (this === target && start < targetStart && targetStart < end) {
7513
+ // descending copy from end
7514
+ for (i = len - 1; i >= 0; i--) {
7515
+ target[i + targetStart] = this[i + start]
7516
+ }
7517
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
7518
+ // ascending copy from start
7519
+ for (i = 0; i < len; i++) {
7425
7520
  target[i + targetStart] = this[i + start]
7426
7521
  }
7427
7522
  } else {
@@ -7497,7 +7592,7 @@ Buffer._augment = function _augment (arr) {
7497
7592
  // save reference to original Uint8Array set method before overwriting
7498
7593
  arr._set = arr.set
7499
7594
 
7500
- // deprecated, will be removed in node 0.13+
7595
+ // deprecated
7501
7596
  arr.get = BP.get
7502
7597
  arr.set = BP.set
7503
7598
 
@@ -7553,7 +7648,7 @@ Buffer._augment = function _augment (arr) {
7553
7648
  return arr
7554
7649
  }
7555
7650
 
7556
- var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g
7651
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
7557
7652
 
7558
7653
  function base64clean (str) {
7559
7654
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
@@ -7583,28 +7678,15 @@ function utf8ToBytes (string, units) {
7583
7678
  var length = string.length
7584
7679
  var leadSurrogate = null
7585
7680
  var bytes = []
7586
- var i = 0
7587
7681
 
7588
- for (; i < length; i++) {
7682
+ for (var i = 0; i < length; i++) {
7589
7683
  codePoint = string.charCodeAt(i)
7590
7684
 
7591
7685
  // is surrogate component
7592
7686
  if (codePoint > 0xD7FF && codePoint < 0xE000) {
7593
7687
  // last char was a lead
7594
- if (leadSurrogate) {
7595
- // 2 leads in a row
7596
- if (codePoint < 0xDC00) {
7597
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
7598
- leadSurrogate = codePoint
7599
- continue
7600
- } else {
7601
- // valid surrogate pair
7602
- codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
7603
- leadSurrogate = null
7604
- }
7605
- } else {
7688
+ if (!leadSurrogate) {
7606
7689
  // no lead yet
7607
-
7608
7690
  if (codePoint > 0xDBFF) {
7609
7691
  // unexpected trail
7610
7692
  if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
@@ -7613,18 +7695,30 @@ function utf8ToBytes (string, units) {
7613
7695
  // unpaired lead
7614
7696
  if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
7615
7697
  continue
7616
- } else {
7617
- // valid lead
7618
- leadSurrogate = codePoint
7619
- continue
7620
7698
  }
7699
+
7700
+ // valid lead
7701
+ leadSurrogate = codePoint
7702
+
7703
+ continue
7704
+ }
7705
+
7706
+ // 2 leads in a row
7707
+ if (codePoint < 0xDC00) {
7708
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
7709
+ leadSurrogate = codePoint
7710
+ continue
7621
7711
  }
7712
+
7713
+ // valid surrogate pair
7714
+ codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
7622
7715
  } else if (leadSurrogate) {
7623
7716
  // valid bmp char, but last char was a lead
7624
7717
  if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
7625
- leadSurrogate = null
7626
7718
  }
7627
7719
 
7720
+ leadSurrogate = null
7721
+
7628
7722
  // encode utf8
7629
7723
  if (codePoint < 0x80) {
7630
7724
  if ((units -= 1) < 0) break
@@ -7642,7 +7736,7 @@ function utf8ToBytes (string, units) {
7642
7736
  codePoint >> 0x6 & 0x3F | 0x80,
7643
7737
  codePoint & 0x3F | 0x80
7644
7738
  )
7645
- } else if (codePoint < 0x200000) {
7739
+ } else if (codePoint < 0x110000) {
7646
7740
  if ((units -= 4) < 0) break
7647
7741
  bytes.push(
7648
7742
  codePoint >> 0x12 | 0xF0,
@@ -7695,14 +7789,6 @@ function blitBuffer (src, dst, offset, length) {
7695
7789
  return i
7696
7790
  }
7697
7791
 
7698
- function decodeUtf8Char (str) {
7699
- try {
7700
- return decodeURIComponent(str)
7701
- } catch (err) {
7702
- return String.fromCharCode(0xFFFD) // UTF 8 invalid char
7703
- }
7704
- }
7705
-
7706
7792
  },{"base64-js":44,"ieee754":45,"is-array":46}],44:[function(require,module,exports){
7707
7793
  var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
7708
7794
 
@@ -8363,7 +8449,9 @@ function drainQueue() {
8363
8449
  currentQueue = queue;
8364
8450
  queue = [];
8365
8451
  while (++queueIndex < len) {
8366
- currentQueue[queueIndex].run();
8452
+ if (currentQueue) {
8453
+ currentQueue[queueIndex].run();
8454
+ }
8367
8455
  }
8368
8456
  queueIndex = -1;
8369
8457
  len = queue.length;
@@ -8415,7 +8503,6 @@ process.binding = function (name) {
8415
8503
  throw new Error('process.binding is not supported');
8416
8504
  };
8417
8505
 
8418
- // TODO(shtylman)
8419
8506
  process.cwd = function () { return '/' };
8420
8507
  process.chdir = function (dir) {
8421
8508
  throw new Error('process.chdir is not supported');
@@ -12163,986 +12250,6 @@ function growl(msg, options, fn) {
12163
12250
 
12164
12251
  }).call(this,require('_process'))
12165
12252
  },{"_process":51,"child_process":41,"fs":41,"os":50,"path":41}],70:[function(require,module,exports){
12166
- /**
12167
- * lodash 3.1.1 (Custom Build) <https://lodash.com/>
12168
- * Build: `lodash modern modularize exports="npm" -o ./`
12169
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12170
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12171
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12172
- * Available under MIT license <https://lodash.com/license>
12173
- */
12174
- var baseAssign = require('lodash._baseassign'),
12175
- baseCreate = require('lodash._basecreate'),
12176
- isIterateeCall = require('lodash._isiterateecall');
12177
-
12178
- /**
12179
- * Creates an object that inherits from the given `prototype` object. If a
12180
- * `properties` object is provided its own enumerable properties are assigned
12181
- * to the created object.
12182
- *
12183
- * @static
12184
- * @memberOf _
12185
- * @category Object
12186
- * @param {Object} prototype The object to inherit from.
12187
- * @param {Object} [properties] The properties to assign to the object.
12188
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
12189
- * @returns {Object} Returns the new object.
12190
- * @example
12191
- *
12192
- * function Shape() {
12193
- * this.x = 0;
12194
- * this.y = 0;
12195
- * }
12196
- *
12197
- * function Circle() {
12198
- * Shape.call(this);
12199
- * }
12200
- *
12201
- * Circle.prototype = _.create(Shape.prototype, {
12202
- * 'constructor': Circle
12203
- * });
12204
- *
12205
- * var circle = new Circle;
12206
- * circle instanceof Circle;
12207
- * // => true
12208
- *
12209
- * circle instanceof Shape;
12210
- * // => true
12211
- */
12212
- function create(prototype, properties, guard) {
12213
- var result = baseCreate(prototype);
12214
- if (guard && isIterateeCall(prototype, properties, guard)) {
12215
- properties = undefined;
12216
- }
12217
- return properties ? baseAssign(result, properties) : result;
12218
- }
12219
-
12220
- module.exports = create;
12221
-
12222
- },{"lodash._baseassign":71,"lodash._basecreate":77,"lodash._isiterateecall":78}],71:[function(require,module,exports){
12223
- /**
12224
- * lodash 3.2.0 (Custom Build) <https://lodash.com/>
12225
- * Build: `lodash modern modularize exports="npm" -o ./`
12226
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12227
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12228
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12229
- * Available under MIT license <https://lodash.com/license>
12230
- */
12231
- var baseCopy = require('lodash._basecopy'),
12232
- keys = require('lodash.keys');
12233
-
12234
- /**
12235
- * The base implementation of `_.assign` without support for argument juggling,
12236
- * multiple sources, and `customizer` functions.
12237
- *
12238
- * @private
12239
- * @param {Object} object The destination object.
12240
- * @param {Object} source The source object.
12241
- * @returns {Object} Returns `object`.
12242
- */
12243
- function baseAssign(object, source) {
12244
- return source == null
12245
- ? object
12246
- : baseCopy(source, keys(source), object);
12247
- }
12248
-
12249
- module.exports = baseAssign;
12250
-
12251
- },{"lodash._basecopy":72,"lodash.keys":73}],72:[function(require,module,exports){
12252
- /**
12253
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
12254
- * Build: `lodash modern modularize exports="npm" -o ./`
12255
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12256
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12257
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12258
- * Available under MIT license <https://lodash.com/license>
12259
- */
12260
-
12261
- /**
12262
- * Copies properties of `source` to `object`.
12263
- *
12264
- * @private
12265
- * @param {Object} source The object to copy properties from.
12266
- * @param {Array} props The property names to copy.
12267
- * @param {Object} [object={}] The object to copy properties to.
12268
- * @returns {Object} Returns `object`.
12269
- */
12270
- function baseCopy(source, props, object) {
12271
- object || (object = {});
12272
-
12273
- var index = -1,
12274
- length = props.length;
12275
-
12276
- while (++index < length) {
12277
- var key = props[index];
12278
- object[key] = source[key];
12279
- }
12280
- return object;
12281
- }
12282
-
12283
- module.exports = baseCopy;
12284
-
12285
- },{}],73:[function(require,module,exports){
12286
- /**
12287
- * lodash 3.1.2 (Custom Build) <https://lodash.com/>
12288
- * Build: `lodash modern modularize exports="npm" -o ./`
12289
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12290
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12291
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12292
- * Available under MIT license <https://lodash.com/license>
12293
- */
12294
- var getNative = require('lodash._getnative'),
12295
- isArguments = require('lodash.isarguments'),
12296
- isArray = require('lodash.isarray');
12297
-
12298
- /** Used to detect unsigned integer values. */
12299
- var reIsUint = /^\d+$/;
12300
-
12301
- /** Used for native method references. */
12302
- var objectProto = Object.prototype;
12303
-
12304
- /** Used to check objects for own properties. */
12305
- var hasOwnProperty = objectProto.hasOwnProperty;
12306
-
12307
- /* Native method references for those with the same name as other `lodash` methods. */
12308
- var nativeKeys = getNative(Object, 'keys');
12309
-
12310
- /**
12311
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
12312
- * of an array-like value.
12313
- */
12314
- var MAX_SAFE_INTEGER = 9007199254740991;
12315
-
12316
- /**
12317
- * The base implementation of `_.property` without support for deep paths.
12318
- *
12319
- * @private
12320
- * @param {string} key The key of the property to get.
12321
- * @returns {Function} Returns the new function.
12322
- */
12323
- function baseProperty(key) {
12324
- return function(object) {
12325
- return object == null ? undefined : object[key];
12326
- };
12327
- }
12328
-
12329
- /**
12330
- * Gets the "length" property value of `object`.
12331
- *
12332
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
12333
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
12334
- *
12335
- * @private
12336
- * @param {Object} object The object to query.
12337
- * @returns {*} Returns the "length" value.
12338
- */
12339
- var getLength = baseProperty('length');
12340
-
12341
- /**
12342
- * Checks if `value` is array-like.
12343
- *
12344
- * @private
12345
- * @param {*} value The value to check.
12346
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
12347
- */
12348
- function isArrayLike(value) {
12349
- return value != null && isLength(getLength(value));
12350
- }
12351
-
12352
- /**
12353
- * Checks if `value` is a valid array-like index.
12354
- *
12355
- * @private
12356
- * @param {*} value The value to check.
12357
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
12358
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
12359
- */
12360
- function isIndex(value, length) {
12361
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
12362
- length = length == null ? MAX_SAFE_INTEGER : length;
12363
- return value > -1 && value % 1 == 0 && value < length;
12364
- }
12365
-
12366
- /**
12367
- * Checks if `value` is a valid array-like length.
12368
- *
12369
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
12370
- *
12371
- * @private
12372
- * @param {*} value The value to check.
12373
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12374
- */
12375
- function isLength(value) {
12376
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12377
- }
12378
-
12379
- /**
12380
- * A fallback implementation of `Object.keys` which creates an array of the
12381
- * own enumerable property names of `object`.
12382
- *
12383
- * @private
12384
- * @param {Object} object The object to query.
12385
- * @returns {Array} Returns the array of property names.
12386
- */
12387
- function shimKeys(object) {
12388
- var props = keysIn(object),
12389
- propsLength = props.length,
12390
- length = propsLength && object.length;
12391
-
12392
- var allowIndexes = !!length && isLength(length) &&
12393
- (isArray(object) || isArguments(object));
12394
-
12395
- var index = -1,
12396
- result = [];
12397
-
12398
- while (++index < propsLength) {
12399
- var key = props[index];
12400
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
12401
- result.push(key);
12402
- }
12403
- }
12404
- return result;
12405
- }
12406
-
12407
- /**
12408
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12409
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12410
- *
12411
- * @static
12412
- * @memberOf _
12413
- * @category Lang
12414
- * @param {*} value The value to check.
12415
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12416
- * @example
12417
- *
12418
- * _.isObject({});
12419
- * // => true
12420
- *
12421
- * _.isObject([1, 2, 3]);
12422
- * // => true
12423
- *
12424
- * _.isObject(1);
12425
- * // => false
12426
- */
12427
- function isObject(value) {
12428
- // Avoid a V8 JIT bug in Chrome 19-20.
12429
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
12430
- var type = typeof value;
12431
- return !!value && (type == 'object' || type == 'function');
12432
- }
12433
-
12434
- /**
12435
- * Creates an array of the own enumerable property names of `object`.
12436
- *
12437
- * **Note:** Non-object values are coerced to objects. See the
12438
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
12439
- * for more details.
12440
- *
12441
- * @static
12442
- * @memberOf _
12443
- * @category Object
12444
- * @param {Object} object The object to query.
12445
- * @returns {Array} Returns the array of property names.
12446
- * @example
12447
- *
12448
- * function Foo() {
12449
- * this.a = 1;
12450
- * this.b = 2;
12451
- * }
12452
- *
12453
- * Foo.prototype.c = 3;
12454
- *
12455
- * _.keys(new Foo);
12456
- * // => ['a', 'b'] (iteration order is not guaranteed)
12457
- *
12458
- * _.keys('hi');
12459
- * // => ['0', '1']
12460
- */
12461
- var keys = !nativeKeys ? shimKeys : function(object) {
12462
- var Ctor = object == null ? undefined : object.constructor;
12463
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
12464
- (typeof object != 'function' && isArrayLike(object))) {
12465
- return shimKeys(object);
12466
- }
12467
- return isObject(object) ? nativeKeys(object) : [];
12468
- };
12469
-
12470
- /**
12471
- * Creates an array of the own and inherited enumerable property names of `object`.
12472
- *
12473
- * **Note:** Non-object values are coerced to objects.
12474
- *
12475
- * @static
12476
- * @memberOf _
12477
- * @category Object
12478
- * @param {Object} object The object to query.
12479
- * @returns {Array} Returns the array of property names.
12480
- * @example
12481
- *
12482
- * function Foo() {
12483
- * this.a = 1;
12484
- * this.b = 2;
12485
- * }
12486
- *
12487
- * Foo.prototype.c = 3;
12488
- *
12489
- * _.keysIn(new Foo);
12490
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
12491
- */
12492
- function keysIn(object) {
12493
- if (object == null) {
12494
- return [];
12495
- }
12496
- if (!isObject(object)) {
12497
- object = Object(object);
12498
- }
12499
- var length = object.length;
12500
- length = (length && isLength(length) &&
12501
- (isArray(object) || isArguments(object)) && length) || 0;
12502
-
12503
- var Ctor = object.constructor,
12504
- index = -1,
12505
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
12506
- result = Array(length),
12507
- skipIndexes = length > 0;
12508
-
12509
- while (++index < length) {
12510
- result[index] = (index + '');
12511
- }
12512
- for (var key in object) {
12513
- if (!(skipIndexes && isIndex(key, length)) &&
12514
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
12515
- result.push(key);
12516
- }
12517
- }
12518
- return result;
12519
- }
12520
-
12521
- module.exports = keys;
12522
-
12523
- },{"lodash._getnative":74,"lodash.isarguments":75,"lodash.isarray":76}],74:[function(require,module,exports){
12524
- /**
12525
- * lodash 3.9.1 (Custom Build) <https://lodash.com/>
12526
- * Build: `lodash modern modularize exports="npm" -o ./`
12527
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12528
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12529
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12530
- * Available under MIT license <https://lodash.com/license>
12531
- */
12532
-
12533
- /** `Object#toString` result references. */
12534
- var funcTag = '[object Function]';
12535
-
12536
- /** Used to detect host constructors (Safari > 5). */
12537
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
12538
-
12539
- /**
12540
- * Checks if `value` is object-like.
12541
- *
12542
- * @private
12543
- * @param {*} value The value to check.
12544
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
12545
- */
12546
- function isObjectLike(value) {
12547
- return !!value && typeof value == 'object';
12548
- }
12549
-
12550
- /** Used for native method references. */
12551
- var objectProto = Object.prototype;
12552
-
12553
- /** Used to resolve the decompiled source of functions. */
12554
- var fnToString = Function.prototype.toString;
12555
-
12556
- /** Used to check objects for own properties. */
12557
- var hasOwnProperty = objectProto.hasOwnProperty;
12558
-
12559
- /**
12560
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
12561
- * of values.
12562
- */
12563
- var objToString = objectProto.toString;
12564
-
12565
- /** Used to detect if a method is native. */
12566
- var reIsNative = RegExp('^' +
12567
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
12568
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
12569
- );
12570
-
12571
- /**
12572
- * Gets the native function at `key` of `object`.
12573
- *
12574
- * @private
12575
- * @param {Object} object The object to query.
12576
- * @param {string} key The key of the method to get.
12577
- * @returns {*} Returns the function if it's native, else `undefined`.
12578
- */
12579
- function getNative(object, key) {
12580
- var value = object == null ? undefined : object[key];
12581
- return isNative(value) ? value : undefined;
12582
- }
12583
-
12584
- /**
12585
- * Checks if `value` is classified as a `Function` object.
12586
- *
12587
- * @static
12588
- * @memberOf _
12589
- * @category Lang
12590
- * @param {*} value The value to check.
12591
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
12592
- * @example
12593
- *
12594
- * _.isFunction(_);
12595
- * // => true
12596
- *
12597
- * _.isFunction(/abc/);
12598
- * // => false
12599
- */
12600
- function isFunction(value) {
12601
- // The use of `Object#toString` avoids issues with the `typeof` operator
12602
- // in older versions of Chrome and Safari which return 'function' for regexes
12603
- // and Safari 8 equivalents which return 'object' for typed array constructors.
12604
- return isObject(value) && objToString.call(value) == funcTag;
12605
- }
12606
-
12607
- /**
12608
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12609
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12610
- *
12611
- * @static
12612
- * @memberOf _
12613
- * @category Lang
12614
- * @param {*} value The value to check.
12615
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12616
- * @example
12617
- *
12618
- * _.isObject({});
12619
- * // => true
12620
- *
12621
- * _.isObject([1, 2, 3]);
12622
- * // => true
12623
- *
12624
- * _.isObject(1);
12625
- * // => false
12626
- */
12627
- function isObject(value) {
12628
- // Avoid a V8 JIT bug in Chrome 19-20.
12629
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
12630
- var type = typeof value;
12631
- return !!value && (type == 'object' || type == 'function');
12632
- }
12633
-
12634
- /**
12635
- * Checks if `value` is a native function.
12636
- *
12637
- * @static
12638
- * @memberOf _
12639
- * @category Lang
12640
- * @param {*} value The value to check.
12641
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
12642
- * @example
12643
- *
12644
- * _.isNative(Array.prototype.push);
12645
- * // => true
12646
- *
12647
- * _.isNative(_);
12648
- * // => false
12649
- */
12650
- function isNative(value) {
12651
- if (value == null) {
12652
- return false;
12653
- }
12654
- if (isFunction(value)) {
12655
- return reIsNative.test(fnToString.call(value));
12656
- }
12657
- return isObjectLike(value) && reIsHostCtor.test(value);
12658
- }
12659
-
12660
- module.exports = getNative;
12661
-
12662
- },{}],75:[function(require,module,exports){
12663
- /**
12664
- * lodash 3.0.4 (Custom Build) <https://lodash.com/>
12665
- * Build: `lodash modern modularize exports="npm" -o ./`
12666
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12667
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12668
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12669
- * Available under MIT license <https://lodash.com/license>
12670
- */
12671
-
12672
- /**
12673
- * Checks if `value` is object-like.
12674
- *
12675
- * @private
12676
- * @param {*} value The value to check.
12677
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
12678
- */
12679
- function isObjectLike(value) {
12680
- return !!value && typeof value == 'object';
12681
- }
12682
-
12683
- /** Used for native method references. */
12684
- var objectProto = Object.prototype;
12685
-
12686
- /** Used to check objects for own properties. */
12687
- var hasOwnProperty = objectProto.hasOwnProperty;
12688
-
12689
- /** Native method references. */
12690
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
12691
-
12692
- /**
12693
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
12694
- * of an array-like value.
12695
- */
12696
- var MAX_SAFE_INTEGER = 9007199254740991;
12697
-
12698
- /**
12699
- * The base implementation of `_.property` without support for deep paths.
12700
- *
12701
- * @private
12702
- * @param {string} key The key of the property to get.
12703
- * @returns {Function} Returns the new function.
12704
- */
12705
- function baseProperty(key) {
12706
- return function(object) {
12707
- return object == null ? undefined : object[key];
12708
- };
12709
- }
12710
-
12711
- /**
12712
- * Gets the "length" property value of `object`.
12713
- *
12714
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
12715
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
12716
- *
12717
- * @private
12718
- * @param {Object} object The object to query.
12719
- * @returns {*} Returns the "length" value.
12720
- */
12721
- var getLength = baseProperty('length');
12722
-
12723
- /**
12724
- * Checks if `value` is array-like.
12725
- *
12726
- * @private
12727
- * @param {*} value The value to check.
12728
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
12729
- */
12730
- function isArrayLike(value) {
12731
- return value != null && isLength(getLength(value));
12732
- }
12733
-
12734
- /**
12735
- * Checks if `value` is a valid array-like length.
12736
- *
12737
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
12738
- *
12739
- * @private
12740
- * @param {*} value The value to check.
12741
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12742
- */
12743
- function isLength(value) {
12744
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12745
- }
12746
-
12747
- /**
12748
- * Checks if `value` is classified as an `arguments` object.
12749
- *
12750
- * @static
12751
- * @memberOf _
12752
- * @category Lang
12753
- * @param {*} value The value to check.
12754
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
12755
- * @example
12756
- *
12757
- * _.isArguments(function() { return arguments; }());
12758
- * // => true
12759
- *
12760
- * _.isArguments([1, 2, 3]);
12761
- * // => false
12762
- */
12763
- function isArguments(value) {
12764
- return isObjectLike(value) && isArrayLike(value) &&
12765
- hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
12766
- }
12767
-
12768
- module.exports = isArguments;
12769
-
12770
- },{}],76:[function(require,module,exports){
12771
- /**
12772
- * lodash 3.0.4 (Custom Build) <https://lodash.com/>
12773
- * Build: `lodash modern modularize exports="npm" -o ./`
12774
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12775
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12776
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12777
- * Available under MIT license <https://lodash.com/license>
12778
- */
12779
-
12780
- /** `Object#toString` result references. */
12781
- var arrayTag = '[object Array]',
12782
- funcTag = '[object Function]';
12783
-
12784
- /** Used to detect host constructors (Safari > 5). */
12785
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
12786
-
12787
- /**
12788
- * Checks if `value` is object-like.
12789
- *
12790
- * @private
12791
- * @param {*} value The value to check.
12792
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
12793
- */
12794
- function isObjectLike(value) {
12795
- return !!value && typeof value == 'object';
12796
- }
12797
-
12798
- /** Used for native method references. */
12799
- var objectProto = Object.prototype;
12800
-
12801
- /** Used to resolve the decompiled source of functions. */
12802
- var fnToString = Function.prototype.toString;
12803
-
12804
- /** Used to check objects for own properties. */
12805
- var hasOwnProperty = objectProto.hasOwnProperty;
12806
-
12807
- /**
12808
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
12809
- * of values.
12810
- */
12811
- var objToString = objectProto.toString;
12812
-
12813
- /** Used to detect if a method is native. */
12814
- var reIsNative = RegExp('^' +
12815
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
12816
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
12817
- );
12818
-
12819
- /* Native method references for those with the same name as other `lodash` methods. */
12820
- var nativeIsArray = getNative(Array, 'isArray');
12821
-
12822
- /**
12823
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
12824
- * of an array-like value.
12825
- */
12826
- var MAX_SAFE_INTEGER = 9007199254740991;
12827
-
12828
- /**
12829
- * Gets the native function at `key` of `object`.
12830
- *
12831
- * @private
12832
- * @param {Object} object The object to query.
12833
- * @param {string} key The key of the method to get.
12834
- * @returns {*} Returns the function if it's native, else `undefined`.
12835
- */
12836
- function getNative(object, key) {
12837
- var value = object == null ? undefined : object[key];
12838
- return isNative(value) ? value : undefined;
12839
- }
12840
-
12841
- /**
12842
- * Checks if `value` is a valid array-like length.
12843
- *
12844
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
12845
- *
12846
- * @private
12847
- * @param {*} value The value to check.
12848
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12849
- */
12850
- function isLength(value) {
12851
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12852
- }
12853
-
12854
- /**
12855
- * Checks if `value` is classified as an `Array` object.
12856
- *
12857
- * @static
12858
- * @memberOf _
12859
- * @category Lang
12860
- * @param {*} value The value to check.
12861
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
12862
- * @example
12863
- *
12864
- * _.isArray([1, 2, 3]);
12865
- * // => true
12866
- *
12867
- * _.isArray(function() { return arguments; }());
12868
- * // => false
12869
- */
12870
- var isArray = nativeIsArray || function(value) {
12871
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
12872
- };
12873
-
12874
- /**
12875
- * Checks if `value` is classified as a `Function` object.
12876
- *
12877
- * @static
12878
- * @memberOf _
12879
- * @category Lang
12880
- * @param {*} value The value to check.
12881
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
12882
- * @example
12883
- *
12884
- * _.isFunction(_);
12885
- * // => true
12886
- *
12887
- * _.isFunction(/abc/);
12888
- * // => false
12889
- */
12890
- function isFunction(value) {
12891
- // The use of `Object#toString` avoids issues with the `typeof` operator
12892
- // in older versions of Chrome and Safari which return 'function' for regexes
12893
- // and Safari 8 equivalents which return 'object' for typed array constructors.
12894
- return isObject(value) && objToString.call(value) == funcTag;
12895
- }
12896
-
12897
- /**
12898
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12899
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12900
- *
12901
- * @static
12902
- * @memberOf _
12903
- * @category Lang
12904
- * @param {*} value The value to check.
12905
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12906
- * @example
12907
- *
12908
- * _.isObject({});
12909
- * // => true
12910
- *
12911
- * _.isObject([1, 2, 3]);
12912
- * // => true
12913
- *
12914
- * _.isObject(1);
12915
- * // => false
12916
- */
12917
- function isObject(value) {
12918
- // Avoid a V8 JIT bug in Chrome 19-20.
12919
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
12920
- var type = typeof value;
12921
- return !!value && (type == 'object' || type == 'function');
12922
- }
12923
-
12924
- /**
12925
- * Checks if `value` is a native function.
12926
- *
12927
- * @static
12928
- * @memberOf _
12929
- * @category Lang
12930
- * @param {*} value The value to check.
12931
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
12932
- * @example
12933
- *
12934
- * _.isNative(Array.prototype.push);
12935
- * // => true
12936
- *
12937
- * _.isNative(_);
12938
- * // => false
12939
- */
12940
- function isNative(value) {
12941
- if (value == null) {
12942
- return false;
12943
- }
12944
- if (isFunction(value)) {
12945
- return reIsNative.test(fnToString.call(value));
12946
- }
12947
- return isObjectLike(value) && reIsHostCtor.test(value);
12948
- }
12949
-
12950
- module.exports = isArray;
12951
-
12952
- },{}],77:[function(require,module,exports){
12953
- /**
12954
- * lodash 3.0.3 (Custom Build) <https://lodash.com/>
12955
- * Build: `lodash modern modularize exports="npm" -o ./`
12956
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12957
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12958
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12959
- * Available under MIT license <https://lodash.com/license>
12960
- */
12961
-
12962
- /**
12963
- * The base implementation of `_.create` without support for assigning
12964
- * properties to the created object.
12965
- *
12966
- * @private
12967
- * @param {Object} prototype The object to inherit from.
12968
- * @returns {Object} Returns the new object.
12969
- */
12970
- var baseCreate = (function() {
12971
- function object() {}
12972
- return function(prototype) {
12973
- if (isObject(prototype)) {
12974
- object.prototype = prototype;
12975
- var result = new object;
12976
- object.prototype = undefined;
12977
- }
12978
- return result || {};
12979
- };
12980
- }());
12981
-
12982
- /**
12983
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12984
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12985
- *
12986
- * @static
12987
- * @memberOf _
12988
- * @category Lang
12989
- * @param {*} value The value to check.
12990
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12991
- * @example
12992
- *
12993
- * _.isObject({});
12994
- * // => true
12995
- *
12996
- * _.isObject([1, 2, 3]);
12997
- * // => true
12998
- *
12999
- * _.isObject(1);
13000
- * // => false
13001
- */
13002
- function isObject(value) {
13003
- // Avoid a V8 JIT bug in Chrome 19-20.
13004
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
13005
- var type = typeof value;
13006
- return !!value && (type == 'object' || type == 'function');
13007
- }
13008
-
13009
- module.exports = baseCreate;
13010
-
13011
- },{}],78:[function(require,module,exports){
13012
- /**
13013
- * lodash 3.0.9 (Custom Build) <https://lodash.com/>
13014
- * Build: `lodash modern modularize exports="npm" -o ./`
13015
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
13016
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13017
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13018
- * Available under MIT license <https://lodash.com/license>
13019
- */
13020
-
13021
- /** Used to detect unsigned integer values. */
13022
- var reIsUint = /^\d+$/;
13023
-
13024
- /**
13025
- * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
13026
- * of an array-like value.
13027
- */
13028
- var MAX_SAFE_INTEGER = 9007199254740991;
13029
-
13030
- /**
13031
- * The base implementation of `_.property` without support for deep paths.
13032
- *
13033
- * @private
13034
- * @param {string} key The key of the property to get.
13035
- * @returns {Function} Returns the new function.
13036
- */
13037
- function baseProperty(key) {
13038
- return function(object) {
13039
- return object == null ? undefined : object[key];
13040
- };
13041
- }
13042
-
13043
- /**
13044
- * Gets the "length" property value of `object`.
13045
- *
13046
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
13047
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
13048
- *
13049
- * @private
13050
- * @param {Object} object The object to query.
13051
- * @returns {*} Returns the "length" value.
13052
- */
13053
- var getLength = baseProperty('length');
13054
-
13055
- /**
13056
- * Checks if `value` is array-like.
13057
- *
13058
- * @private
13059
- * @param {*} value The value to check.
13060
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
13061
- */
13062
- function isArrayLike(value) {
13063
- return value != null && isLength(getLength(value));
13064
- }
13065
-
13066
- /**
13067
- * Checks if `value` is a valid array-like index.
13068
- *
13069
- * @private
13070
- * @param {*} value The value to check.
13071
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
13072
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
13073
- */
13074
- function isIndex(value, length) {
13075
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
13076
- length = length == null ? MAX_SAFE_INTEGER : length;
13077
- return value > -1 && value % 1 == 0 && value < length;
13078
- }
13079
-
13080
- /**
13081
- * Checks if the provided arguments are from an iteratee call.
13082
- *
13083
- * @private
13084
- * @param {*} value The potential iteratee value argument.
13085
- * @param {*} index The potential iteratee index or key argument.
13086
- * @param {*} object The potential iteratee object argument.
13087
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
13088
- */
13089
- function isIterateeCall(value, index, object) {
13090
- if (!isObject(object)) {
13091
- return false;
13092
- }
13093
- var type = typeof index;
13094
- if (type == 'number'
13095
- ? (isArrayLike(object) && isIndex(index, object.length))
13096
- : (type == 'string' && index in object)) {
13097
- var other = object[index];
13098
- return value === value ? (value === other) : (other !== other);
13099
- }
13100
- return false;
13101
- }
13102
-
13103
- /**
13104
- * Checks if `value` is a valid array-like length.
13105
- *
13106
- * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
13107
- *
13108
- * @private
13109
- * @param {*} value The value to check.
13110
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
13111
- */
13112
- function isLength(value) {
13113
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
13114
- }
13115
-
13116
- /**
13117
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
13118
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
13119
- *
13120
- * @static
13121
- * @memberOf _
13122
- * @category Lang
13123
- * @param {*} value The value to check.
13124
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
13125
- * @example
13126
- *
13127
- * _.isObject({});
13128
- * // => true
13129
- *
13130
- * _.isObject([1, 2, 3]);
13131
- * // => true
13132
- *
13133
- * _.isObject(1);
13134
- * // => false
13135
- */
13136
- function isObject(value) {
13137
- // Avoid a V8 JIT bug in Chrome 19-20.
13138
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
13139
- var type = typeof value;
13140
- return !!value && (type == 'object' || type == 'function');
13141
- }
13142
-
13143
- module.exports = isIterateeCall;
13144
-
13145
- },{}],79:[function(require,module,exports){
13146
12253
  (function (process,global){
13147
12254
  /**
13148
12255
  * Shim process.stdout.
@@ -13307,4 +12414,4 @@ window.Mocha = Mocha;
13307
12414
  window.mocha = mocha;
13308
12415
 
13309
12416
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
13310
- },{"../":1,"_process":51,"browser-stdout":40}]},{},[79]);
12417
+ },{"../":1,"_process":51,"browser-stdout":40}]},{},[70]);