mocha 3.4.2 → 3.5.0

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
@@ -189,7 +189,7 @@ global.mocha = mocha;
189
189
  module.exports = global;
190
190
 
191
191
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
192
- },{"./lib/mocha":14,"_process":82,"browser-stdout":41}],2:[function(require,module,exports){
192
+ },{"./lib/mocha":14,"_process":81,"browser-stdout":41}],2:[function(require,module,exports){
193
193
  'use strict';
194
194
 
195
195
  function noop () {}
@@ -647,7 +647,7 @@ Context.prototype.inspect = function () {
647
647
  }, 2);
648
648
  };
649
649
 
650
- },{"json3":69}],7:[function(require,module,exports){
650
+ },{"json3":68}],7:[function(require,module,exports){
651
651
  'use strict';
652
652
 
653
653
  /**
@@ -1743,6 +1743,24 @@ Mocha.prototype.delay = function delay () {
1743
1743
  return this;
1744
1744
  };
1745
1745
 
1746
+ /**
1747
+ * Tests marked only fail the suite
1748
+ * @returns {Mocha}
1749
+ */
1750
+ Mocha.prototype.forbidOnly = function () {
1751
+ this.options.forbidOnly = true;
1752
+ return this;
1753
+ };
1754
+
1755
+ /**
1756
+ * Pending tests and tests marked skip fail the suite
1757
+ * @returns {Mocha}
1758
+ */
1759
+ Mocha.prototype.forbidPending = function () {
1760
+ this.options.forbidPending = true;
1761
+ return this;
1762
+ };
1763
+
1746
1764
  /**
1747
1765
  * Run tests and invoke `fn()` when complete.
1748
1766
  *
@@ -1764,6 +1782,8 @@ Mocha.prototype.run = function (fn) {
1764
1782
  runner.hasOnly = options.hasOnly;
1765
1783
  runner.asyncOnly = options.asyncOnly;
1766
1784
  runner.allowUncaught = options.allowUncaught;
1785
+ runner.forbidOnly = options.forbidOnly;
1786
+ runner.forbidPending = options.forbidPending;
1767
1787
  if (options.grep) {
1768
1788
  runner.grep(options.grep, options.invert);
1769
1789
  }
@@ -1790,7 +1810,7 @@ Mocha.prototype.run = function (fn) {
1790
1810
  };
1791
1811
 
1792
1812
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},"/lib")
1793
- },{"./context":6,"./hook":7,"./interfaces":11,"./reporters":21,"./runnable":33,"./runner":34,"./suite":35,"./test":36,"./utils":38,"_process":82,"escape-string-regexp":62,"growl":64,"path":42}],15:[function(require,module,exports){
1813
+ },{"./context":6,"./hook":7,"./interfaces":11,"./reporters":21,"./runnable":33,"./runner":34,"./suite":35,"./test":36,"./utils":38,"_process":81,"escape-string-regexp":61,"growl":63,"path":42}],15:[function(require,module,exports){
1794
1814
  'use strict';
1795
1815
 
1796
1816
  /**
@@ -2435,7 +2455,7 @@ function sameType (a, b) {
2435
2455
  }
2436
2456
 
2437
2457
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2438
- },{"../ms":15,"../utils":38,"_process":82,"diff":56,"supports-color":42,"tty":5}],18:[function(require,module,exports){
2458
+ },{"../ms":15,"../utils":38,"_process":81,"diff":55,"supports-color":42,"tty":5}],18:[function(require,module,exports){
2439
2459
  'use strict';
2440
2460
 
2441
2461
  /**
@@ -2573,7 +2593,7 @@ function Dot (runner) {
2573
2593
  inherits(Dot, Base);
2574
2594
 
2575
2595
  }).call(this,require('_process'))
2576
- },{"../utils":38,"./base":17,"_process":82}],20:[function(require,module,exports){
2596
+ },{"../utils":38,"./base":17,"_process":81}],20:[function(require,module,exports){
2577
2597
  (function (global){
2578
2598
  'use strict';
2579
2599
 
@@ -2925,7 +2945,7 @@ function on (el, event, fn) {
2925
2945
  }
2926
2946
 
2927
2947
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2928
- },{"../browser/progress":4,"../utils":38,"./base":17,"escape-string-regexp":62}],21:[function(require,module,exports){
2948
+ },{"../browser/progress":4,"../utils":38,"./base":17,"escape-string-regexp":61}],21:[function(require,module,exports){
2929
2949
  'use strict';
2930
2950
 
2931
2951
  // Alias exports to a their normalized format Mocha#reporter to prevent a need
@@ -3013,7 +3033,7 @@ function clean (test) {
3013
3033
  }
3014
3034
 
3015
3035
  }).call(this,require('_process'))
3016
- },{"./base":17,"_process":82,"json3":69}],23:[function(require,module,exports){
3036
+ },{"./base":17,"_process":81,"json3":68}],23:[function(require,module,exports){
3017
3037
  (function (process){
3018
3038
  'use strict';
3019
3039
 
@@ -3109,7 +3129,7 @@ function errorJSON (err) {
3109
3129
  }
3110
3130
 
3111
3131
  }).call(this,require('_process'))
3112
- },{"./base":17,"_process":82}],24:[function(require,module,exports){
3132
+ },{"./base":17,"_process":81}],24:[function(require,module,exports){
3113
3133
  (function (process){
3114
3134
  'use strict';
3115
3135
 
@@ -3207,7 +3227,7 @@ function Landing (runner) {
3207
3227
  inherits(Landing, Base);
3208
3228
 
3209
3229
  }).call(this,require('_process'))
3210
- },{"../utils":38,"./base":17,"_process":82}],25:[function(require,module,exports){
3230
+ },{"../utils":38,"./base":17,"_process":81}],25:[function(require,module,exports){
3211
3231
  (function (process){
3212
3232
  'use strict';
3213
3233
 
@@ -3274,7 +3294,7 @@ function List (runner) {
3274
3294
  inherits(List, Base);
3275
3295
 
3276
3296
  }).call(this,require('_process'))
3277
- },{"../utils":38,"./base":17,"_process":82}],26:[function(require,module,exports){
3297
+ },{"../utils":38,"./base":17,"_process":81}],26:[function(require,module,exports){
3278
3298
  (function (process){
3279
3299
  'use strict';
3280
3300
 
@@ -3377,7 +3397,7 @@ function Markdown (runner) {
3377
3397
  }
3378
3398
 
3379
3399
  }).call(this,require('_process'))
3380
- },{"../utils":38,"./base":17,"_process":82}],27:[function(require,module,exports){
3400
+ },{"../utils":38,"./base":17,"_process":81}],27:[function(require,module,exports){
3381
3401
  (function (process){
3382
3402
  'use strict';
3383
3403
 
@@ -3419,7 +3439,7 @@ function Min (runner) {
3419
3439
  inherits(Min, Base);
3420
3440
 
3421
3441
  }).call(this,require('_process'))
3422
- },{"../utils":38,"./base":17,"_process":82}],28:[function(require,module,exports){
3442
+ },{"../utils":38,"./base":17,"_process":81}],28:[function(require,module,exports){
3423
3443
  (function (process){
3424
3444
  'use strict';
3425
3445
 
@@ -3686,7 +3706,7 @@ function write (string) {
3686
3706
  }
3687
3707
 
3688
3708
  }).call(this,require('_process'))
3689
- },{"../utils":38,"./base":17,"_process":82}],29:[function(require,module,exports){
3709
+ },{"../utils":38,"./base":17,"_process":81}],29:[function(require,module,exports){
3690
3710
  (function (process){
3691
3711
  'use strict';
3692
3712
 
@@ -3781,7 +3801,7 @@ function Progress (runner, options) {
3781
3801
  inherits(Progress, Base);
3782
3802
 
3783
3803
  }).call(this,require('_process'))
3784
- },{"../utils":38,"./base":17,"_process":82}],30:[function(require,module,exports){
3804
+ },{"../utils":38,"./base":17,"_process":81}],30:[function(require,module,exports){
3785
3805
  'use strict';
3786
3806
 
3787
3807
  /**
@@ -4108,7 +4128,7 @@ function tag (name, attrs, close, content) {
4108
4128
  }
4109
4129
 
4110
4130
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4111
- },{"../utils":38,"./base":17,"_process":82,"fs":42,"mkdirp":79,"path":42}],33:[function(require,module,exports){
4131
+ },{"../utils":38,"./base":17,"_process":81,"fs":42,"mkdirp":78,"path":42}],33:[function(require,module,exports){
4112
4132
  (function (global){
4113
4133
  'use strict';
4114
4134
 
@@ -4501,7 +4521,7 @@ Runnable.prototype.run = function (fn) {
4501
4521
  };
4502
4522
 
4503
4523
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4504
- },{"./ms":15,"./pending":16,"./utils":38,"debug":2,"events":3,"json3":69,"lodash.create":75}],34:[function(require,module,exports){
4524
+ },{"./ms":15,"./pending":16,"./utils":38,"debug":2,"events":3,"json3":68,"lodash.create":69}],34:[function(require,module,exports){
4505
4525
  (function (process,global){
4506
4526
  'use strict';
4507
4527
 
@@ -5325,6 +5345,12 @@ Runner.prototype.run = function (fn) {
5325
5345
 
5326
5346
  // callback
5327
5347
  this.on('end', function () {
5348
+ if (self.forbidOnly && self.hasOnly) {
5349
+ self.failures += self.stats.tests;
5350
+ }
5351
+ if (self.forbidPending) {
5352
+ self.failures += self.stats.pending;
5353
+ }
5328
5354
  debug('end');
5329
5355
  process.removeListener('uncaughtException', uncaught);
5330
5356
  fn(self.failures);
@@ -5467,7 +5493,7 @@ function extraGlobals () {
5467
5493
  }
5468
5494
 
5469
5495
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5470
- },{"./pending":16,"./runnable":33,"./utils":38,"_process":82,"debug":2,"events":3}],35:[function(require,module,exports){
5496
+ },{"./pending":16,"./runnable":33,"./utils":38,"_process":81,"debug":2,"events":3}],35:[function(require,module,exports){
5471
5497
  'use strict';
5472
5498
 
5473
5499
  /**
@@ -5925,7 +5951,7 @@ Test.prototype.clone = function () {
5925
5951
  return test;
5926
5952
  };
5927
5953
 
5928
- },{"./runnable":33,"./utils":38,"lodash.create":75}],37:[function(require,module,exports){
5954
+ },{"./runnable":33,"./utils":38,"lodash.create":69}],37:[function(require,module,exports){
5929
5955
  'use strict';
5930
5956
 
5931
5957
  /**
@@ -6775,7 +6801,7 @@ exports.isPromise = function isPromise (value) {
6775
6801
  exports.noop = function () {};
6776
6802
 
6777
6803
  }).call(this,require('_process'),require("buffer").Buffer)
6778
- },{"./to-iso-string":37,"_process":82,"buffer":44,"debug":2,"fs":42,"glob":42,"json3":69,"path":42,"util":99}],39:[function(require,module,exports){
6804
+ },{"./to-iso-string":37,"_process":81,"buffer":43,"debug":2,"fs":42,"glob":42,"json3":68,"path":42,"util":101}],39:[function(require,module,exports){
6779
6805
  'use strict'
6780
6806
 
6781
6807
  exports.byteLength = byteLength
@@ -6811,22 +6837,22 @@ function placeHoldersCount (b64) {
6811
6837
 
6812
6838
  function byteLength (b64) {
6813
6839
  // base64 is 4/3 + up to two characters of the original data
6814
- return b64.length * 3 / 4 - placeHoldersCount(b64)
6840
+ return (b64.length * 3 / 4) - placeHoldersCount(b64)
6815
6841
  }
6816
6842
 
6817
6843
  function toByteArray (b64) {
6818
- var i, j, l, tmp, placeHolders, arr
6844
+ var i, l, tmp, placeHolders, arr
6819
6845
  var len = b64.length
6820
6846
  placeHolders = placeHoldersCount(b64)
6821
6847
 
6822
- arr = new Arr(len * 3 / 4 - placeHolders)
6848
+ arr = new Arr((len * 3 / 4) - placeHolders)
6823
6849
 
6824
6850
  // if there are placeholders, only get up to the last complete 4 chars
6825
6851
  l = placeHolders > 0 ? len - 4 : len
6826
6852
 
6827
6853
  var L = 0
6828
6854
 
6829
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
6855
+ for (i = 0; i < l; i += 4) {
6830
6856
  tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
6831
6857
  arr[L++] = (tmp >> 16) & 0xFF
6832
6858
  arr[L++] = (tmp >> 8) & 0xFF
@@ -6922,122 +6948,10 @@ BrowserStdout.prototype._write = function(chunks, encoding, cb) {
6922
6948
  }
6923
6949
 
6924
6950
  }).call(this,require('_process'))
6925
- },{"_process":82,"stream":94,"util":99}],42:[function(require,module,exports){
6951
+ },{"_process":81,"stream":95,"util":101}],42:[function(require,module,exports){
6926
6952
  arguments[4][40][0].apply(exports,arguments)
6927
6953
  },{"dup":40}],43:[function(require,module,exports){
6928
6954
  (function (global){
6929
- 'use strict';
6930
-
6931
- var buffer = require('buffer');
6932
- var Buffer = buffer.Buffer;
6933
- var SlowBuffer = buffer.SlowBuffer;
6934
- var MAX_LEN = buffer.kMaxLength || 2147483647;
6935
- exports.alloc = function alloc(size, fill, encoding) {
6936
- if (typeof Buffer.alloc === 'function') {
6937
- return Buffer.alloc(size, fill, encoding);
6938
- }
6939
- if (typeof encoding === 'number') {
6940
- throw new TypeError('encoding must not be number');
6941
- }
6942
- if (typeof size !== 'number') {
6943
- throw new TypeError('size must be a number');
6944
- }
6945
- if (size > MAX_LEN) {
6946
- throw new RangeError('size is too large');
6947
- }
6948
- var enc = encoding;
6949
- var _fill = fill;
6950
- if (_fill === undefined) {
6951
- enc = undefined;
6952
- _fill = 0;
6953
- }
6954
- var buf = new Buffer(size);
6955
- if (typeof _fill === 'string') {
6956
- var fillBuf = new Buffer(_fill, enc);
6957
- var flen = fillBuf.length;
6958
- var i = -1;
6959
- while (++i < size) {
6960
- buf[i] = fillBuf[i % flen];
6961
- }
6962
- } else {
6963
- buf.fill(_fill);
6964
- }
6965
- return buf;
6966
- }
6967
- exports.allocUnsafe = function allocUnsafe(size) {
6968
- if (typeof Buffer.allocUnsafe === 'function') {
6969
- return Buffer.allocUnsafe(size);
6970
- }
6971
- if (typeof size !== 'number') {
6972
- throw new TypeError('size must be a number');
6973
- }
6974
- if (size > MAX_LEN) {
6975
- throw new RangeError('size is too large');
6976
- }
6977
- return new Buffer(size);
6978
- }
6979
- exports.from = function from(value, encodingOrOffset, length) {
6980
- if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
6981
- return Buffer.from(value, encodingOrOffset, length);
6982
- }
6983
- if (typeof value === 'number') {
6984
- throw new TypeError('"value" argument must not be a number');
6985
- }
6986
- if (typeof value === 'string') {
6987
- return new Buffer(value, encodingOrOffset);
6988
- }
6989
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
6990
- var offset = encodingOrOffset;
6991
- if (arguments.length === 1) {
6992
- return new Buffer(value);
6993
- }
6994
- if (typeof offset === 'undefined') {
6995
- offset = 0;
6996
- }
6997
- var len = length;
6998
- if (typeof len === 'undefined') {
6999
- len = value.byteLength - offset;
7000
- }
7001
- if (offset >= value.byteLength) {
7002
- throw new RangeError('\'offset\' is out of bounds');
7003
- }
7004
- if (len > value.byteLength - offset) {
7005
- throw new RangeError('\'length\' is out of bounds');
7006
- }
7007
- return new Buffer(value.slice(offset, offset + len));
7008
- }
7009
- if (Buffer.isBuffer(value)) {
7010
- var out = new Buffer(value.length);
7011
- value.copy(out, 0, 0, value.length);
7012
- return out;
7013
- }
7014
- if (value) {
7015
- if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
7016
- return new Buffer(value);
7017
- }
7018
- if (value.type === 'Buffer' && Array.isArray(value.data)) {
7019
- return new Buffer(value.data);
7020
- }
7021
- }
7022
-
7023
- throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
7024
- }
7025
- exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
7026
- if (typeof Buffer.allocUnsafeSlow === 'function') {
7027
- return Buffer.allocUnsafeSlow(size);
7028
- }
7029
- if (typeof size !== 'number') {
7030
- throw new TypeError('size must be a number');
7031
- }
7032
- if (size >= MAX_LEN) {
7033
- throw new RangeError('size is too large');
7034
- }
7035
- return new SlowBuffer(size);
7036
- }
7037
-
7038
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7039
- },{"buffer":44}],44:[function(require,module,exports){
7040
- (function (global){
7041
6955
  /*!
7042
6956
  * The buffer module from node.js, for the browser.
7043
6957
  *
@@ -8829,7 +8743,7 @@ function isnan (val) {
8829
8743
  }
8830
8744
 
8831
8745
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
8832
- },{"base64-js":39,"ieee754":65,"isarray":68}],45:[function(require,module,exports){
8746
+ },{"base64-js":39,"ieee754":64,"isarray":67}],44:[function(require,module,exports){
8833
8747
  (function (Buffer){
8834
8748
  // Copyright Joyent, Inc. and other Node contributors.
8835
8749
  //
@@ -8940,7 +8854,7 @@ function objectToString(o) {
8940
8854
  }
8941
8855
 
8942
8856
  }).call(this,{"isBuffer":require("../../is-buffer/index.js")})
8943
- },{"../../is-buffer/index.js":67}],46:[function(require,module,exports){
8857
+ },{"../../is-buffer/index.js":66}],45:[function(require,module,exports){
8944
8858
  /*istanbul ignore start*/"use strict";
8945
8859
 
8946
8860
  exports.__esModule = true;
@@ -8966,7 +8880,7 @@ function convertChangesToDMP(changes) {
8966
8880
  }
8967
8881
 
8968
8882
 
8969
- },{}],47:[function(require,module,exports){
8883
+ },{}],46:[function(require,module,exports){
8970
8884
  /*istanbul ignore start*/'use strict';
8971
8885
 
8972
8886
  exports.__esModule = true;
@@ -9003,7 +8917,7 @@ function escapeHTML(s) {
9003
8917
  }
9004
8918
 
9005
8919
 
9006
- },{}],48:[function(require,module,exports){
8920
+ },{}],47:[function(require,module,exports){
9007
8921
  /*istanbul ignore start*/'use strict';
9008
8922
 
9009
8923
  exports.__esModule = true;
@@ -9027,7 +8941,7 @@ function diffArrays(oldArr, newArr, callback) {
9027
8941
  }
9028
8942
 
9029
8943
 
9030
- },{"./base":49}],49:[function(require,module,exports){
8944
+ },{"./base":48}],48:[function(require,module,exports){
9031
8945
  /*istanbul ignore start*/'use strict';
9032
8946
 
9033
8947
  exports.__esModule = true;
@@ -9259,7 +9173,7 @@ function clonePath(path) {
9259
9173
  }
9260
9174
 
9261
9175
 
9262
- },{}],50:[function(require,module,exports){
9176
+ },{}],49:[function(require,module,exports){
9263
9177
  /*istanbul ignore start*/'use strict';
9264
9178
 
9265
9179
  exports.__esModule = true;
@@ -9279,7 +9193,7 @@ function diffChars(oldStr, newStr, callback) {
9279
9193
  }
9280
9194
 
9281
9195
 
9282
- },{"./base":49}],51:[function(require,module,exports){
9196
+ },{"./base":48}],50:[function(require,module,exports){
9283
9197
  /*istanbul ignore start*/'use strict';
9284
9198
 
9285
9199
  exports.__esModule = true;
@@ -9303,7 +9217,7 @@ function diffCss(oldStr, newStr, callback) {
9303
9217
  }
9304
9218
 
9305
9219
 
9306
- },{"./base":49}],52:[function(require,module,exports){
9220
+ },{"./base":48}],51:[function(require,module,exports){
9307
9221
  /*istanbul ignore start*/'use strict';
9308
9222
 
9309
9223
  exports.__esModule = true;
@@ -9414,7 +9328,7 @@ function canonicalize(obj, stack, replacementStack) {
9414
9328
  }
9415
9329
 
9416
9330
 
9417
- },{"./base":49,"./line":53}],53:[function(require,module,exports){
9331
+ },{"./base":48,"./line":52}],52:[function(require,module,exports){
9418
9332
  /*istanbul ignore start*/'use strict';
9419
9333
 
9420
9334
  exports.__esModule = true;
@@ -9469,7 +9383,7 @@ function diffTrimmedLines(oldStr, newStr, callback) {
9469
9383
  }
9470
9384
 
9471
9385
 
9472
- },{"../util/params":61,"./base":49}],54:[function(require,module,exports){
9386
+ },{"../util/params":60,"./base":48}],53:[function(require,module,exports){
9473
9387
  /*istanbul ignore start*/'use strict';
9474
9388
 
9475
9389
  exports.__esModule = true;
@@ -9493,7 +9407,7 @@ function diffSentences(oldStr, newStr, callback) {
9493
9407
  }
9494
9408
 
9495
9409
 
9496
- },{"./base":49}],55:[function(require,module,exports){
9410
+ },{"./base":48}],54:[function(require,module,exports){
9497
9411
  /*istanbul ignore start*/'use strict';
9498
9412
 
9499
9413
  exports.__esModule = true;
@@ -9565,7 +9479,7 @@ function diffWordsWithSpace(oldStr, newStr, callback) {
9565
9479
  }
9566
9480
 
9567
9481
 
9568
- },{"../util/params":61,"./base":49}],56:[function(require,module,exports){
9482
+ },{"../util/params":60,"./base":48}],55:[function(require,module,exports){
9569
9483
  /*istanbul ignore start*/'use strict';
9570
9484
 
9571
9485
  exports.__esModule = true;
@@ -9640,7 +9554,7 @@ exports. /*istanbul ignore end*/Diff = _base2['default'];
9640
9554
  */
9641
9555
 
9642
9556
 
9643
- },{"./convert/dmp":46,"./convert/xml":47,"./diff/array":48,"./diff/base":49,"./diff/character":50,"./diff/css":51,"./diff/json":52,"./diff/line":53,"./diff/sentence":54,"./diff/word":55,"./patch/apply":57,"./patch/create":58,"./patch/parse":59}],57:[function(require,module,exports){
9557
+ },{"./convert/dmp":45,"./convert/xml":46,"./diff/array":47,"./diff/base":48,"./diff/character":49,"./diff/css":50,"./diff/json":51,"./diff/line":52,"./diff/sentence":53,"./diff/word":54,"./patch/apply":56,"./patch/create":57,"./patch/parse":58}],56:[function(require,module,exports){
9644
9558
  /*istanbul ignore start*/'use strict';
9645
9559
 
9646
9560
  exports.__esModule = true;
@@ -9819,7 +9733,7 @@ function applyPatches(uniDiff, options) {
9819
9733
  }
9820
9734
 
9821
9735
 
9822
- },{"../util/distance-iterator":60,"./parse":59}],58:[function(require,module,exports){
9736
+ },{"../util/distance-iterator":59,"./parse":58}],57:[function(require,module,exports){
9823
9737
  /*istanbul ignore start*/'use strict';
9824
9738
 
9825
9739
  exports.__esModule = true;
@@ -9977,7 +9891,7 @@ function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
9977
9891
  }
9978
9892
 
9979
9893
 
9980
- },{"../diff/line":53}],59:[function(require,module,exports){
9894
+ },{"../diff/line":52}],58:[function(require,module,exports){
9981
9895
  /*istanbul ignore start*/'use strict';
9982
9896
 
9983
9897
  exports.__esModule = true;
@@ -10122,7 +10036,7 @@ function parsePatch(uniDiff) {
10122
10036
  }
10123
10037
 
10124
10038
 
10125
- },{}],60:[function(require,module,exports){
10039
+ },{}],59:[function(require,module,exports){
10126
10040
  /*istanbul ignore start*/"use strict";
10127
10041
 
10128
10042
  exports.__esModule = true;
@@ -10171,7 +10085,7 @@ exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) {
10171
10085
  };
10172
10086
 
10173
10087
 
10174
- },{}],61:[function(require,module,exports){
10088
+ },{}],60:[function(require,module,exports){
10175
10089
  /*istanbul ignore start*/'use strict';
10176
10090
 
10177
10091
  exports.__esModule = true;
@@ -10191,7 +10105,7 @@ function generateOptions(options, defaults) {
10191
10105
  }
10192
10106
 
10193
10107
 
10194
- },{}],62:[function(require,module,exports){
10108
+ },{}],61:[function(require,module,exports){
10195
10109
  'use strict';
10196
10110
 
10197
10111
  var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
@@ -10204,7 +10118,7 @@ module.exports = function (str) {
10204
10118
  return str.replace(matchOperatorsRe, '\\$&');
10205
10119
  };
10206
10120
 
10207
- },{}],63:[function(require,module,exports){
10121
+ },{}],62:[function(require,module,exports){
10208
10122
  // Copyright Joyent, Inc. and other Node contributors.
10209
10123
  //
10210
10124
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -10508,7 +10422,7 @@ function isUndefined(arg) {
10508
10422
  return arg === void 0;
10509
10423
  }
10510
10424
 
10511
- },{}],64:[function(require,module,exports){
10425
+ },{}],63:[function(require,module,exports){
10512
10426
  (function (process){
10513
10427
  // Growl - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
10514
10428
 
@@ -10802,7 +10716,7 @@ function growl(msg, options, fn) {
10802
10716
  };
10803
10717
 
10804
10718
  }).call(this,require('_process'))
10805
- },{"_process":82,"child_process":42,"fs":42,"os":80,"path":42}],65:[function(require,module,exports){
10719
+ },{"_process":81,"child_process":42,"fs":42,"os":79,"path":42}],64:[function(require,module,exports){
10806
10720
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
10807
10721
  var e, m
10808
10722
  var eLen = nBytes * 8 - mLen - 1
@@ -10888,7 +10802,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
10888
10802
  buffer[offset + i - d] |= s * 128
10889
10803
  }
10890
10804
 
10891
- },{}],66:[function(require,module,exports){
10805
+ },{}],65:[function(require,module,exports){
10892
10806
  if (typeof Object.create === 'function') {
10893
10807
  // implementation from standard node.js 'util' module
10894
10808
  module.exports = function inherits(ctor, superCtor) {
@@ -10913,7 +10827,7 @@ if (typeof Object.create === 'function') {
10913
10827
  }
10914
10828
  }
10915
10829
 
10916
- },{}],67:[function(require,module,exports){
10830
+ },{}],66:[function(require,module,exports){
10917
10831
  /*!
10918
10832
  * Determine if an object is a Buffer
10919
10833
  *
@@ -10936,14 +10850,14 @@ function isSlowBuffer (obj) {
10936
10850
  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
10937
10851
  }
10938
10852
 
10939
- },{}],68:[function(require,module,exports){
10853
+ },{}],67:[function(require,module,exports){
10940
10854
  var toString = {}.toString;
10941
10855
 
10942
10856
  module.exports = Array.isArray || function (arr) {
10943
10857
  return toString.call(arr) == '[object Array]';
10944
10858
  };
10945
10859
 
10946
- },{}],69:[function(require,module,exports){
10860
+ },{}],68:[function(require,module,exports){
10947
10861
  (function (global){
10948
10862
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
10949
10863
  ;(function () {
@@ -11849,7 +11763,64 @@ module.exports = Array.isArray || function (arr) {
11849
11763
  }).call(this);
11850
11764
 
11851
11765
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
11852
- },{}],70:[function(require,module,exports){
11766
+ },{}],69:[function(require,module,exports){
11767
+ /**
11768
+ * lodash 3.1.1 (Custom Build) <https://lodash.com/>
11769
+ * Build: `lodash modern modularize exports="npm" -o ./`
11770
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
11771
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
11772
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
11773
+ * Available under MIT license <https://lodash.com/license>
11774
+ */
11775
+ var baseAssign = require('lodash._baseassign'),
11776
+ baseCreate = require('lodash._basecreate'),
11777
+ isIterateeCall = require('lodash._isiterateecall');
11778
+
11779
+ /**
11780
+ * Creates an object that inherits from the given `prototype` object. If a
11781
+ * `properties` object is provided its own enumerable properties are assigned
11782
+ * to the created object.
11783
+ *
11784
+ * @static
11785
+ * @memberOf _
11786
+ * @category Object
11787
+ * @param {Object} prototype The object to inherit from.
11788
+ * @param {Object} [properties] The properties to assign to the object.
11789
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
11790
+ * @returns {Object} Returns the new object.
11791
+ * @example
11792
+ *
11793
+ * function Shape() {
11794
+ * this.x = 0;
11795
+ * this.y = 0;
11796
+ * }
11797
+ *
11798
+ * function Circle() {
11799
+ * Shape.call(this);
11800
+ * }
11801
+ *
11802
+ * Circle.prototype = _.create(Shape.prototype, {
11803
+ * 'constructor': Circle
11804
+ * });
11805
+ *
11806
+ * var circle = new Circle;
11807
+ * circle instanceof Circle;
11808
+ * // => true
11809
+ *
11810
+ * circle instanceof Shape;
11811
+ * // => true
11812
+ */
11813
+ function create(prototype, properties, guard) {
11814
+ var result = baseCreate(prototype);
11815
+ if (guard && isIterateeCall(prototype, properties, guard)) {
11816
+ properties = undefined;
11817
+ }
11818
+ return properties ? baseAssign(result, properties) : result;
11819
+ }
11820
+
11821
+ module.exports = create;
11822
+
11823
+ },{"lodash._baseassign":70,"lodash._basecreate":76,"lodash._isiterateecall":77}],70:[function(require,module,exports){
11853
11824
  /**
11854
11825
  * lodash 3.2.0 (Custom Build) <https://lodash.com/>
11855
11826
  * Build: `lodash modern modularize exports="npm" -o ./`
@@ -11878,7 +11849,7 @@ function baseAssign(object, source) {
11878
11849
 
11879
11850
  module.exports = baseAssign;
11880
11851
 
11881
- },{"lodash._basecopy":71,"lodash.keys":78}],71:[function(require,module,exports){
11852
+ },{"lodash._basecopy":71,"lodash.keys":72}],71:[function(require,module,exports){
11882
11853
  /**
11883
11854
  * lodash 3.0.1 (Custom Build) <https://lodash.com/>
11884
11855
  * Build: `lodash modern modularize exports="npm" -o ./`
@@ -11914,33 +11885,125 @@ module.exports = baseCopy;
11914
11885
 
11915
11886
  },{}],72:[function(require,module,exports){
11916
11887
  /**
11917
- * lodash 3.0.3 (Custom Build) <https://lodash.com/>
11888
+ * lodash 3.1.2 (Custom Build) <https://lodash.com/>
11918
11889
  * Build: `lodash modern modularize exports="npm" -o ./`
11919
11890
  * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
11920
11891
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
11921
11892
  * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
11922
11893
  * Available under MIT license <https://lodash.com/license>
11923
11894
  */
11895
+ var getNative = require('lodash._getnative'),
11896
+ isArguments = require('lodash.isarguments'),
11897
+ isArray = require('lodash.isarray');
11898
+
11899
+ /** Used to detect unsigned integer values. */
11900
+ var reIsUint = /^\d+$/;
11901
+
11902
+ /** Used for native method references. */
11903
+ var objectProto = Object.prototype;
11904
+
11905
+ /** Used to check objects for own properties. */
11906
+ var hasOwnProperty = objectProto.hasOwnProperty;
11907
+
11908
+ /* Native method references for those with the same name as other `lodash` methods. */
11909
+ var nativeKeys = getNative(Object, 'keys');
11910
+
11911
+ /**
11912
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
11913
+ * of an array-like value.
11914
+ */
11915
+ var MAX_SAFE_INTEGER = 9007199254740991;
11924
11916
 
11925
11917
  /**
11926
- * The base implementation of `_.create` without support for assigning
11927
- * properties to the created object.
11918
+ * The base implementation of `_.property` without support for deep paths.
11928
11919
  *
11929
11920
  * @private
11930
- * @param {Object} prototype The object to inherit from.
11931
- * @returns {Object} Returns the new object.
11921
+ * @param {string} key The key of the property to get.
11922
+ * @returns {Function} Returns the new function.
11932
11923
  */
11933
- var baseCreate = (function() {
11934
- function object() {}
11935
- return function(prototype) {
11936
- if (isObject(prototype)) {
11937
- object.prototype = prototype;
11938
- var result = new object;
11939
- object.prototype = undefined;
11940
- }
11941
- return result || {};
11924
+ function baseProperty(key) {
11925
+ return function(object) {
11926
+ return object == null ? undefined : object[key];
11942
11927
  };
11943
- }());
11928
+ }
11929
+
11930
+ /**
11931
+ * Gets the "length" property value of `object`.
11932
+ *
11933
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
11934
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
11935
+ *
11936
+ * @private
11937
+ * @param {Object} object The object to query.
11938
+ * @returns {*} Returns the "length" value.
11939
+ */
11940
+ var getLength = baseProperty('length');
11941
+
11942
+ /**
11943
+ * Checks if `value` is array-like.
11944
+ *
11945
+ * @private
11946
+ * @param {*} value The value to check.
11947
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
11948
+ */
11949
+ function isArrayLike(value) {
11950
+ return value != null && isLength(getLength(value));
11951
+ }
11952
+
11953
+ /**
11954
+ * Checks if `value` is a valid array-like index.
11955
+ *
11956
+ * @private
11957
+ * @param {*} value The value to check.
11958
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
11959
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
11960
+ */
11961
+ function isIndex(value, length) {
11962
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
11963
+ length = length == null ? MAX_SAFE_INTEGER : length;
11964
+ return value > -1 && value % 1 == 0 && value < length;
11965
+ }
11966
+
11967
+ /**
11968
+ * Checks if `value` is a valid array-like length.
11969
+ *
11970
+ * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
11971
+ *
11972
+ * @private
11973
+ * @param {*} value The value to check.
11974
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
11975
+ */
11976
+ function isLength(value) {
11977
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
11978
+ }
11979
+
11980
+ /**
11981
+ * A fallback implementation of `Object.keys` which creates an array of the
11982
+ * own enumerable property names of `object`.
11983
+ *
11984
+ * @private
11985
+ * @param {Object} object The object to query.
11986
+ * @returns {Array} Returns the array of property names.
11987
+ */
11988
+ function shimKeys(object) {
11989
+ var props = keysIn(object),
11990
+ propsLength = props.length,
11991
+ length = propsLength && object.length;
11992
+
11993
+ var allowIndexes = !!length && isLength(length) &&
11994
+ (isArray(object) || isArguments(object));
11995
+
11996
+ var index = -1,
11997
+ result = [];
11998
+
11999
+ while (++index < propsLength) {
12000
+ var key = props[index];
12001
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
12002
+ result.push(key);
12003
+ }
12004
+ }
12005
+ return result;
12006
+ }
11944
12007
 
11945
12008
  /**
11946
12009
  * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
@@ -11969,11 +12032,98 @@ function isObject(value) {
11969
12032
  return !!value && (type == 'object' || type == 'function');
11970
12033
  }
11971
12034
 
11972
- module.exports = baseCreate;
11973
-
11974
- },{}],73:[function(require,module,exports){
11975
12035
  /**
11976
- * lodash 3.9.1 (Custom Build) <https://lodash.com/>
12036
+ * Creates an array of the own enumerable property names of `object`.
12037
+ *
12038
+ * **Note:** Non-object values are coerced to objects. See the
12039
+ * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
12040
+ * for more details.
12041
+ *
12042
+ * @static
12043
+ * @memberOf _
12044
+ * @category Object
12045
+ * @param {Object} object The object to query.
12046
+ * @returns {Array} Returns the array of property names.
12047
+ * @example
12048
+ *
12049
+ * function Foo() {
12050
+ * this.a = 1;
12051
+ * this.b = 2;
12052
+ * }
12053
+ *
12054
+ * Foo.prototype.c = 3;
12055
+ *
12056
+ * _.keys(new Foo);
12057
+ * // => ['a', 'b'] (iteration order is not guaranteed)
12058
+ *
12059
+ * _.keys('hi');
12060
+ * // => ['0', '1']
12061
+ */
12062
+ var keys = !nativeKeys ? shimKeys : function(object) {
12063
+ var Ctor = object == null ? undefined : object.constructor;
12064
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
12065
+ (typeof object != 'function' && isArrayLike(object))) {
12066
+ return shimKeys(object);
12067
+ }
12068
+ return isObject(object) ? nativeKeys(object) : [];
12069
+ };
12070
+
12071
+ /**
12072
+ * Creates an array of the own and inherited enumerable property names of `object`.
12073
+ *
12074
+ * **Note:** Non-object values are coerced to objects.
12075
+ *
12076
+ * @static
12077
+ * @memberOf _
12078
+ * @category Object
12079
+ * @param {Object} object The object to query.
12080
+ * @returns {Array} Returns the array of property names.
12081
+ * @example
12082
+ *
12083
+ * function Foo() {
12084
+ * this.a = 1;
12085
+ * this.b = 2;
12086
+ * }
12087
+ *
12088
+ * Foo.prototype.c = 3;
12089
+ *
12090
+ * _.keysIn(new Foo);
12091
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
12092
+ */
12093
+ function keysIn(object) {
12094
+ if (object == null) {
12095
+ return [];
12096
+ }
12097
+ if (!isObject(object)) {
12098
+ object = Object(object);
12099
+ }
12100
+ var length = object.length;
12101
+ length = (length && isLength(length) &&
12102
+ (isArray(object) || isArguments(object)) && length) || 0;
12103
+
12104
+ var Ctor = object.constructor,
12105
+ index = -1,
12106
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
12107
+ result = Array(length),
12108
+ skipIndexes = length > 0;
12109
+
12110
+ while (++index < length) {
12111
+ result[index] = (index + '');
12112
+ }
12113
+ for (var key in object) {
12114
+ if (!(skipIndexes && isIndex(key, length)) &&
12115
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
12116
+ result.push(key);
12117
+ }
12118
+ }
12119
+ return result;
12120
+ }
12121
+
12122
+ module.exports = keys;
12123
+
12124
+ },{"lodash._getnative":73,"lodash.isarguments":74,"lodash.isarray":75}],73:[function(require,module,exports){
12125
+ /**
12126
+ * lodash 3.9.1 (Custom Build) <https://lodash.com/>
11977
12127
  * Build: `lodash modern modularize exports="npm" -o ./`
11978
12128
  * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
11979
12129
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -12111,197 +12261,6 @@ function isNative(value) {
12111
12261
  module.exports = getNative;
12112
12262
 
12113
12263
  },{}],74:[function(require,module,exports){
12114
- /**
12115
- * lodash 3.0.9 (Custom Build) <https://lodash.com/>
12116
- * Build: `lodash modern modularize exports="npm" -o ./`
12117
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12118
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12119
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12120
- * Available under MIT license <https://lodash.com/license>
12121
- */
12122
-
12123
- /** Used to detect unsigned integer values. */
12124
- var reIsUint = /^\d+$/;
12125
-
12126
- /**
12127
- * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
12128
- * of an array-like value.
12129
- */
12130
- var MAX_SAFE_INTEGER = 9007199254740991;
12131
-
12132
- /**
12133
- * The base implementation of `_.property` without support for deep paths.
12134
- *
12135
- * @private
12136
- * @param {string} key The key of the property to get.
12137
- * @returns {Function} Returns the new function.
12138
- */
12139
- function baseProperty(key) {
12140
- return function(object) {
12141
- return object == null ? undefined : object[key];
12142
- };
12143
- }
12144
-
12145
- /**
12146
- * Gets the "length" property value of `object`.
12147
- *
12148
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
12149
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
12150
- *
12151
- * @private
12152
- * @param {Object} object The object to query.
12153
- * @returns {*} Returns the "length" value.
12154
- */
12155
- var getLength = baseProperty('length');
12156
-
12157
- /**
12158
- * Checks if `value` is array-like.
12159
- *
12160
- * @private
12161
- * @param {*} value The value to check.
12162
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
12163
- */
12164
- function isArrayLike(value) {
12165
- return value != null && isLength(getLength(value));
12166
- }
12167
-
12168
- /**
12169
- * Checks if `value` is a valid array-like index.
12170
- *
12171
- * @private
12172
- * @param {*} value The value to check.
12173
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
12174
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
12175
- */
12176
- function isIndex(value, length) {
12177
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
12178
- length = length == null ? MAX_SAFE_INTEGER : length;
12179
- return value > -1 && value % 1 == 0 && value < length;
12180
- }
12181
-
12182
- /**
12183
- * Checks if the provided arguments are from an iteratee call.
12184
- *
12185
- * @private
12186
- * @param {*} value The potential iteratee value argument.
12187
- * @param {*} index The potential iteratee index or key argument.
12188
- * @param {*} object The potential iteratee object argument.
12189
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
12190
- */
12191
- function isIterateeCall(value, index, object) {
12192
- if (!isObject(object)) {
12193
- return false;
12194
- }
12195
- var type = typeof index;
12196
- if (type == 'number'
12197
- ? (isArrayLike(object) && isIndex(index, object.length))
12198
- : (type == 'string' && index in object)) {
12199
- var other = object[index];
12200
- return value === value ? (value === other) : (other !== other);
12201
- }
12202
- return false;
12203
- }
12204
-
12205
- /**
12206
- * Checks if `value` is a valid array-like length.
12207
- *
12208
- * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
12209
- *
12210
- * @private
12211
- * @param {*} value The value to check.
12212
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12213
- */
12214
- function isLength(value) {
12215
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12216
- }
12217
-
12218
- /**
12219
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12220
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12221
- *
12222
- * @static
12223
- * @memberOf _
12224
- * @category Lang
12225
- * @param {*} value The value to check.
12226
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12227
- * @example
12228
- *
12229
- * _.isObject({});
12230
- * // => true
12231
- *
12232
- * _.isObject([1, 2, 3]);
12233
- * // => true
12234
- *
12235
- * _.isObject(1);
12236
- * // => false
12237
- */
12238
- function isObject(value) {
12239
- // Avoid a V8 JIT bug in Chrome 19-20.
12240
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
12241
- var type = typeof value;
12242
- return !!value && (type == 'object' || type == 'function');
12243
- }
12244
-
12245
- module.exports = isIterateeCall;
12246
-
12247
- },{}],75:[function(require,module,exports){
12248
- /**
12249
- * lodash 3.1.1 (Custom Build) <https://lodash.com/>
12250
- * Build: `lodash modern modularize exports="npm" -o ./`
12251
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12252
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12253
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12254
- * Available under MIT license <https://lodash.com/license>
12255
- */
12256
- var baseAssign = require('lodash._baseassign'),
12257
- baseCreate = require('lodash._basecreate'),
12258
- isIterateeCall = require('lodash._isiterateecall');
12259
-
12260
- /**
12261
- * Creates an object that inherits from the given `prototype` object. If a
12262
- * `properties` object is provided its own enumerable properties are assigned
12263
- * to the created object.
12264
- *
12265
- * @static
12266
- * @memberOf _
12267
- * @category Object
12268
- * @param {Object} prototype The object to inherit from.
12269
- * @param {Object} [properties] The properties to assign to the object.
12270
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
12271
- * @returns {Object} Returns the new object.
12272
- * @example
12273
- *
12274
- * function Shape() {
12275
- * this.x = 0;
12276
- * this.y = 0;
12277
- * }
12278
- *
12279
- * function Circle() {
12280
- * Shape.call(this);
12281
- * }
12282
- *
12283
- * Circle.prototype = _.create(Shape.prototype, {
12284
- * 'constructor': Circle
12285
- * });
12286
- *
12287
- * var circle = new Circle;
12288
- * circle instanceof Circle;
12289
- * // => true
12290
- *
12291
- * circle instanceof Shape;
12292
- * // => true
12293
- */
12294
- function create(prototype, properties, guard) {
12295
- var result = baseCreate(prototype);
12296
- if (guard && isIterateeCall(prototype, properties, guard)) {
12297
- properties = undefined;
12298
- }
12299
- return properties ? baseAssign(result, properties) : result;
12300
- }
12301
-
12302
- module.exports = create;
12303
-
12304
- },{"lodash._baseassign":70,"lodash._basecreate":72,"lodash._isiterateecall":74}],76:[function(require,module,exports){
12305
12264
  /**
12306
12265
  * lodash (Custom Build) <https://lodash.com/>
12307
12266
  * Build: `lodash modularize exports="npm" -o ./`
@@ -12532,7 +12491,7 @@ function isObjectLike(value) {
12532
12491
 
12533
12492
  module.exports = isArguments;
12534
12493
 
12535
- },{}],77:[function(require,module,exports){
12494
+ },{}],75:[function(require,module,exports){
12536
12495
  /**
12537
12496
  * lodash 3.0.4 (Custom Build) <https://lodash.com/>
12538
12497
  * Build: `lodash modern modularize exports="npm" -o ./`
@@ -12714,33 +12673,80 @@ function isNative(value) {
12714
12673
 
12715
12674
  module.exports = isArray;
12716
12675
 
12717
- },{}],78:[function(require,module,exports){
12676
+ },{}],76:[function(require,module,exports){
12718
12677
  /**
12719
- * lodash 3.1.2 (Custom Build) <https://lodash.com/>
12678
+ * lodash 3.0.3 (Custom Build) <https://lodash.com/>
12720
12679
  * Build: `lodash modern modularize exports="npm" -o ./`
12721
12680
  * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12722
12681
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12723
12682
  * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12724
12683
  * Available under MIT license <https://lodash.com/license>
12725
12684
  */
12726
- var getNative = require('lodash._getnative'),
12727
- isArguments = require('lodash.isarguments'),
12728
- isArray = require('lodash.isarray');
12729
12685
 
12730
- /** Used to detect unsigned integer values. */
12731
- var reIsUint = /^\d+$/;
12686
+ /**
12687
+ * The base implementation of `_.create` without support for assigning
12688
+ * properties to the created object.
12689
+ *
12690
+ * @private
12691
+ * @param {Object} prototype The object to inherit from.
12692
+ * @returns {Object} Returns the new object.
12693
+ */
12694
+ var baseCreate = (function() {
12695
+ function object() {}
12696
+ return function(prototype) {
12697
+ if (isObject(prototype)) {
12698
+ object.prototype = prototype;
12699
+ var result = new object;
12700
+ object.prototype = undefined;
12701
+ }
12702
+ return result || {};
12703
+ };
12704
+ }());
12732
12705
 
12733
- /** Used for native method references. */
12734
- var objectProto = Object.prototype;
12706
+ /**
12707
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
12708
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12709
+ *
12710
+ * @static
12711
+ * @memberOf _
12712
+ * @category Lang
12713
+ * @param {*} value The value to check.
12714
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12715
+ * @example
12716
+ *
12717
+ * _.isObject({});
12718
+ * // => true
12719
+ *
12720
+ * _.isObject([1, 2, 3]);
12721
+ * // => true
12722
+ *
12723
+ * _.isObject(1);
12724
+ * // => false
12725
+ */
12726
+ function isObject(value) {
12727
+ // Avoid a V8 JIT bug in Chrome 19-20.
12728
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
12729
+ var type = typeof value;
12730
+ return !!value && (type == 'object' || type == 'function');
12731
+ }
12735
12732
 
12736
- /** Used to check objects for own properties. */
12737
- var hasOwnProperty = objectProto.hasOwnProperty;
12733
+ module.exports = baseCreate;
12738
12734
 
12739
- /* Native method references for those with the same name as other `lodash` methods. */
12740
- var nativeKeys = getNative(Object, 'keys');
12735
+ },{}],77:[function(require,module,exports){
12736
+ /**
12737
+ * lodash 3.0.9 (Custom Build) <https://lodash.com/>
12738
+ * Build: `lodash modern modularize exports="npm" -o ./`
12739
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
12740
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12741
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12742
+ * Available under MIT license <https://lodash.com/license>
12743
+ */
12744
+
12745
+ /** Used to detect unsigned integer values. */
12746
+ var reIsUint = /^\d+$/;
12741
12747
 
12742
12748
  /**
12743
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
12749
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
12744
12750
  * of an array-like value.
12745
12751
  */
12746
12752
  var MAX_SAFE_INTEGER = 9007199254740991;
@@ -12796,44 +12802,39 @@ function isIndex(value, length) {
12796
12802
  }
12797
12803
 
12798
12804
  /**
12799
- * Checks if `value` is a valid array-like length.
12800
- *
12801
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
12805
+ * Checks if the provided arguments are from an iteratee call.
12802
12806
  *
12803
12807
  * @private
12804
- * @param {*} value The value to check.
12805
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12808
+ * @param {*} value The potential iteratee value argument.
12809
+ * @param {*} index The potential iteratee index or key argument.
12810
+ * @param {*} object The potential iteratee object argument.
12811
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
12806
12812
  */
12807
- function isLength(value) {
12808
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12813
+ function isIterateeCall(value, index, object) {
12814
+ if (!isObject(object)) {
12815
+ return false;
12816
+ }
12817
+ var type = typeof index;
12818
+ if (type == 'number'
12819
+ ? (isArrayLike(object) && isIndex(index, object.length))
12820
+ : (type == 'string' && index in object)) {
12821
+ var other = object[index];
12822
+ return value === value ? (value === other) : (other !== other);
12823
+ }
12824
+ return false;
12809
12825
  }
12810
12826
 
12811
12827
  /**
12812
- * A fallback implementation of `Object.keys` which creates an array of the
12813
- * own enumerable property names of `object`.
12828
+ * Checks if `value` is a valid array-like length.
12829
+ *
12830
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
12814
12831
  *
12815
12832
  * @private
12816
- * @param {Object} object The object to query.
12817
- * @returns {Array} Returns the array of property names.
12818
- */
12819
- function shimKeys(object) {
12820
- var props = keysIn(object),
12821
- propsLength = props.length,
12822
- length = propsLength && object.length;
12823
-
12824
- var allowIndexes = !!length && isLength(length) &&
12825
- (isArray(object) || isArguments(object));
12826
-
12827
- var index = -1,
12828
- result = [];
12829
-
12830
- while (++index < propsLength) {
12831
- var key = props[index];
12832
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
12833
- result.push(key);
12834
- }
12835
- }
12836
- return result;
12833
+ * @param {*} value The value to check.
12834
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12835
+ */
12836
+ function isLength(value) {
12837
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12837
12838
  }
12838
12839
 
12839
12840
  /**
@@ -12863,96 +12864,9 @@ function isObject(value) {
12863
12864
  return !!value && (type == 'object' || type == 'function');
12864
12865
  }
12865
12866
 
12866
- /**
12867
- * Creates an array of the own enumerable property names of `object`.
12868
- *
12869
- * **Note:** Non-object values are coerced to objects. See the
12870
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
12871
- * for more details.
12872
- *
12873
- * @static
12874
- * @memberOf _
12875
- * @category Object
12876
- * @param {Object} object The object to query.
12877
- * @returns {Array} Returns the array of property names.
12878
- * @example
12879
- *
12880
- * function Foo() {
12881
- * this.a = 1;
12882
- * this.b = 2;
12883
- * }
12884
- *
12885
- * Foo.prototype.c = 3;
12886
- *
12887
- * _.keys(new Foo);
12888
- * // => ['a', 'b'] (iteration order is not guaranteed)
12889
- *
12890
- * _.keys('hi');
12891
- * // => ['0', '1']
12892
- */
12893
- var keys = !nativeKeys ? shimKeys : function(object) {
12894
- var Ctor = object == null ? undefined : object.constructor;
12895
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
12896
- (typeof object != 'function' && isArrayLike(object))) {
12897
- return shimKeys(object);
12898
- }
12899
- return isObject(object) ? nativeKeys(object) : [];
12900
- };
12901
-
12902
- /**
12903
- * Creates an array of the own and inherited enumerable property names of `object`.
12904
- *
12905
- * **Note:** Non-object values are coerced to objects.
12906
- *
12907
- * @static
12908
- * @memberOf _
12909
- * @category Object
12910
- * @param {Object} object The object to query.
12911
- * @returns {Array} Returns the array of property names.
12912
- * @example
12913
- *
12914
- * function Foo() {
12915
- * this.a = 1;
12916
- * this.b = 2;
12917
- * }
12918
- *
12919
- * Foo.prototype.c = 3;
12920
- *
12921
- * _.keysIn(new Foo);
12922
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
12923
- */
12924
- function keysIn(object) {
12925
- if (object == null) {
12926
- return [];
12927
- }
12928
- if (!isObject(object)) {
12929
- object = Object(object);
12930
- }
12931
- var length = object.length;
12932
- length = (length && isLength(length) &&
12933
- (isArray(object) || isArguments(object)) && length) || 0;
12934
-
12935
- var Ctor = object.constructor,
12936
- index = -1,
12937
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
12938
- result = Array(length),
12939
- skipIndexes = length > 0;
12940
-
12941
- while (++index < length) {
12942
- result[index] = (index + '');
12943
- }
12944
- for (var key in object) {
12945
- if (!(skipIndexes && isIndex(key, length)) &&
12946
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
12947
- result.push(key);
12948
- }
12949
- }
12950
- return result;
12951
- }
12952
-
12953
- module.exports = keys;
12867
+ module.exports = isIterateeCall;
12954
12868
 
12955
- },{"lodash._getnative":73,"lodash.isarguments":76,"lodash.isarray":77}],79:[function(require,module,exports){
12869
+ },{}],78:[function(require,module,exports){
12956
12870
  (function (process){
12957
12871
  var path = require('path');
12958
12872
  var fs = require('fs');
@@ -13054,7 +12968,7 @@ mkdirP.sync = function sync (p, opts, made) {
13054
12968
  };
13055
12969
 
13056
12970
  }).call(this,require('_process'))
13057
- },{"_process":82,"fs":42,"path":42}],80:[function(require,module,exports){
12971
+ },{"_process":81,"fs":42,"path":42}],79:[function(require,module,exports){
13058
12972
  exports.endianness = function () { return 'LE' };
13059
12973
 
13060
12974
  exports.hostname = function () {
@@ -13101,7 +13015,7 @@ exports.tmpdir = exports.tmpDir = function () {
13101
13015
 
13102
13016
  exports.EOL = '\n';
13103
13017
 
13104
- },{}],81:[function(require,module,exports){
13018
+ },{}],80:[function(require,module,exports){
13105
13019
  (function (process){
13106
13020
  'use strict';
13107
13021
 
@@ -13148,7 +13062,7 @@ function nextTick(fn, arg1, arg2, arg3) {
13148
13062
  }
13149
13063
 
13150
13064
  }).call(this,require('_process'))
13151
- },{"_process":82}],82:[function(require,module,exports){
13065
+ },{"_process":81}],81:[function(require,module,exports){
13152
13066
  // shim for using process in browser
13153
13067
  var process = module.exports = {};
13154
13068
 
@@ -13319,6 +13233,10 @@ process.off = noop;
13319
13233
  process.removeListener = noop;
13320
13234
  process.removeAllListeners = noop;
13321
13235
  process.emit = noop;
13236
+ process.prependListener = noop;
13237
+ process.prependOnceListener = noop;
13238
+
13239
+ process.listeners = function (name) { return [] }
13322
13240
 
13323
13241
  process.binding = function (name) {
13324
13242
  throw new Error('process.binding is not supported');
@@ -13330,10 +13248,10 @@ process.chdir = function (dir) {
13330
13248
  };
13331
13249
  process.umask = function() { return 0; };
13332
13250
 
13333
- },{}],83:[function(require,module,exports){
13334
- module.exports = require("./lib/_stream_duplex.js")
13251
+ },{}],82:[function(require,module,exports){
13252
+ module.exports = require('./lib/_stream_duplex.js');
13335
13253
 
13336
- },{"./lib/_stream_duplex.js":84}],84:[function(require,module,exports){
13254
+ },{"./lib/_stream_duplex.js":83}],83:[function(require,module,exports){
13337
13255
  // a duplex stream is just a stream that is both readable and writable.
13338
13256
  // Since JS doesn't have multiple prototypal inheritance, this class
13339
13257
  // prototypally inherits from Readable, and then parasitically from
@@ -13409,7 +13327,7 @@ function forEach(xs, f) {
13409
13327
  f(xs[i], i);
13410
13328
  }
13411
13329
  }
13412
- },{"./_stream_readable":86,"./_stream_writable":88,"core-util-is":45,"inherits":66,"process-nextick-args":81}],85:[function(require,module,exports){
13330
+ },{"./_stream_readable":85,"./_stream_writable":87,"core-util-is":44,"inherits":65,"process-nextick-args":80}],84:[function(require,module,exports){
13413
13331
  // a passthrough stream.
13414
13332
  // basically just the most minimal sort of Transform stream.
13415
13333
  // Every written chunk gets output as-is.
@@ -13436,7 +13354,7 @@ function PassThrough(options) {
13436
13354
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
13437
13355
  cb(null, chunk);
13438
13356
  };
13439
- },{"./_stream_transform":87,"core-util-is":45,"inherits":66}],86:[function(require,module,exports){
13357
+ },{"./_stream_transform":86,"core-util-is":44,"inherits":65}],85:[function(require,module,exports){
13440
13358
  (function (process){
13441
13359
  'use strict';
13442
13360
 
@@ -13450,6 +13368,10 @@ var processNextTick = require('process-nextick-args');
13450
13368
  var isArray = require('isarray');
13451
13369
  /*</replacement>*/
13452
13370
 
13371
+ /*<replacement>*/
13372
+ var Duplex;
13373
+ /*</replacement>*/
13374
+
13453
13375
  Readable.ReadableState = ReadableState;
13454
13376
 
13455
13377
  /*<replacement>*/
@@ -13461,19 +13383,11 @@ var EElistenerCount = function (emitter, type) {
13461
13383
  /*</replacement>*/
13462
13384
 
13463
13385
  /*<replacement>*/
13464
- var Stream;
13465
- (function () {
13466
- try {
13467
- Stream = require('st' + 'ream');
13468
- } catch (_) {} finally {
13469
- if (!Stream) Stream = require('events').EventEmitter;
13470
- }
13471
- })();
13386
+ var Stream = require('./internal/streams/stream');
13472
13387
  /*</replacement>*/
13473
13388
 
13474
- var Buffer = require('buffer').Buffer;
13475
13389
  /*<replacement>*/
13476
- var bufferShim = require('buffer-shims');
13390
+ var Buffer = require('safe-buffer').Buffer;
13477
13391
  /*</replacement>*/
13478
13392
 
13479
13393
  /*<replacement>*/
@@ -13496,7 +13410,11 @@ var StringDecoder;
13496
13410
 
13497
13411
  util.inherits(Readable, Stream);
13498
13412
 
13413
+ var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
13414
+
13499
13415
  function prependListener(emitter, event, fn) {
13416
+ // Sadly this is not cacheable as some libraries bundle their own
13417
+ // event emitter implementation with them.
13500
13418
  if (typeof emitter.prependListener === 'function') {
13501
13419
  return emitter.prependListener(event, fn);
13502
13420
  } else {
@@ -13508,7 +13426,6 @@ function prependListener(emitter, event, fn) {
13508
13426
  }
13509
13427
  }
13510
13428
 
13511
- var Duplex;
13512
13429
  function ReadableState(options, stream) {
13513
13430
  Duplex = Duplex || require('./_stream_duplex');
13514
13431
 
@@ -13527,7 +13444,7 @@ function ReadableState(options, stream) {
13527
13444
  this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
13528
13445
 
13529
13446
  // cast to ints.
13530
- this.highWaterMark = ~ ~this.highWaterMark;
13447
+ this.highWaterMark = ~~this.highWaterMark;
13531
13448
 
13532
13449
  // A linked list is used to store data chunks instead of an array because the
13533
13450
  // linked list can remove elements from the beginning faster than
@@ -13578,7 +13495,6 @@ function ReadableState(options, stream) {
13578
13495
  }
13579
13496
  }
13580
13497
 
13581
- var Duplex;
13582
13498
  function Readable(options) {
13583
13499
  Duplex = Duplex || require('./_stream_duplex');
13584
13500
 
@@ -13604,7 +13520,7 @@ Readable.prototype.push = function (chunk, encoding) {
13604
13520
  if (!state.objectMode && typeof chunk === 'string') {
13605
13521
  encoding = encoding || state.defaultEncoding;
13606
13522
  if (encoding !== state.encoding) {
13607
- chunk = bufferShim.from(chunk, encoding);
13523
+ chunk = Buffer.from(chunk, encoding);
13608
13524
  encoding = '';
13609
13525
  }
13610
13526
  }
@@ -13901,7 +13817,7 @@ function maybeReadMore_(stream, state) {
13901
13817
  // for virtual (non-string, non-buffer) streams, "length" is somewhat
13902
13818
  // arbitrary, and perhaps not very meaningful.
13903
13819
  Readable.prototype._read = function (n) {
13904
- this.emit('error', new Error('not implemented'));
13820
+ this.emit('error', new Error('_read() is not implemented'));
13905
13821
  };
13906
13822
 
13907
13823
  Readable.prototype.pipe = function (dest, pipeOpts) {
@@ -13924,7 +13840,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
13924
13840
 
13925
13841
  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
13926
13842
 
13927
- var endFn = doEnd ? onend : cleanup;
13843
+ var endFn = doEnd ? onend : unpipe;
13928
13844
  if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
13929
13845
 
13930
13846
  dest.on('unpipe', onunpipe);
@@ -13957,7 +13873,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
13957
13873
  dest.removeListener('error', onerror);
13958
13874
  dest.removeListener('unpipe', onunpipe);
13959
13875
  src.removeListener('end', onend);
13960
- src.removeListener('end', cleanup);
13876
+ src.removeListener('end', unpipe);
13961
13877
  src.removeListener('data', ondata);
13962
13878
 
13963
13879
  cleanedUp = true;
@@ -14079,16 +13995,16 @@ Readable.prototype.unpipe = function (dest) {
14079
13995
  state.pipesCount = 0;
14080
13996
  state.flowing = false;
14081
13997
 
14082
- for (var _i = 0; _i < len; _i++) {
14083
- dests[_i].emit('unpipe', this);
13998
+ for (var i = 0; i < len; i++) {
13999
+ dests[i].emit('unpipe', this);
14084
14000
  }return this;
14085
14001
  }
14086
14002
 
14087
14003
  // try to find the right one.
14088
- var i = indexOf(state.pipes, dest);
14089
- if (i === -1) return this;
14004
+ var index = indexOf(state.pipes, dest);
14005
+ if (index === -1) return this;
14090
14006
 
14091
- state.pipes.splice(i, 1);
14007
+ state.pipes.splice(index, 1);
14092
14008
  state.pipesCount -= 1;
14093
14009
  if (state.pipesCount === 1) state.pipes = state.pipes[0];
14094
14010
 
@@ -14220,10 +14136,9 @@ Readable.prototype.wrap = function (stream) {
14220
14136
  }
14221
14137
 
14222
14138
  // proxy certain important events.
14223
- var events = ['error', 'close', 'destroy', 'pause', 'resume'];
14224
- forEach(events, function (ev) {
14225
- stream.on(ev, self.emit.bind(self, ev));
14226
- });
14139
+ for (var n = 0; n < kProxyEvents.length; n++) {
14140
+ stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
14141
+ }
14227
14142
 
14228
14143
  // when we try to consume some more bytes, simply unpause the
14229
14144
  // underlying stream.
@@ -14315,7 +14230,7 @@ function copyFromBufferString(n, list) {
14315
14230
  // This function is designed to be inlinable, so please take care when making
14316
14231
  // changes to the function body.
14317
14232
  function copyFromBuffer(n, list) {
14318
- var ret = bufferShim.allocUnsafe(n);
14233
+ var ret = Buffer.allocUnsafe(n);
14319
14234
  var p = list.head;
14320
14235
  var c = 1;
14321
14236
  p.data.copy(ret);
@@ -14376,7 +14291,7 @@ function indexOf(xs, x) {
14376
14291
  return -1;
14377
14292
  }
14378
14293
  }).call(this,require('_process'))
14379
- },{"./_stream_duplex":84,"./internal/streams/BufferList":89,"_process":82,"buffer":44,"buffer-shims":43,"core-util-is":45,"events":63,"inherits":66,"isarray":68,"process-nextick-args":81,"string_decoder/":95,"util":40}],87:[function(require,module,exports){
14294
+ },{"./_stream_duplex":83,"./internal/streams/BufferList":88,"./internal/streams/stream":89,"_process":81,"core-util-is":44,"events":62,"inherits":65,"isarray":67,"process-nextick-args":80,"safe-buffer":94,"string_decoder/":96,"util":40}],86:[function(require,module,exports){
14380
14295
  // a transform stream is a readable/writable stream where you do
14381
14296
  // something with the data. Sometimes it's called a "filter",
14382
14297
  // but that's not a great name for it, since that implies a thing where
@@ -14473,7 +14388,6 @@ function Transform(options) {
14473
14388
 
14474
14389
  this._transformState = new TransformState(this);
14475
14390
 
14476
- // when the writable side finishes, then flush out anything remaining.
14477
14391
  var stream = this;
14478
14392
 
14479
14393
  // start out asking for a readable event once data is transformed.
@@ -14490,9 +14404,10 @@ function Transform(options) {
14490
14404
  if (typeof options.flush === 'function') this._flush = options.flush;
14491
14405
  }
14492
14406
 
14407
+ // When the writable side finishes, then flush out anything remaining.
14493
14408
  this.once('prefinish', function () {
14494
- if (typeof this._flush === 'function') this._flush(function (er) {
14495
- done(stream, er);
14409
+ if (typeof this._flush === 'function') this._flush(function (er, data) {
14410
+ done(stream, er, data);
14496
14411
  });else done(stream);
14497
14412
  });
14498
14413
  }
@@ -14513,7 +14428,7 @@ Transform.prototype.push = function (chunk, encoding) {
14513
14428
  // an error, then that'll put the hurt on the whole operation. If you
14514
14429
  // never call cb(), then you'll never get another chunk.
14515
14430
  Transform.prototype._transform = function (chunk, encoding, cb) {
14516
- throw new Error('Not implemented');
14431
+ throw new Error('_transform() is not implemented');
14517
14432
  };
14518
14433
 
14519
14434
  Transform.prototype._write = function (chunk, encoding, cb) {
@@ -14543,9 +14458,11 @@ Transform.prototype._read = function (n) {
14543
14458
  }
14544
14459
  };
14545
14460
 
14546
- function done(stream, er) {
14461
+ function done(stream, er, data) {
14547
14462
  if (er) return stream.emit('error', er);
14548
14463
 
14464
+ if (data !== null && data !== undefined) stream.push(data);
14465
+
14549
14466
  // if there's nothing in the write buffer, then that means
14550
14467
  // that nothing more will ever be provided
14551
14468
  var ws = stream._writableState;
@@ -14557,7 +14474,7 @@ function done(stream, er) {
14557
14474
 
14558
14475
  return stream.push(null);
14559
14476
  }
14560
- },{"./_stream_duplex":84,"core-util-is":45,"inherits":66}],88:[function(require,module,exports){
14477
+ },{"./_stream_duplex":83,"core-util-is":44,"inherits":65}],87:[function(require,module,exports){
14561
14478
  (function (process){
14562
14479
  // A bit simpler than readable streams.
14563
14480
  // Implement an async ._write(chunk, encoding, cb), and it'll handle all
@@ -14575,6 +14492,10 @@ var processNextTick = require('process-nextick-args');
14575
14492
  var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
14576
14493
  /*</replacement>*/
14577
14494
 
14495
+ /*<replacement>*/
14496
+ var Duplex;
14497
+ /*</replacement>*/
14498
+
14578
14499
  Writable.WritableState = WritableState;
14579
14500
 
14580
14501
  /*<replacement>*/
@@ -14589,19 +14510,11 @@ var internalUtil = {
14589
14510
  /*</replacement>*/
14590
14511
 
14591
14512
  /*<replacement>*/
14592
- var Stream;
14593
- (function () {
14594
- try {
14595
- Stream = require('st' + 'ream');
14596
- } catch (_) {} finally {
14597
- if (!Stream) Stream = require('events').EventEmitter;
14598
- }
14599
- })();
14513
+ var Stream = require('./internal/streams/stream');
14600
14514
  /*</replacement>*/
14601
14515
 
14602
- var Buffer = require('buffer').Buffer;
14603
14516
  /*<replacement>*/
14604
- var bufferShim = require('buffer-shims');
14517
+ var Buffer = require('safe-buffer').Buffer;
14605
14518
  /*</replacement>*/
14606
14519
 
14607
14520
  util.inherits(Writable, Stream);
@@ -14615,7 +14528,6 @@ function WriteReq(chunk, encoding, cb) {
14615
14528
  this.next = null;
14616
14529
  }
14617
14530
 
14618
- var Duplex;
14619
14531
  function WritableState(options, stream) {
14620
14532
  Duplex = Duplex || require('./_stream_duplex');
14621
14533
 
@@ -14635,8 +14547,9 @@ function WritableState(options, stream) {
14635
14547
  this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
14636
14548
 
14637
14549
  // cast to ints.
14638
- this.highWaterMark = ~ ~this.highWaterMark;
14550
+ this.highWaterMark = ~~this.highWaterMark;
14639
14551
 
14552
+ // drain event flag.
14640
14553
  this.needDrain = false;
14641
14554
  // at the start of calling end()
14642
14555
  this.ending = false;
@@ -14711,7 +14624,7 @@ function WritableState(options, stream) {
14711
14624
  this.corkedRequestsFree = new CorkedRequest(this);
14712
14625
  }
14713
14626
 
14714
- WritableState.prototype.getBuffer = function writableStateGetBuffer() {
14627
+ WritableState.prototype.getBuffer = function getBuffer() {
14715
14628
  var current = this.bufferedRequest;
14716
14629
  var out = [];
14717
14630
  while (current) {
@@ -14731,13 +14644,37 @@ WritableState.prototype.getBuffer = function writableStateGetBuffer() {
14731
14644
  } catch (_) {}
14732
14645
  })();
14733
14646
 
14734
- var Duplex;
14647
+ // Test _writableState for inheritance to account for Duplex streams,
14648
+ // whose prototype chain only points to Readable.
14649
+ var realHasInstance;
14650
+ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
14651
+ realHasInstance = Function.prototype[Symbol.hasInstance];
14652
+ Object.defineProperty(Writable, Symbol.hasInstance, {
14653
+ value: function (object) {
14654
+ if (realHasInstance.call(this, object)) return true;
14655
+
14656
+ return object && object._writableState instanceof WritableState;
14657
+ }
14658
+ });
14659
+ } else {
14660
+ realHasInstance = function (object) {
14661
+ return object instanceof this;
14662
+ };
14663
+ }
14664
+
14735
14665
  function Writable(options) {
14736
14666
  Duplex = Duplex || require('./_stream_duplex');
14737
14667
 
14738
- // Writable ctor is applied to Duplexes, though they're not
14739
- // instanceof Writable, they're instanceof Readable.
14740
- if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
14668
+ // Writable ctor is applied to Duplexes, too.
14669
+ // `realHasInstance` is necessary because using plain `instanceof`
14670
+ // would return false, as no `_writableState` property is attached.
14671
+
14672
+ // Trying to use the custom `instanceof` for Writable here will also break the
14673
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
14674
+ // `_writableState` that would lead to infinite recursion.
14675
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
14676
+ return new Writable(options);
14677
+ }
14741
14678
 
14742
14679
  this._writableState = new WritableState(options, this);
14743
14680
 
@@ -14765,20 +14702,16 @@ function writeAfterEnd(stream, cb) {
14765
14702
  processNextTick(cb, er);
14766
14703
  }
14767
14704
 
14768
- // If we get something that is not a buffer, string, null, or undefined,
14769
- // and we're not in objectMode, then that's an error.
14770
- // Otherwise stream chunks are all considered to be of length=1, and the
14771
- // watermarks determine how many objects to keep in the buffer, rather than
14772
- // how many bytes or characters.
14705
+ // Checks that a user-supplied chunk is valid, especially for the particular
14706
+ // mode the stream is in. Currently this means that `null` is never accepted
14707
+ // and undefined/non-string values are only allowed in object mode.
14773
14708
  function validChunk(stream, state, chunk, cb) {
14774
14709
  var valid = true;
14775
14710
  var er = false;
14776
- // Always throw error if a null is written
14777
- // if we are not in object mode then throw
14778
- // if it is not a buffer, string, or undefined.
14711
+
14779
14712
  if (chunk === null) {
14780
14713
  er = new TypeError('May not write null values to stream');
14781
- } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
14714
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
14782
14715
  er = new TypeError('Invalid non-string/buffer chunk');
14783
14716
  }
14784
14717
  if (er) {
@@ -14792,19 +14725,20 @@ function validChunk(stream, state, chunk, cb) {
14792
14725
  Writable.prototype.write = function (chunk, encoding, cb) {
14793
14726
  var state = this._writableState;
14794
14727
  var ret = false;
14728
+ var isBuf = Buffer.isBuffer(chunk);
14795
14729
 
14796
14730
  if (typeof encoding === 'function') {
14797
14731
  cb = encoding;
14798
14732
  encoding = null;
14799
14733
  }
14800
14734
 
14801
- if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
14735
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
14802
14736
 
14803
14737
  if (typeof cb !== 'function') cb = nop;
14804
14738
 
14805
- if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
14739
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
14806
14740
  state.pendingcb++;
14807
- ret = writeOrBuffer(this, state, chunk, encoding, cb);
14741
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
14808
14742
  }
14809
14743
 
14810
14744
  return ret;
@@ -14836,7 +14770,7 @@ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
14836
14770
 
14837
14771
  function decodeChunk(state, chunk, encoding) {
14838
14772
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
14839
- chunk = bufferShim.from(chunk, encoding);
14773
+ chunk = Buffer.from(chunk, encoding);
14840
14774
  }
14841
14775
  return chunk;
14842
14776
  }
@@ -14844,10 +14778,11 @@ function decodeChunk(state, chunk, encoding) {
14844
14778
  // if we're already writing something, then just put this
14845
14779
  // in the queue, and wait our turn. Otherwise, call _write
14846
14780
  // If we return false, then we need a drain event, so set that flag.
14847
- function writeOrBuffer(stream, state, chunk, encoding, cb) {
14848
- chunk = decodeChunk(state, chunk, encoding);
14849
-
14850
- if (Buffer.isBuffer(chunk)) encoding = 'buffer';
14781
+ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
14782
+ if (!isBuf) {
14783
+ chunk = decodeChunk(state, chunk, encoding);
14784
+ if (Buffer.isBuffer(chunk)) encoding = 'buffer';
14785
+ }
14851
14786
  var len = state.objectMode ? 1 : chunk.length;
14852
14787
 
14853
14788
  state.length += len;
@@ -14916,8 +14851,8 @@ function onwrite(stream, er) {
14916
14851
  asyncWrite(afterWrite, stream, state, finished, cb);
14917
14852
  /*</replacement>*/
14918
14853
  } else {
14919
- afterWrite(stream, state, finished, cb);
14920
- }
14854
+ afterWrite(stream, state, finished, cb);
14855
+ }
14921
14856
  }
14922
14857
  }
14923
14858
 
@@ -14997,7 +14932,7 @@ function clearBuffer(stream, state) {
14997
14932
  }
14998
14933
 
14999
14934
  Writable.prototype._write = function (chunk, encoding, cb) {
15000
- cb(new Error('not implemented'));
14935
+ cb(new Error('_write() is not implemented'));
15001
14936
  };
15002
14937
 
15003
14938
  Writable.prototype._writev = null;
@@ -15068,7 +15003,6 @@ function CorkedRequest(state) {
15068
15003
 
15069
15004
  this.next = null;
15070
15005
  this.entry = null;
15071
-
15072
15006
  this.finish = function (err) {
15073
15007
  var entry = _this.entry;
15074
15008
  _this.entry = null;
@@ -15086,12 +15020,12 @@ function CorkedRequest(state) {
15086
15020
  };
15087
15021
  }
15088
15022
  }).call(this,require('_process'))
15089
- },{"./_stream_duplex":84,"_process":82,"buffer":44,"buffer-shims":43,"core-util-is":45,"events":63,"inherits":66,"process-nextick-args":81,"util-deprecate":96}],89:[function(require,module,exports){
15023
+ },{"./_stream_duplex":83,"./internal/streams/stream":89,"_process":81,"core-util-is":44,"inherits":65,"process-nextick-args":80,"safe-buffer":94,"util-deprecate":98}],88:[function(require,module,exports){
15090
15024
  'use strict';
15091
15025
 
15092
- var Buffer = require('buffer').Buffer;
15093
15026
  /*<replacement>*/
15094
- var bufferShim = require('buffer-shims');
15027
+
15028
+ var Buffer = require('safe-buffer').Buffer;
15095
15029
  /*</replacement>*/
15096
15030
 
15097
15031
  module.exports = BufferList;
@@ -15139,9 +15073,9 @@ BufferList.prototype.join = function (s) {
15139
15073
  };
15140
15074
 
15141
15075
  BufferList.prototype.concat = function (n) {
15142
- if (this.length === 0) return bufferShim.alloc(0);
15076
+ if (this.length === 0) return Buffer.alloc(0);
15143
15077
  if (this.length === 1) return this.head.data;
15144
- var ret = bufferShim.allocUnsafe(n >>> 0);
15078
+ var ret = Buffer.allocUnsafe(n >>> 0);
15145
15079
  var p = this.head;
15146
15080
  var i = 0;
15147
15081
  while (p) {
@@ -15151,36 +15085,31 @@ BufferList.prototype.concat = function (n) {
15151
15085
  }
15152
15086
  return ret;
15153
15087
  };
15154
- },{"buffer":44,"buffer-shims":43}],90:[function(require,module,exports){
15155
- module.exports = require("./lib/_stream_passthrough.js")
15088
+ },{"safe-buffer":94}],89:[function(require,module,exports){
15089
+ module.exports = require('events').EventEmitter;
15156
15090
 
15157
- },{"./lib/_stream_passthrough.js":85}],91:[function(require,module,exports){
15158
- (function (process){
15159
- var Stream = (function (){
15160
- try {
15161
- return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
15162
- } catch(_){}
15163
- }());
15091
+ },{"events":62}],90:[function(require,module,exports){
15092
+ module.exports = require('./readable').PassThrough
15093
+
15094
+ },{"./readable":91}],91:[function(require,module,exports){
15164
15095
  exports = module.exports = require('./lib/_stream_readable.js');
15165
- exports.Stream = Stream || exports;
15096
+ exports.Stream = exports;
15166
15097
  exports.Readable = exports;
15167
15098
  exports.Writable = require('./lib/_stream_writable.js');
15168
15099
  exports.Duplex = require('./lib/_stream_duplex.js');
15169
15100
  exports.Transform = require('./lib/_stream_transform.js');
15170
15101
  exports.PassThrough = require('./lib/_stream_passthrough.js');
15171
15102
 
15172
- if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
15173
- module.exports = Stream;
15174
- }
15103
+ },{"./lib/_stream_duplex.js":83,"./lib/_stream_passthrough.js":84,"./lib/_stream_readable.js":85,"./lib/_stream_transform.js":86,"./lib/_stream_writable.js":87}],92:[function(require,module,exports){
15104
+ module.exports = require('./readable').Transform
15175
15105
 
15176
- }).call(this,require('_process'))
15177
- },{"./lib/_stream_duplex.js":84,"./lib/_stream_passthrough.js":85,"./lib/_stream_readable.js":86,"./lib/_stream_transform.js":87,"./lib/_stream_writable.js":88,"_process":82}],92:[function(require,module,exports){
15178
- module.exports = require("./lib/_stream_transform.js")
15106
+ },{"./readable":91}],93:[function(require,module,exports){
15107
+ module.exports = require('./lib/_stream_writable.js');
15179
15108
 
15180
- },{"./lib/_stream_transform.js":87}],93:[function(require,module,exports){
15181
- module.exports = require("./lib/_stream_writable.js")
15109
+ },{"./lib/_stream_writable.js":87}],94:[function(require,module,exports){
15110
+ module.exports = require('buffer')
15182
15111
 
15183
- },{"./lib/_stream_writable.js":88}],94:[function(require,module,exports){
15112
+ },{"buffer":43}],95:[function(require,module,exports){
15184
15113
  // Copyright Joyent, Inc. and other Node contributors.
15185
15114
  //
15186
15115
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -15309,230 +15238,344 @@ Stream.prototype.pipe = function(dest, options) {
15309
15238
  return dest;
15310
15239
  };
15311
15240
 
15312
- },{"events":63,"inherits":66,"readable-stream/duplex.js":83,"readable-stream/passthrough.js":90,"readable-stream/readable.js":91,"readable-stream/transform.js":92,"readable-stream/writable.js":93}],95:[function(require,module,exports){
15313
- // Copyright Joyent, Inc. and other Node contributors.
15314
- //
15315
- // Permission is hereby granted, free of charge, to any person obtaining a
15316
- // copy of this software and associated documentation files (the
15317
- // "Software"), to deal in the Software without restriction, including
15318
- // without limitation the rights to use, copy, modify, merge, publish,
15319
- // distribute, sublicense, and/or sell copies of the Software, and to permit
15320
- // persons to whom the Software is furnished to do so, subject to the
15321
- // following conditions:
15322
- //
15323
- // The above copyright notice and this permission notice shall be included
15324
- // in all copies or substantial portions of the Software.
15325
- //
15326
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15327
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15328
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
15329
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15330
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15331
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
15332
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
15333
-
15334
- var Buffer = require('buffer').Buffer;
15241
+ },{"events":62,"inherits":65,"readable-stream/duplex.js":82,"readable-stream/passthrough.js":90,"readable-stream/readable.js":91,"readable-stream/transform.js":92,"readable-stream/writable.js":93}],96:[function(require,module,exports){
15242
+ 'use strict';
15335
15243
 
15336
- var isBufferEncoding = Buffer.isEncoding
15337
- || function(encoding) {
15338
- switch (encoding && encoding.toLowerCase()) {
15339
- case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
15340
- default: return false;
15341
- }
15342
- }
15244
+ var Buffer = require('safe-buffer').Buffer;
15343
15245
 
15246
+ var isEncoding = Buffer.isEncoding || function (encoding) {
15247
+ encoding = '' + encoding;
15248
+ switch (encoding && encoding.toLowerCase()) {
15249
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
15250
+ return true;
15251
+ default:
15252
+ return false;
15253
+ }
15254
+ };
15344
15255
 
15345
- function assertEncoding(encoding) {
15346
- if (encoding && !isBufferEncoding(encoding)) {
15347
- throw new Error('Unknown encoding: ' + encoding);
15256
+ function _normalizeEncoding(enc) {
15257
+ if (!enc) return 'utf8';
15258
+ var retried;
15259
+ while (true) {
15260
+ switch (enc) {
15261
+ case 'utf8':
15262
+ case 'utf-8':
15263
+ return 'utf8';
15264
+ case 'ucs2':
15265
+ case 'ucs-2':
15266
+ case 'utf16le':
15267
+ case 'utf-16le':
15268
+ return 'utf16le';
15269
+ case 'latin1':
15270
+ case 'binary':
15271
+ return 'latin1';
15272
+ case 'base64':
15273
+ case 'ascii':
15274
+ case 'hex':
15275
+ return enc;
15276
+ default:
15277
+ if (retried) return; // undefined
15278
+ enc = ('' + enc).toLowerCase();
15279
+ retried = true;
15280
+ }
15348
15281
  }
15282
+ };
15283
+
15284
+ // Do not cache `Buffer.isEncoding` when checking encoding names as some
15285
+ // modules monkey-patch it to support additional encodings
15286
+ function normalizeEncoding(enc) {
15287
+ var nenc = _normalizeEncoding(enc);
15288
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
15289
+ return nenc || enc;
15349
15290
  }
15350
15291
 
15351
15292
  // StringDecoder provides an interface for efficiently splitting a series of
15352
15293
  // buffers into a series of JS strings without breaking apart multi-byte
15353
- // characters. CESU-8 is handled as part of the UTF-8 encoding.
15354
- //
15355
- // @TODO Handling all encodings inside a single object makes it very difficult
15356
- // to reason about this code, so it should be split up in the future.
15357
- // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
15358
- // points as used by CESU-8.
15359
- var StringDecoder = exports.StringDecoder = function(encoding) {
15360
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
15361
- assertEncoding(encoding);
15294
+ // characters.
15295
+ exports.StringDecoder = StringDecoder;
15296
+ function StringDecoder(encoding) {
15297
+ this.encoding = normalizeEncoding(encoding);
15298
+ var nb;
15362
15299
  switch (this.encoding) {
15363
- case 'utf8':
15364
- // CESU-8 represents each of Surrogate Pair by 3-bytes
15365
- this.surrogateSize = 3;
15366
- break;
15367
- case 'ucs2':
15368
15300
  case 'utf16le':
15369
- // UTF-16 represents each of Surrogate Pair by 2-bytes
15370
- this.surrogateSize = 2;
15371
- this.detectIncompleteChar = utf16DetectIncompleteChar;
15301
+ this.text = utf16Text;
15302
+ this.end = utf16End;
15303
+ nb = 4;
15304
+ break;
15305
+ case 'utf8':
15306
+ this.fillLast = utf8FillLast;
15307
+ nb = 4;
15372
15308
  break;
15373
15309
  case 'base64':
15374
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
15375
- this.surrogateSize = 3;
15376
- this.detectIncompleteChar = base64DetectIncompleteChar;
15310
+ this.text = base64Text;
15311
+ this.end = base64End;
15312
+ nb = 3;
15377
15313
  break;
15378
15314
  default:
15379
- this.write = passThroughWrite;
15315
+ this.write = simpleWrite;
15316
+ this.end = simpleEnd;
15380
15317
  return;
15381
15318
  }
15319
+ this.lastNeed = 0;
15320
+ this.lastTotal = 0;
15321
+ this.lastChar = Buffer.allocUnsafe(nb);
15322
+ }
15382
15323
 
15383
- // Enough space to store all bytes of a single character. UTF-8 needs 4
15384
- // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
15385
- this.charBuffer = new Buffer(6);
15386
- // Number of bytes received for the current incomplete multi-byte character.
15387
- this.charReceived = 0;
15388
- // Number of bytes expected for the current incomplete multi-byte character.
15389
- this.charLength = 0;
15324
+ StringDecoder.prototype.write = function (buf) {
15325
+ if (buf.length === 0) return '';
15326
+ var r;
15327
+ var i;
15328
+ if (this.lastNeed) {
15329
+ r = this.fillLast(buf);
15330
+ if (r === undefined) return '';
15331
+ i = this.lastNeed;
15332
+ this.lastNeed = 0;
15333
+ } else {
15334
+ i = 0;
15335
+ }
15336
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
15337
+ return r || '';
15390
15338
  };
15391
15339
 
15340
+ StringDecoder.prototype.end = utf8End;
15392
15341
 
15393
- // write decodes the given buffer and returns it as JS string that is
15394
- // guaranteed to not contain any partial multi-byte characters. Any partial
15395
- // character found at the end of the buffer is buffered up, and will be
15396
- // returned when calling write again with the remaining bytes.
15397
- //
15398
- // Note: Converting a Buffer containing an orphan surrogate to a String
15399
- // currently works, but converting a String to a Buffer (via `new Buffer`, or
15400
- // Buffer#write) will replace incomplete surrogates with the unicode
15401
- // replacement character. See https://codereview.chromium.org/121173009/ .
15402
- StringDecoder.prototype.write = function(buffer) {
15403
- var charStr = '';
15404
- // if our last write ended with an incomplete multibyte character
15405
- while (this.charLength) {
15406
- // determine how many remaining bytes this buffer has to offer for this char
15407
- var available = (buffer.length >= this.charLength - this.charReceived) ?
15408
- this.charLength - this.charReceived :
15409
- buffer.length;
15410
-
15411
- // add the new bytes to the char buffer
15412
- buffer.copy(this.charBuffer, this.charReceived, 0, available);
15413
- this.charReceived += available;
15414
-
15415
- if (this.charReceived < this.charLength) {
15416
- // still not enough chars in this buffer? wait for more ...
15417
- return '';
15418
- }
15419
-
15420
- // remove bytes belonging to the current character from the buffer
15421
- buffer = buffer.slice(available, buffer.length);
15422
-
15423
- // get the character that was split
15424
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
15425
-
15426
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
15427
- var charCode = charStr.charCodeAt(charStr.length - 1);
15428
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
15429
- this.charLength += this.surrogateSize;
15430
- charStr = '';
15431
- continue;
15432
- }
15433
- this.charReceived = this.charLength = 0;
15342
+ // Returns only complete characters in a Buffer
15343
+ StringDecoder.prototype.text = utf8Text;
15434
15344
 
15435
- // if there are no more bytes in this buffer, just emit our char
15436
- if (buffer.length === 0) {
15437
- return charStr;
15438
- }
15439
- break;
15345
+ // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
15346
+ StringDecoder.prototype.fillLast = function (buf) {
15347
+ if (this.lastNeed <= buf.length) {
15348
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
15349
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
15440
15350
  }
15351
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
15352
+ this.lastNeed -= buf.length;
15353
+ };
15441
15354
 
15442
- // determine and set charLength / charReceived
15443
- this.detectIncompleteChar(buffer);
15355
+ // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
15356
+ // continuation byte.
15357
+ function utf8CheckByte(byte) {
15358
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
15359
+ return -1;
15360
+ }
15444
15361
 
15445
- var end = buffer.length;
15446
- if (this.charLength) {
15447
- // buffer the incomplete character bytes we got
15448
- buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
15449
- end -= this.charReceived;
15362
+ // Checks at most 3 bytes at the end of a Buffer in order to detect an
15363
+ // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
15364
+ // needed to complete the UTF-8 character (if applicable) are returned.
15365
+ function utf8CheckIncomplete(self, buf, i) {
15366
+ var j = buf.length - 1;
15367
+ if (j < i) return 0;
15368
+ var nb = utf8CheckByte(buf[j]);
15369
+ if (nb >= 0) {
15370
+ if (nb > 0) self.lastNeed = nb - 1;
15371
+ return nb;
15450
15372
  }
15373
+ if (--j < i) return 0;
15374
+ nb = utf8CheckByte(buf[j]);
15375
+ if (nb >= 0) {
15376
+ if (nb > 0) self.lastNeed = nb - 2;
15377
+ return nb;
15378
+ }
15379
+ if (--j < i) return 0;
15380
+ nb = utf8CheckByte(buf[j]);
15381
+ if (nb >= 0) {
15382
+ if (nb > 0) {
15383
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
15384
+ }
15385
+ return nb;
15386
+ }
15387
+ return 0;
15388
+ }
15451
15389
 
15452
- charStr += buffer.toString(this.encoding, 0, end);
15453
-
15454
- var end = charStr.length - 1;
15455
- var charCode = charStr.charCodeAt(end);
15456
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
15457
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
15458
- var size = this.surrogateSize;
15459
- this.charLength += size;
15460
- this.charReceived += size;
15461
- this.charBuffer.copy(this.charBuffer, size, 0, size);
15462
- buffer.copy(this.charBuffer, 0, 0, size);
15463
- return charStr.substring(0, end);
15390
+ // Validates as many continuation bytes for a multi-byte UTF-8 character as
15391
+ // needed or are available. If we see a non-continuation byte where we expect
15392
+ // one, we "replace" the validated continuation bytes we've seen so far with
15393
+ // UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
15394
+ // behavior. The continuation byte check is included three times in the case
15395
+ // where all of the continuation bytes for a character exist in the same buffer.
15396
+ // It is also done this way as a slight performance increase instead of using a
15397
+ // loop.
15398
+ function utf8CheckExtraBytes(self, buf, p) {
15399
+ if ((buf[0] & 0xC0) !== 0x80) {
15400
+ self.lastNeed = 0;
15401
+ return '\ufffd'.repeat(p);
15402
+ }
15403
+ if (self.lastNeed > 1 && buf.length > 1) {
15404
+ if ((buf[1] & 0xC0) !== 0x80) {
15405
+ self.lastNeed = 1;
15406
+ return '\ufffd'.repeat(p + 1);
15407
+ }
15408
+ if (self.lastNeed > 2 && buf.length > 2) {
15409
+ if ((buf[2] & 0xC0) !== 0x80) {
15410
+ self.lastNeed = 2;
15411
+ return '\ufffd'.repeat(p + 2);
15412
+ }
15413
+ }
15464
15414
  }
15415
+ }
15465
15416
 
15466
- // or just emit the charStr
15467
- return charStr;
15468
- };
15417
+ // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
15418
+ function utf8FillLast(buf) {
15419
+ var p = this.lastTotal - this.lastNeed;
15420
+ var r = utf8CheckExtraBytes(this, buf, p);
15421
+ if (r !== undefined) return r;
15422
+ if (this.lastNeed <= buf.length) {
15423
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
15424
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
15425
+ }
15426
+ buf.copy(this.lastChar, p, 0, buf.length);
15427
+ this.lastNeed -= buf.length;
15428
+ }
15429
+
15430
+ // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
15431
+ // partial character, the character's bytes are buffered until the required
15432
+ // number of bytes are available.
15433
+ function utf8Text(buf, i) {
15434
+ var total = utf8CheckIncomplete(this, buf, i);
15435
+ if (!this.lastNeed) return buf.toString('utf8', i);
15436
+ this.lastTotal = total;
15437
+ var end = buf.length - (total - this.lastNeed);
15438
+ buf.copy(this.lastChar, 0, end);
15439
+ return buf.toString('utf8', i, end);
15440
+ }
15441
+
15442
+ // For UTF-8, a replacement character for each buffered byte of a (partial)
15443
+ // character needs to be added to the output.
15444
+ function utf8End(buf) {
15445
+ var r = buf && buf.length ? this.write(buf) : '';
15446
+ if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
15447
+ return r;
15448
+ }
15449
+
15450
+ // UTF-16LE typically needs two bytes per character, but even if we have an even
15451
+ // number of bytes available, we need to check if we end on a leading/high
15452
+ // surrogate. In that case, we need to wait for the next two bytes in order to
15453
+ // decode the last character properly.
15454
+ function utf16Text(buf, i) {
15455
+ if ((buf.length - i) % 2 === 0) {
15456
+ var r = buf.toString('utf16le', i);
15457
+ if (r) {
15458
+ var c = r.charCodeAt(r.length - 1);
15459
+ if (c >= 0xD800 && c <= 0xDBFF) {
15460
+ this.lastNeed = 2;
15461
+ this.lastTotal = 4;
15462
+ this.lastChar[0] = buf[buf.length - 2];
15463
+ this.lastChar[1] = buf[buf.length - 1];
15464
+ return r.slice(0, -1);
15465
+ }
15466
+ }
15467
+ return r;
15468
+ }
15469
+ this.lastNeed = 1;
15470
+ this.lastTotal = 2;
15471
+ this.lastChar[0] = buf[buf.length - 1];
15472
+ return buf.toString('utf16le', i, buf.length - 1);
15473
+ }
15469
15474
 
15470
- // detectIncompleteChar determines if there is an incomplete UTF-8 character at
15471
- // the end of the given buffer. If so, it sets this.charLength to the byte
15472
- // length that character, and sets this.charReceived to the number of bytes
15473
- // that are available for this character.
15474
- StringDecoder.prototype.detectIncompleteChar = function(buffer) {
15475
- // determine how many bytes we have to check at the end of this buffer
15476
- var i = (buffer.length >= 3) ? 3 : buffer.length;
15475
+ // For UTF-16LE we do not explicitly append special replacement characters if we
15476
+ // end on a partial character, we simply let v8 handle that.
15477
+ function utf16End(buf) {
15478
+ var r = buf && buf.length ? this.write(buf) : '';
15479
+ if (this.lastNeed) {
15480
+ var end = this.lastTotal - this.lastNeed;
15481
+ return r + this.lastChar.toString('utf16le', 0, end);
15482
+ }
15483
+ return r;
15484
+ }
15477
15485
 
15478
- // Figure out if one of the last i bytes of our buffer announces an
15479
- // incomplete char.
15480
- for (; i > 0; i--) {
15481
- var c = buffer[buffer.length - i];
15486
+ function base64Text(buf, i) {
15487
+ var n = (buf.length - i) % 3;
15488
+ if (n === 0) return buf.toString('base64', i);
15489
+ this.lastNeed = 3 - n;
15490
+ this.lastTotal = 3;
15491
+ if (n === 1) {
15492
+ this.lastChar[0] = buf[buf.length - 1];
15493
+ } else {
15494
+ this.lastChar[0] = buf[buf.length - 2];
15495
+ this.lastChar[1] = buf[buf.length - 1];
15496
+ }
15497
+ return buf.toString('base64', i, buf.length - n);
15498
+ }
15482
15499
 
15483
- // See http://en.wikipedia.org/wiki/UTF-8#Description
15500
+ function base64End(buf) {
15501
+ var r = buf && buf.length ? this.write(buf) : '';
15502
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
15503
+ return r;
15504
+ }
15484
15505
 
15485
- // 110XXXXX
15486
- if (i == 1 && c >> 5 == 0x06) {
15487
- this.charLength = 2;
15488
- break;
15489
- }
15506
+ // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
15507
+ function simpleWrite(buf) {
15508
+ return buf.toString(this.encoding);
15509
+ }
15490
15510
 
15491
- // 1110XXXX
15492
- if (i <= 2 && c >> 4 == 0x0E) {
15493
- this.charLength = 3;
15494
- break;
15495
- }
15511
+ function simpleEnd(buf) {
15512
+ return buf && buf.length ? this.write(buf) : '';
15513
+ }
15514
+ },{"safe-buffer":97}],97:[function(require,module,exports){
15515
+ /* eslint-disable node/no-deprecated-api */
15516
+ var buffer = require('buffer')
15517
+ var Buffer = buffer.Buffer
15496
15518
 
15497
- // 11110XXX
15498
- if (i <= 3 && c >> 3 == 0x1E) {
15499
- this.charLength = 4;
15500
- break;
15501
- }
15519
+ // alternative to using Object.keys for old browsers
15520
+ function copyProps (src, dst) {
15521
+ for (var key in src) {
15522
+ dst[key] = src[key]
15502
15523
  }
15503
- this.charReceived = i;
15504
- };
15524
+ }
15525
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
15526
+ module.exports = buffer
15527
+ } else {
15528
+ // Copy properties from require('buffer')
15529
+ copyProps(buffer, exports)
15530
+ exports.Buffer = SafeBuffer
15531
+ }
15505
15532
 
15506
- StringDecoder.prototype.end = function(buffer) {
15507
- var res = '';
15508
- if (buffer && buffer.length)
15509
- res = this.write(buffer);
15533
+ function SafeBuffer (arg, encodingOrOffset, length) {
15534
+ return Buffer(arg, encodingOrOffset, length)
15535
+ }
15510
15536
 
15511
- if (this.charReceived) {
15512
- var cr = this.charReceived;
15513
- var buf = this.charBuffer;
15514
- var enc = this.encoding;
15515
- res += buf.slice(0, cr).toString(enc);
15516
- }
15537
+ // Copy static methods from Buffer
15538
+ copyProps(Buffer, SafeBuffer)
15517
15539
 
15518
- return res;
15519
- };
15540
+ SafeBuffer.from = function (arg, encodingOrOffset, length) {
15541
+ if (typeof arg === 'number') {
15542
+ throw new TypeError('Argument must not be a number')
15543
+ }
15544
+ return Buffer(arg, encodingOrOffset, length)
15545
+ }
15520
15546
 
15521
- function passThroughWrite(buffer) {
15522
- return buffer.toString(this.encoding);
15547
+ SafeBuffer.alloc = function (size, fill, encoding) {
15548
+ if (typeof size !== 'number') {
15549
+ throw new TypeError('Argument must be a number')
15550
+ }
15551
+ var buf = Buffer(size)
15552
+ if (fill !== undefined) {
15553
+ if (typeof encoding === 'string') {
15554
+ buf.fill(fill, encoding)
15555
+ } else {
15556
+ buf.fill(fill)
15557
+ }
15558
+ } else {
15559
+ buf.fill(0)
15560
+ }
15561
+ return buf
15523
15562
  }
15524
15563
 
15525
- function utf16DetectIncompleteChar(buffer) {
15526
- this.charReceived = buffer.length % 2;
15527
- this.charLength = this.charReceived ? 2 : 0;
15564
+ SafeBuffer.allocUnsafe = function (size) {
15565
+ if (typeof size !== 'number') {
15566
+ throw new TypeError('Argument must be a number')
15567
+ }
15568
+ return Buffer(size)
15528
15569
  }
15529
15570
 
15530
- function base64DetectIncompleteChar(buffer) {
15531
- this.charReceived = buffer.length % 3;
15532
- this.charLength = this.charReceived ? 3 : 0;
15571
+ SafeBuffer.allocUnsafeSlow = function (size) {
15572
+ if (typeof size !== 'number') {
15573
+ throw new TypeError('Argument must be a number')
15574
+ }
15575
+ return buffer.SlowBuffer(size)
15533
15576
  }
15534
15577
 
15535
- },{"buffer":44}],96:[function(require,module,exports){
15578
+ },{"buffer":43}],98:[function(require,module,exports){
15536
15579
  (function (global){
15537
15580
 
15538
15581
  /**
@@ -15603,16 +15646,16 @@ function config (name) {
15603
15646
  }
15604
15647
 
15605
15648
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15606
- },{}],97:[function(require,module,exports){
15607
- arguments[4][66][0].apply(exports,arguments)
15608
- },{"dup":66}],98:[function(require,module,exports){
15649
+ },{}],99:[function(require,module,exports){
15650
+ arguments[4][65][0].apply(exports,arguments)
15651
+ },{"dup":65}],100:[function(require,module,exports){
15609
15652
  module.exports = function isBuffer(arg) {
15610
15653
  return arg && typeof arg === 'object'
15611
15654
  && typeof arg.copy === 'function'
15612
15655
  && typeof arg.fill === 'function'
15613
15656
  && typeof arg.readUInt8 === 'function';
15614
15657
  }
15615
- },{}],99:[function(require,module,exports){
15658
+ },{}],101:[function(require,module,exports){
15616
15659
  (function (process,global){
15617
15660
  // Copyright Joyent, Inc. and other Node contributors.
15618
15661
  //
@@ -16202,4 +16245,4 @@ function hasOwnProperty(obj, prop) {
16202
16245
  }
16203
16246
 
16204
16247
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16205
- },{"./support/isBuffer":98,"_process":82,"inherits":97}]},{},[1]);
16248
+ },{"./support/isBuffer":100,"_process":81,"inherits":99}]},{},[1]);