msgpack5 6.0.0 → 6.0.1

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/dist/msgpack5.js CHANGED
@@ -91,7 +91,7 @@ function msgpack (options) {
91
91
 
92
92
  module.exports = msgpack
93
93
 
94
- },{"./lib/codecs/DateCodec":2,"./lib/decoder":3,"./lib/encoder":4,"./lib/helpers.js":5,"./lib/streams":6,"assert":7,"bl":14,"safe-buffer":51}],2:[function(require,module,exports){
94
+ },{"./lib/codecs/DateCodec":2,"./lib/decoder":3,"./lib/encoder":4,"./lib/helpers.js":5,"./lib/streams":6,"assert":7,"bl":14,"safe-buffer":52}],2:[function(require,module,exports){
95
95
  (function (Buffer){(function (){
96
96
  const type = -1
97
97
 
@@ -775,7 +775,7 @@ function encodeNumber (obj, options) {
775
775
  // return n
776
776
  // }
777
777
 
778
- },{"./helpers.js":5,"bl":14,"safe-buffer":51}],5:[function(require,module,exports){
778
+ },{"./helpers.js":5,"bl":14,"safe-buffer":52}],5:[function(require,module,exports){
779
779
  'use strict'
780
780
 
781
781
  const util = require('util')
@@ -797,7 +797,7 @@ exports.isFloat = function isFloat (n) {
797
797
  return n % 1 !== 0
798
798
  }
799
799
 
800
- },{"util":56}],6:[function(require,module,exports){
800
+ },{"util":58}],6:[function(require,module,exports){
801
801
  'use strict'
802
802
 
803
803
  const Transform = require('readable-stream').Transform
@@ -889,7 +889,7 @@ Decoder.prototype._transform = function (buf, enc, done) {
889
889
  module.exports.decoder = Decoder
890
890
  module.exports.encoder = Encoder
891
891
 
892
- },{"bl":14,"inherits":30,"readable-stream":50}],7:[function(require,module,exports){
892
+ },{"bl":14,"inherits":30,"readable-stream":51}],7:[function(require,module,exports){
893
893
  (function (global){(function (){
894
894
  'use strict';
895
895
 
@@ -1399,7 +1399,7 @@ var objectKeys = Object.keys || function (obj) {
1399
1399
  };
1400
1400
 
1401
1401
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1402
- },{"object-assign":34,"util/":10}],8:[function(require,module,exports){
1402
+ },{"object-assign":35,"util/":10}],8:[function(require,module,exports){
1403
1403
  if (typeof Object.create === 'function') {
1404
1404
  // implementation from standard node.js 'util' module
1405
1405
  module.exports = function inherits(ctor, superCtor) {
@@ -2021,7 +2021,7 @@ function hasOwnProperty(obj, prop) {
2021
2021
  }
2022
2022
 
2023
2023
  }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2024
- },{"./support/isBuffer":9,"_process":35,"inherits":8}],11:[function(require,module,exports){
2024
+ },{"./support/isBuffer":9,"_process":36,"inherits":8}],11:[function(require,module,exports){
2025
2025
  (function (global){(function (){
2026
2026
  'use strict';
2027
2027
 
@@ -2688,7 +2688,7 @@ module.exports = BufferListStream
2688
2688
  module.exports.BufferListStream = BufferListStream
2689
2689
  module.exports.BufferList = BufferList
2690
2690
 
2691
- },{"./BufferList":13,"inherits":30,"readable-stream":50}],15:[function(require,module,exports){
2691
+ },{"./BufferList":13,"inherits":30,"readable-stream":51}],15:[function(require,module,exports){
2692
2692
 
2693
2693
  },{}],16:[function(require,module,exports){
2694
2694
  (function (Buffer){(function (){
@@ -5054,30 +5054,70 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
5054
5054
  }
5055
5055
 
5056
5056
  },{}],21:[function(require,module,exports){
5057
+ 'use strict';
5057
5058
 
5058
- var hasOwn = Object.prototype.hasOwnProperty;
5059
- var toString = Object.prototype.toString;
5059
+ var isCallable = require('is-callable');
5060
5060
 
5061
- module.exports = function forEach (obj, fn, ctx) {
5062
- if (toString.call(fn) !== '[object Function]') {
5063
- throw new TypeError('iterator must be a function');
5061
+ var toStr = Object.prototype.toString;
5062
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
5063
+
5064
+ var forEachArray = function forEachArray(array, iterator, receiver) {
5065
+ for (var i = 0, len = array.length; i < len; i++) {
5066
+ if (hasOwnProperty.call(array, i)) {
5067
+ if (receiver == null) {
5068
+ iterator(array[i], i, array);
5069
+ } else {
5070
+ iterator.call(receiver, array[i], i, array);
5071
+ }
5072
+ }
5064
5073
  }
5065
- var l = obj.length;
5066
- if (l === +l) {
5067
- for (var i = 0; i < l; i++) {
5068
- fn.call(ctx, obj[i], i, obj);
5074
+ };
5075
+
5076
+ var forEachString = function forEachString(string, iterator, receiver) {
5077
+ for (var i = 0, len = string.length; i < len; i++) {
5078
+ // no such thing as a sparse string.
5079
+ if (receiver == null) {
5080
+ iterator(string.charAt(i), i, string);
5081
+ } else {
5082
+ iterator.call(receiver, string.charAt(i), i, string);
5069
5083
  }
5070
- } else {
5071
- for (var k in obj) {
5072
- if (hasOwn.call(obj, k)) {
5073
- fn.call(ctx, obj[k], k, obj);
5084
+ }
5085
+ };
5086
+
5087
+ var forEachObject = function forEachObject(object, iterator, receiver) {
5088
+ for (var k in object) {
5089
+ if (hasOwnProperty.call(object, k)) {
5090
+ if (receiver == null) {
5091
+ iterator(object[k], k, object);
5092
+ } else {
5093
+ iterator.call(receiver, object[k], k, object);
5074
5094
  }
5075
5095
  }
5076
5096
  }
5077
5097
  };
5078
5098
 
5099
+ var forEach = function forEach(list, iterator, thisArg) {
5100
+ if (!isCallable(iterator)) {
5101
+ throw new TypeError('iterator must be a function');
5102
+ }
5103
+
5104
+ var receiver;
5105
+ if (arguments.length >= 3) {
5106
+ receiver = thisArg;
5107
+ }
5108
+
5109
+ if (toStr.call(list) === '[object Array]') {
5110
+ forEachArray(list, iterator, receiver);
5111
+ } else if (typeof list === 'string') {
5112
+ forEachString(list, iterator, receiver);
5113
+ } else {
5114
+ forEachObject(list, iterator, receiver);
5115
+ }
5116
+ };
5079
5117
 
5080
- },{}],22:[function(require,module,exports){
5118
+ module.exports = forEach;
5119
+
5120
+ },{"is-callable":32}],22:[function(require,module,exports){
5081
5121
  'use strict';
5082
5122
 
5083
5123
  /* eslint no-invalid-this: 1 */
@@ -5699,6 +5739,82 @@ module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArgum
5699
5739
  },{"call-bind/callBound":17,"has-tostringtag/shams":27}],32:[function(require,module,exports){
5700
5740
  'use strict';
5701
5741
 
5742
+ var fnToStr = Function.prototype.toString;
5743
+ var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
5744
+ var badArrayLike;
5745
+ var isCallableMarker;
5746
+ if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
5747
+ try {
5748
+ badArrayLike = Object.defineProperty({}, 'length', {
5749
+ get: function () {
5750
+ throw isCallableMarker;
5751
+ }
5752
+ });
5753
+ isCallableMarker = {};
5754
+ // eslint-disable-next-line no-throw-literal
5755
+ reflectApply(function () { throw 42; }, null, badArrayLike);
5756
+ } catch (_) {
5757
+ if (_ !== isCallableMarker) {
5758
+ reflectApply = null;
5759
+ }
5760
+ }
5761
+ } else {
5762
+ reflectApply = null;
5763
+ }
5764
+
5765
+ var constructorRegex = /^\s*class\b/;
5766
+ var isES6ClassFn = function isES6ClassFunction(value) {
5767
+ try {
5768
+ var fnStr = fnToStr.call(value);
5769
+ return constructorRegex.test(fnStr);
5770
+ } catch (e) {
5771
+ return false; // not a function
5772
+ }
5773
+ };
5774
+
5775
+ var tryFunctionObject = function tryFunctionToStr(value) {
5776
+ try {
5777
+ if (isES6ClassFn(value)) { return false; }
5778
+ fnToStr.call(value);
5779
+ return true;
5780
+ } catch (e) {
5781
+ return false;
5782
+ }
5783
+ };
5784
+ var toStr = Object.prototype.toString;
5785
+ var fnClass = '[object Function]';
5786
+ var genClass = '[object GeneratorFunction]';
5787
+ var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
5788
+ /* globals document: false */
5789
+ var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
5790
+
5791
+ module.exports = reflectApply
5792
+ ? function isCallable(value) {
5793
+ if (value === documentDotAll) { return true; }
5794
+ if (!value) { return false; }
5795
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
5796
+ if (typeof value === 'function' && !value.prototype) { return true; }
5797
+ try {
5798
+ reflectApply(value, null, badArrayLike);
5799
+ } catch (e) {
5800
+ if (e !== isCallableMarker) { return false; }
5801
+ }
5802
+ return !isES6ClassFn(value);
5803
+ }
5804
+ : function isCallable(value) {
5805
+ if (value === documentDotAll) { return true; }
5806
+ if (!value) { return false; }
5807
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
5808
+ if (typeof value === 'function' && !value.prototype) { return true; }
5809
+ if (hasToStringTag) { return tryFunctionObject(value); }
5810
+ if (isES6ClassFn(value)) { return false; }
5811
+ var strClass = toStr.call(value);
5812
+ return strClass === fnClass || strClass === genClass;
5813
+ };
5814
+
5815
+ },{}],33:[function(require,module,exports){
5816
+ 'use strict';
5817
+
5702
5818
  var toStr = Object.prototype.toString;
5703
5819
  var fnToStr = Function.prototype.toString;
5704
5820
  var isFnRegex = /^\s*(?:function)?\*/;
@@ -5736,11 +5852,11 @@ module.exports = function isGeneratorFunction(fn) {
5736
5852
  return getProto(fn) === GeneratorFunction;
5737
5853
  };
5738
5854
 
5739
- },{"has-tostringtag/shams":27}],33:[function(require,module,exports){
5855
+ },{"has-tostringtag/shams":27}],34:[function(require,module,exports){
5740
5856
  (function (global){(function (){
5741
5857
  'use strict';
5742
5858
 
5743
- var forEach = require('foreach');
5859
+ var forEach = require('for-each');
5744
5860
  var availableTypedArrays = require('available-typed-arrays');
5745
5861
  var callBound = require('call-bind/callBound');
5746
5862
 
@@ -5800,7 +5916,7 @@ module.exports = function isTypedArray(value) {
5800
5916
  };
5801
5917
 
5802
5918
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5803
- },{"available-typed-arrays":11,"call-bind/callBound":17,"es-abstract/helpers/getOwnPropertyDescriptor":19,"foreach":21,"has-tostringtag/shams":27}],34:[function(require,module,exports){
5919
+ },{"available-typed-arrays":11,"call-bind/callBound":17,"es-abstract/helpers/getOwnPropertyDescriptor":19,"for-each":21,"has-tostringtag/shams":27}],35:[function(require,module,exports){
5804
5920
  /*
5805
5921
  object-assign
5806
5922
  (c) Sindre Sorhus
@@ -5892,7 +6008,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
5892
6008
  return to;
5893
6009
  };
5894
6010
 
5895
- },{}],35:[function(require,module,exports){
6011
+ },{}],36:[function(require,module,exports){
5896
6012
  // shim for using process in browser
5897
6013
  var process = module.exports = {};
5898
6014
 
@@ -6078,7 +6194,7 @@ process.chdir = function (dir) {
6078
6194
  };
6079
6195
  process.umask = function() { return 0; };
6080
6196
 
6081
- },{}],36:[function(require,module,exports){
6197
+ },{}],37:[function(require,module,exports){
6082
6198
  'use strict';
6083
6199
 
6084
6200
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
@@ -6207,7 +6323,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
6207
6323
  createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
6208
6324
  module.exports.codes = codes;
6209
6325
 
6210
- },{}],37:[function(require,module,exports){
6326
+ },{}],38:[function(require,module,exports){
6211
6327
  (function (process){(function (){
6212
6328
  // Copyright Joyent, Inc. and other Node contributors.
6213
6329
  //
@@ -6349,7 +6465,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
6349
6465
  }
6350
6466
  });
6351
6467
  }).call(this)}).call(this,require('_process'))
6352
- },{"./_stream_readable":39,"./_stream_writable":41,"_process":35,"inherits":30}],38:[function(require,module,exports){
6468
+ },{"./_stream_readable":40,"./_stream_writable":42,"_process":36,"inherits":30}],39:[function(require,module,exports){
6353
6469
  // Copyright Joyent, Inc. and other Node contributors.
6354
6470
  //
6355
6471
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -6389,7 +6505,7 @@ function PassThrough(options) {
6389
6505
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
6390
6506
  cb(null, chunk);
6391
6507
  };
6392
- },{"./_stream_transform":40,"inherits":30}],39:[function(require,module,exports){
6508
+ },{"./_stream_transform":41,"inherits":30}],40:[function(require,module,exports){
6393
6509
  (function (process,global){(function (){
6394
6510
  // Copyright Joyent, Inc. and other Node contributors.
6395
6511
  //
@@ -7516,7 +7632,7 @@ function indexOf(xs, x) {
7516
7632
  return -1;
7517
7633
  }
7518
7634
  }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7519
- },{"../errors":36,"./_stream_duplex":37,"./internal/streams/async_iterator":42,"./internal/streams/buffer_list":43,"./internal/streams/destroy":44,"./internal/streams/from":46,"./internal/streams/state":48,"./internal/streams/stream":49,"_process":35,"buffer":16,"events":20,"inherits":30,"string_decoder/":52,"util":15}],40:[function(require,module,exports){
7635
+ },{"../errors":37,"./_stream_duplex":38,"./internal/streams/async_iterator":43,"./internal/streams/buffer_list":44,"./internal/streams/destroy":45,"./internal/streams/from":47,"./internal/streams/state":49,"./internal/streams/stream":50,"_process":36,"buffer":16,"events":20,"inherits":30,"string_decoder/":53,"util":15}],41:[function(require,module,exports){
7520
7636
  // Copyright Joyent, Inc. and other Node contributors.
7521
7637
  //
7522
7638
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -7718,7 +7834,7 @@ function done(stream, er, data) {
7718
7834
  if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
7719
7835
  return stream.push(null);
7720
7836
  }
7721
- },{"../errors":36,"./_stream_duplex":37,"inherits":30}],41:[function(require,module,exports){
7837
+ },{"../errors":37,"./_stream_duplex":38,"inherits":30}],42:[function(require,module,exports){
7722
7838
  (function (process,global){(function (){
7723
7839
  // Copyright Joyent, Inc. and other Node contributors.
7724
7840
  //
@@ -8418,7 +8534,7 @@ Writable.prototype._destroy = function (err, cb) {
8418
8534
  cb(err);
8419
8535
  };
8420
8536
  }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
8421
- },{"../errors":36,"./_stream_duplex":37,"./internal/streams/destroy":44,"./internal/streams/state":48,"./internal/streams/stream":49,"_process":35,"buffer":16,"inherits":30,"util-deprecate":53}],42:[function(require,module,exports){
8537
+ },{"../errors":37,"./_stream_duplex":38,"./internal/streams/destroy":45,"./internal/streams/state":49,"./internal/streams/stream":50,"_process":36,"buffer":16,"inherits":30,"util-deprecate":55}],43:[function(require,module,exports){
8422
8538
  (function (process){(function (){
8423
8539
  'use strict';
8424
8540
 
@@ -8628,7 +8744,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat
8628
8744
 
8629
8745
  module.exports = createReadableStreamAsyncIterator;
8630
8746
  }).call(this)}).call(this,require('_process'))
8631
- },{"./end-of-stream":45,"_process":35}],43:[function(require,module,exports){
8747
+ },{"./end-of-stream":46,"_process":36}],44:[function(require,module,exports){
8632
8748
  'use strict';
8633
8749
 
8634
8750
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
@@ -8839,7 +8955,7 @@ function () {
8839
8955
 
8840
8956
  return BufferList;
8841
8957
  }();
8842
- },{"buffer":16,"util":15}],44:[function(require,module,exports){
8958
+ },{"buffer":16,"util":15}],45:[function(require,module,exports){
8843
8959
  (function (process){(function (){
8844
8960
  'use strict'; // undocumented cb() API, needed for core, not for public API
8845
8961
 
@@ -8947,7 +9063,7 @@ module.exports = {
8947
9063
  errorOrDestroy: errorOrDestroy
8948
9064
  };
8949
9065
  }).call(this)}).call(this,require('_process'))
8950
- },{"_process":35}],45:[function(require,module,exports){
9066
+ },{"_process":36}],46:[function(require,module,exports){
8951
9067
  // Ported from https://github.com/mafintosh/end-of-stream with
8952
9068
  // permission from the author, Mathias Buus (@mafintosh).
8953
9069
  'use strict';
@@ -9052,12 +9168,12 @@ function eos(stream, opts, callback) {
9052
9168
  }
9053
9169
 
9054
9170
  module.exports = eos;
9055
- },{"../../../errors":36}],46:[function(require,module,exports){
9171
+ },{"../../../errors":37}],47:[function(require,module,exports){
9056
9172
  module.exports = function () {
9057
9173
  throw new Error('Readable.from is not available in the browser')
9058
9174
  };
9059
9175
 
9060
- },{}],47:[function(require,module,exports){
9176
+ },{}],48:[function(require,module,exports){
9061
9177
  // Ported from https://github.com/mafintosh/pump with
9062
9178
  // permission from the author, Mathias Buus (@mafintosh).
9063
9179
  'use strict';
@@ -9155,7 +9271,7 @@ function pipeline() {
9155
9271
  }
9156
9272
 
9157
9273
  module.exports = pipeline;
9158
- },{"../../../errors":36,"./end-of-stream":45}],48:[function(require,module,exports){
9274
+ },{"../../../errors":37,"./end-of-stream":46}],49:[function(require,module,exports){
9159
9275
  'use strict';
9160
9276
 
9161
9277
  var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
@@ -9183,10 +9299,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) {
9183
9299
  module.exports = {
9184
9300
  getHighWaterMark: getHighWaterMark
9185
9301
  };
9186
- },{"../../../errors":36}],49:[function(require,module,exports){
9302
+ },{"../../../errors":37}],50:[function(require,module,exports){
9187
9303
  module.exports = require('events').EventEmitter;
9188
9304
 
9189
- },{"events":20}],50:[function(require,module,exports){
9305
+ },{"events":20}],51:[function(require,module,exports){
9190
9306
  exports = module.exports = require('./lib/_stream_readable.js');
9191
9307
  exports.Stream = exports;
9192
9308
  exports.Readable = exports;
@@ -9197,7 +9313,7 @@ exports.PassThrough = require('./lib/_stream_passthrough.js');
9197
9313
  exports.finished = require('./lib/internal/streams/end-of-stream.js');
9198
9314
  exports.pipeline = require('./lib/internal/streams/pipeline.js');
9199
9315
 
9200
- },{"./lib/_stream_duplex.js":37,"./lib/_stream_passthrough.js":38,"./lib/_stream_readable.js":39,"./lib/_stream_transform.js":40,"./lib/_stream_writable.js":41,"./lib/internal/streams/end-of-stream.js":45,"./lib/internal/streams/pipeline.js":47}],51:[function(require,module,exports){
9316
+ },{"./lib/_stream_duplex.js":38,"./lib/_stream_passthrough.js":39,"./lib/_stream_readable.js":40,"./lib/_stream_transform.js":41,"./lib/_stream_writable.js":42,"./lib/internal/streams/end-of-stream.js":46,"./lib/internal/streams/pipeline.js":48}],52:[function(require,module,exports){
9201
9317
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
9202
9318
  /* eslint-disable node/no-deprecated-api */
9203
9319
  var buffer = require('buffer')
@@ -9264,7 +9380,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
9264
9380
  return buffer.SlowBuffer(size)
9265
9381
  }
9266
9382
 
9267
- },{"buffer":16}],52:[function(require,module,exports){
9383
+ },{"buffer":16}],53:[function(require,module,exports){
9268
9384
  // Copyright Joyent, Inc. and other Node contributors.
9269
9385
  //
9270
9386
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -9561,7 +9677,71 @@ function simpleWrite(buf) {
9561
9677
  function simpleEnd(buf) {
9562
9678
  return buf && buf.length ? this.write(buf) : '';
9563
9679
  }
9564
- },{"safe-buffer":51}],53:[function(require,module,exports){
9680
+ },{"safe-buffer":54}],54:[function(require,module,exports){
9681
+ /* eslint-disable node/no-deprecated-api */
9682
+ var buffer = require('buffer')
9683
+ var Buffer = buffer.Buffer
9684
+
9685
+ // alternative to using Object.keys for old browsers
9686
+ function copyProps (src, dst) {
9687
+ for (var key in src) {
9688
+ dst[key] = src[key]
9689
+ }
9690
+ }
9691
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
9692
+ module.exports = buffer
9693
+ } else {
9694
+ // Copy properties from require('buffer')
9695
+ copyProps(buffer, exports)
9696
+ exports.Buffer = SafeBuffer
9697
+ }
9698
+
9699
+ function SafeBuffer (arg, encodingOrOffset, length) {
9700
+ return Buffer(arg, encodingOrOffset, length)
9701
+ }
9702
+
9703
+ // Copy static methods from Buffer
9704
+ copyProps(Buffer, SafeBuffer)
9705
+
9706
+ SafeBuffer.from = function (arg, encodingOrOffset, length) {
9707
+ if (typeof arg === 'number') {
9708
+ throw new TypeError('Argument must not be a number')
9709
+ }
9710
+ return Buffer(arg, encodingOrOffset, length)
9711
+ }
9712
+
9713
+ SafeBuffer.alloc = function (size, fill, encoding) {
9714
+ if (typeof size !== 'number') {
9715
+ throw new TypeError('Argument must be a number')
9716
+ }
9717
+ var buf = Buffer(size)
9718
+ if (fill !== undefined) {
9719
+ if (typeof encoding === 'string') {
9720
+ buf.fill(fill, encoding)
9721
+ } else {
9722
+ buf.fill(fill)
9723
+ }
9724
+ } else {
9725
+ buf.fill(0)
9726
+ }
9727
+ return buf
9728
+ }
9729
+
9730
+ SafeBuffer.allocUnsafe = function (size) {
9731
+ if (typeof size !== 'number') {
9732
+ throw new TypeError('Argument must be a number')
9733
+ }
9734
+ return Buffer(size)
9735
+ }
9736
+
9737
+ SafeBuffer.allocUnsafeSlow = function (size) {
9738
+ if (typeof size !== 'number') {
9739
+ throw new TypeError('Argument must be a number')
9740
+ }
9741
+ return buffer.SlowBuffer(size)
9742
+ }
9743
+
9744
+ },{"buffer":16}],55:[function(require,module,exports){
9565
9745
  (function (global){(function (){
9566
9746
 
9567
9747
  /**
@@ -9632,9 +9812,9 @@ function config (name) {
9632
9812
  }
9633
9813
 
9634
9814
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
9635
- },{}],54:[function(require,module,exports){
9815
+ },{}],56:[function(require,module,exports){
9636
9816
  arguments[4][9][0].apply(exports,arguments)
9637
- },{"dup":9}],55:[function(require,module,exports){
9817
+ },{"dup":9}],57:[function(require,module,exports){
9638
9818
  // Currently in sync with Node.js lib/internal/util/types.js
9639
9819
  // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9
9640
9820
 
@@ -9970,7 +10150,7 @@ exports.isAnyArrayBuffer = isAnyArrayBuffer;
9970
10150
  });
9971
10151
  });
9972
10152
 
9973
- },{"is-arguments":31,"is-generator-function":32,"is-typed-array":33,"which-typed-array":57}],56:[function(require,module,exports){
10153
+ },{"is-arguments":31,"is-generator-function":33,"is-typed-array":34,"which-typed-array":59}],58:[function(require,module,exports){
9974
10154
  (function (process){(function (){
9975
10155
  // Copyright Joyent, Inc. and other Node contributors.
9976
10156
  //
@@ -10689,11 +10869,11 @@ function callbackify(original) {
10689
10869
  exports.callbackify = callbackify;
10690
10870
 
10691
10871
  }).call(this)}).call(this,require('_process'))
10692
- },{"./support/isBuffer":54,"./support/types":55,"_process":35,"inherits":30}],57:[function(require,module,exports){
10872
+ },{"./support/isBuffer":56,"./support/types":57,"_process":36,"inherits":30}],59:[function(require,module,exports){
10693
10873
  (function (global){(function (){
10694
10874
  'use strict';
10695
10875
 
10696
- var forEach = require('foreach');
10876
+ var forEach = require('for-each');
10697
10877
  var availableTypedArrays = require('available-typed-arrays');
10698
10878
  var callBound = require('call-bind/callBound');
10699
10879
 
@@ -10748,5 +10928,5 @@ module.exports = function whichTypedArray(value) {
10748
10928
  };
10749
10929
 
10750
10930
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
10751
- },{"available-typed-arrays":11,"call-bind/callBound":17,"es-abstract/helpers/getOwnPropertyDescriptor":19,"foreach":21,"has-tostringtag/shams":27,"is-typed-array":33}]},{},[1])(1)
10931
+ },{"available-typed-arrays":11,"call-bind/callBound":17,"es-abstract/helpers/getOwnPropertyDescriptor":19,"for-each":21,"has-tostringtag/shams":27,"is-typed-array":34}]},{},[1])(1)
10752
10932
  });