@xchainjs/xchain-thorchain 0.28.14 → 0.28.17
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/lib/index.esm.js +262 -231
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +262 -231
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -4592,81 +4592,89 @@ function requireBase64 () {
|
|
|
4592
4592
|
return base64$1;
|
|
4593
4593
|
}
|
|
4594
4594
|
|
|
4595
|
-
var eventemitter
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
*/
|
|
4603
|
-
function EventEmitter() {
|
|
4595
|
+
var eventemitter;
|
|
4596
|
+
var hasRequiredEventemitter;
|
|
4597
|
+
|
|
4598
|
+
function requireEventemitter () {
|
|
4599
|
+
if (hasRequiredEventemitter) return eventemitter;
|
|
4600
|
+
hasRequiredEventemitter = 1;
|
|
4601
|
+
eventemitter = EventEmitter;
|
|
4604
4602
|
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4603
|
+
/**
|
|
4604
|
+
* Constructs a new event emitter instance.
|
|
4605
|
+
* @classdesc A minimal event emitter.
|
|
4606
|
+
* @memberof util
|
|
4607
|
+
* @constructor
|
|
4608
|
+
*/
|
|
4609
|
+
function EventEmitter() {
|
|
4610
|
+
|
|
4611
|
+
/**
|
|
4612
|
+
* Registered listeners.
|
|
4613
|
+
* @type {Object.<string,*>}
|
|
4614
|
+
* @private
|
|
4615
|
+
*/
|
|
4616
|
+
this._listeners = {};
|
|
4617
|
+
}
|
|
4612
4618
|
|
|
4613
|
-
/**
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
};
|
|
4619
|
+
/**
|
|
4620
|
+
* Registers an event listener.
|
|
4621
|
+
* @param {string} evt Event name
|
|
4622
|
+
* @param {function} fn Listener
|
|
4623
|
+
* @param {*} [ctx] Listener context
|
|
4624
|
+
* @returns {util.EventEmitter} `this`
|
|
4625
|
+
*/
|
|
4626
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4627
|
+
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4628
|
+
fn : fn,
|
|
4629
|
+
ctx : ctx || this
|
|
4630
|
+
});
|
|
4631
|
+
return this;
|
|
4632
|
+
};
|
|
4627
4633
|
|
|
4628
|
-
/**
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
};
|
|
4634
|
+
/**
|
|
4635
|
+
* Removes an event listener or any matching listeners if arguments are omitted.
|
|
4636
|
+
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
|
4637
|
+
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
|
4638
|
+
* @returns {util.EventEmitter} `this`
|
|
4639
|
+
*/
|
|
4640
|
+
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4641
|
+
if (evt === undefined)
|
|
4642
|
+
this._listeners = {};
|
|
4643
|
+
else {
|
|
4644
|
+
if (fn === undefined)
|
|
4645
|
+
this._listeners[evt] = [];
|
|
4646
|
+
else {
|
|
4647
|
+
var listeners = this._listeners[evt];
|
|
4648
|
+
for (var i = 0; i < listeners.length;)
|
|
4649
|
+
if (listeners[i].fn === fn)
|
|
4650
|
+
listeners.splice(i, 1);
|
|
4651
|
+
else
|
|
4652
|
+
++i;
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4655
|
+
return this;
|
|
4656
|
+
};
|
|
4651
4657
|
|
|
4652
|
-
/**
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
EventEmitter.prototype.emit = function emit(evt) {
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
};
|
|
4658
|
+
/**
|
|
4659
|
+
* Emits an event by calling its listeners with the specified arguments.
|
|
4660
|
+
* @param {string} evt Event name
|
|
4661
|
+
* @param {...*} args Arguments
|
|
4662
|
+
* @returns {util.EventEmitter} `this`
|
|
4663
|
+
*/
|
|
4664
|
+
EventEmitter.prototype.emit = function emit(evt) {
|
|
4665
|
+
var listeners = this._listeners[evt];
|
|
4666
|
+
if (listeners) {
|
|
4667
|
+
var args = [],
|
|
4668
|
+
i = 1;
|
|
4669
|
+
for (; i < arguments.length;)
|
|
4670
|
+
args.push(arguments[i++]);
|
|
4671
|
+
for (i = 0; i < listeners.length;)
|
|
4672
|
+
listeners[i].fn.apply(listeners[i++].ctx, args);
|
|
4673
|
+
}
|
|
4674
|
+
return this;
|
|
4675
|
+
};
|
|
4676
|
+
return eventemitter;
|
|
4677
|
+
}
|
|
4670
4678
|
|
|
4671
4679
|
var float;
|
|
4672
4680
|
var hasRequiredFloat;
|
|
@@ -5011,178 +5019,201 @@ function requireFloat () {
|
|
|
5011
5019
|
return float;
|
|
5012
5020
|
}
|
|
5013
5021
|
|
|
5014
|
-
var inquire_1
|
|
5022
|
+
var inquire_1;
|
|
5023
|
+
var hasRequiredInquire;
|
|
5024
|
+
|
|
5025
|
+
function requireInquire () {
|
|
5026
|
+
if (hasRequiredInquire) return inquire_1;
|
|
5027
|
+
hasRequiredInquire = 1;
|
|
5028
|
+
inquire_1 = inquire;
|
|
5015
5029
|
|
|
5016
|
-
/**
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
function inquire(moduleName) {
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5030
|
+
/**
|
|
5031
|
+
* Requires a module only if available.
|
|
5032
|
+
* @memberof util
|
|
5033
|
+
* @param {string} moduleName Module to require
|
|
5034
|
+
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
5035
|
+
*/
|
|
5036
|
+
function inquire(moduleName) {
|
|
5037
|
+
try {
|
|
5038
|
+
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
|
5039
|
+
if (mod && (mod.length || Object.keys(mod).length))
|
|
5040
|
+
return mod;
|
|
5041
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
5042
|
+
return null;
|
|
5043
|
+
}
|
|
5044
|
+
return inquire_1;
|
|
5029
5045
|
}
|
|
5030
5046
|
|
|
5031
5047
|
var utf8$2 = {};
|
|
5032
5048
|
|
|
5033
|
-
|
|
5049
|
+
var hasRequiredUtf8;
|
|
5050
|
+
|
|
5051
|
+
function requireUtf8 () {
|
|
5052
|
+
if (hasRequiredUtf8) return utf8$2;
|
|
5053
|
+
hasRequiredUtf8 = 1;
|
|
5054
|
+
(function (exports) {
|
|
5034
5055
|
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5056
|
+
/**
|
|
5057
|
+
* A minimal UTF8 implementation for number arrays.
|
|
5058
|
+
* @memberof util
|
|
5059
|
+
* @namespace
|
|
5060
|
+
*/
|
|
5061
|
+
var utf8 = exports;
|
|
5062
|
+
|
|
5063
|
+
/**
|
|
5064
|
+
* Calculates the UTF8 byte length of a string.
|
|
5065
|
+
* @param {string} string String
|
|
5066
|
+
* @returns {number} Byte length
|
|
5067
|
+
*/
|
|
5068
|
+
utf8.length = function utf8_length(string) {
|
|
5069
|
+
var len = 0,
|
|
5070
|
+
c = 0;
|
|
5071
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5072
|
+
c = string.charCodeAt(i);
|
|
5073
|
+
if (c < 128)
|
|
5074
|
+
len += 1;
|
|
5075
|
+
else if (c < 2048)
|
|
5076
|
+
len += 2;
|
|
5077
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5078
|
+
++i;
|
|
5079
|
+
len += 4;
|
|
5080
|
+
} else
|
|
5081
|
+
len += 3;
|
|
5082
|
+
}
|
|
5083
|
+
return len;
|
|
5084
|
+
};
|
|
5085
|
+
|
|
5086
|
+
/**
|
|
5087
|
+
* Reads UTF8 bytes as a string.
|
|
5088
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5089
|
+
* @param {number} start Source start
|
|
5090
|
+
* @param {number} end Source end
|
|
5091
|
+
* @returns {string} String read
|
|
5092
|
+
*/
|
|
5093
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5094
|
+
var len = end - start;
|
|
5095
|
+
if (len < 1)
|
|
5096
|
+
return "";
|
|
5097
|
+
var parts = null,
|
|
5098
|
+
chunk = [],
|
|
5099
|
+
i = 0, // char offset
|
|
5100
|
+
t; // temporary
|
|
5101
|
+
while (start < end) {
|
|
5102
|
+
t = buffer[start++];
|
|
5103
|
+
if (t < 128)
|
|
5104
|
+
chunk[i++] = t;
|
|
5105
|
+
else if (t > 191 && t < 224)
|
|
5106
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5107
|
+
else if (t > 239 && t < 365) {
|
|
5108
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5109
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5110
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5111
|
+
} else
|
|
5112
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5113
|
+
if (i > 8191) {
|
|
5114
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5115
|
+
i = 0;
|
|
5116
|
+
}
|
|
5117
|
+
}
|
|
5118
|
+
if (parts) {
|
|
5119
|
+
if (i)
|
|
5120
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5121
|
+
return parts.join("");
|
|
5122
|
+
}
|
|
5123
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5124
|
+
};
|
|
5125
|
+
|
|
5126
|
+
/**
|
|
5127
|
+
* Writes a string as UTF8 bytes.
|
|
5128
|
+
* @param {string} string Source string
|
|
5129
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5130
|
+
* @param {number} offset Destination offset
|
|
5131
|
+
* @returns {number} Bytes written
|
|
5132
|
+
*/
|
|
5133
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5134
|
+
var start = offset,
|
|
5135
|
+
c1, // character 1
|
|
5136
|
+
c2; // character 2
|
|
5137
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5138
|
+
c1 = string.charCodeAt(i);
|
|
5139
|
+
if (c1 < 128) {
|
|
5140
|
+
buffer[offset++] = c1;
|
|
5141
|
+
} else if (c1 < 2048) {
|
|
5142
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5143
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5144
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5145
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5146
|
+
++i;
|
|
5147
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5148
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5149
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5150
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5151
|
+
} else {
|
|
5152
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5153
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5154
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
5157
|
+
return offset - start;
|
|
5158
|
+
};
|
|
5159
|
+
} (utf8$2));
|
|
5160
|
+
return utf8$2;
|
|
5161
|
+
}
|
|
5162
|
+
|
|
5163
|
+
var pool_1;
|
|
5164
|
+
var hasRequiredPool;
|
|
5165
|
+
|
|
5166
|
+
function requirePool () {
|
|
5167
|
+
if (hasRequiredPool) return pool_1;
|
|
5168
|
+
hasRequiredPool = 1;
|
|
5169
|
+
pool_1 = pool;
|
|
5041
5170
|
|
|
5042
5171
|
/**
|
|
5043
|
-
*
|
|
5044
|
-
* @
|
|
5045
|
-
* @
|
|
5172
|
+
* An allocator as used by {@link util.pool}.
|
|
5173
|
+
* @typedef PoolAllocator
|
|
5174
|
+
* @type {function}
|
|
5175
|
+
* @param {number} size Buffer size
|
|
5176
|
+
* @returns {Uint8Array} Buffer
|
|
5046
5177
|
*/
|
|
5047
|
-
utf8.length = function utf8_length(string) {
|
|
5048
|
-
var len = 0,
|
|
5049
|
-
c = 0;
|
|
5050
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5051
|
-
c = string.charCodeAt(i);
|
|
5052
|
-
if (c < 128)
|
|
5053
|
-
len += 1;
|
|
5054
|
-
else if (c < 2048)
|
|
5055
|
-
len += 2;
|
|
5056
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5057
|
-
++i;
|
|
5058
|
-
len += 4;
|
|
5059
|
-
} else
|
|
5060
|
-
len += 3;
|
|
5061
|
-
}
|
|
5062
|
-
return len;
|
|
5063
|
-
};
|
|
5064
5178
|
|
|
5065
5179
|
/**
|
|
5066
|
-
*
|
|
5067
|
-
* @
|
|
5068
|
-
* @
|
|
5069
|
-
* @param {number}
|
|
5070
|
-
* @
|
|
5180
|
+
* A slicer as used by {@link util.pool}.
|
|
5181
|
+
* @typedef PoolSlicer
|
|
5182
|
+
* @type {function}
|
|
5183
|
+
* @param {number} start Start offset
|
|
5184
|
+
* @param {number} end End offset
|
|
5185
|
+
* @returns {Uint8Array} Buffer slice
|
|
5186
|
+
* @this {Uint8Array}
|
|
5071
5187
|
*/
|
|
5072
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5073
|
-
var len = end - start;
|
|
5074
|
-
if (len < 1)
|
|
5075
|
-
return "";
|
|
5076
|
-
var parts = null,
|
|
5077
|
-
chunk = [],
|
|
5078
|
-
i = 0, // char offset
|
|
5079
|
-
t; // temporary
|
|
5080
|
-
while (start < end) {
|
|
5081
|
-
t = buffer[start++];
|
|
5082
|
-
if (t < 128)
|
|
5083
|
-
chunk[i++] = t;
|
|
5084
|
-
else if (t > 191 && t < 224)
|
|
5085
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5086
|
-
else if (t > 239 && t < 365) {
|
|
5087
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5088
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5089
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5090
|
-
} else
|
|
5091
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5092
|
-
if (i > 8191) {
|
|
5093
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5094
|
-
i = 0;
|
|
5095
|
-
}
|
|
5096
|
-
}
|
|
5097
|
-
if (parts) {
|
|
5098
|
-
if (i)
|
|
5099
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5100
|
-
return parts.join("");
|
|
5101
|
-
}
|
|
5102
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5103
|
-
};
|
|
5104
5188
|
|
|
5105
5189
|
/**
|
|
5106
|
-
*
|
|
5107
|
-
* @
|
|
5108
|
-
* @
|
|
5109
|
-
* @param {
|
|
5110
|
-
* @
|
|
5190
|
+
* A general purpose buffer pool.
|
|
5191
|
+
* @memberof util
|
|
5192
|
+
* @function
|
|
5193
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5194
|
+
* @param {PoolSlicer} slice Slicer
|
|
5195
|
+
* @param {number} [size=8192] Slab size
|
|
5196
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5111
5197
|
*/
|
|
5112
|
-
|
|
5113
|
-
var
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
if (
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5124
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5125
|
-
++i;
|
|
5126
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5127
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5128
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5129
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5130
|
-
} else {
|
|
5131
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5132
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5133
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5198
|
+
function pool(alloc, slice, size) {
|
|
5199
|
+
var SIZE = size || 8192;
|
|
5200
|
+
var MAX = SIZE >>> 1;
|
|
5201
|
+
var slab = null;
|
|
5202
|
+
var offset = SIZE;
|
|
5203
|
+
return function pool_alloc(size) {
|
|
5204
|
+
if (size < 1 || size > MAX)
|
|
5205
|
+
return alloc(size);
|
|
5206
|
+
if (offset + size > SIZE) {
|
|
5207
|
+
slab = alloc(SIZE);
|
|
5208
|
+
offset = 0;
|
|
5134
5209
|
}
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
/**
|
|
5143
|
-
* An allocator as used by {@link util.pool}.
|
|
5144
|
-
* @typedef PoolAllocator
|
|
5145
|
-
* @type {function}
|
|
5146
|
-
* @param {number} size Buffer size
|
|
5147
|
-
* @returns {Uint8Array} Buffer
|
|
5148
|
-
*/
|
|
5149
|
-
|
|
5150
|
-
/**
|
|
5151
|
-
* A slicer as used by {@link util.pool}.
|
|
5152
|
-
* @typedef PoolSlicer
|
|
5153
|
-
* @type {function}
|
|
5154
|
-
* @param {number} start Start offset
|
|
5155
|
-
* @param {number} end End offset
|
|
5156
|
-
* @returns {Uint8Array} Buffer slice
|
|
5157
|
-
* @this {Uint8Array}
|
|
5158
|
-
*/
|
|
5159
|
-
|
|
5160
|
-
/**
|
|
5161
|
-
* A general purpose buffer pool.
|
|
5162
|
-
* @memberof util
|
|
5163
|
-
* @function
|
|
5164
|
-
* @param {PoolAllocator} alloc Allocator
|
|
5165
|
-
* @param {PoolSlicer} slice Slicer
|
|
5166
|
-
* @param {number} [size=8192] Slab size
|
|
5167
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5168
|
-
*/
|
|
5169
|
-
function pool(alloc, slice, size) {
|
|
5170
|
-
var SIZE = size || 8192;
|
|
5171
|
-
var MAX = SIZE >>> 1;
|
|
5172
|
-
var slab = null;
|
|
5173
|
-
var offset = SIZE;
|
|
5174
|
-
return function pool_alloc(size) {
|
|
5175
|
-
if (size < 1 || size > MAX)
|
|
5176
|
-
return alloc(size);
|
|
5177
|
-
if (offset + size > SIZE) {
|
|
5178
|
-
slab = alloc(SIZE);
|
|
5179
|
-
offset = 0;
|
|
5180
|
-
}
|
|
5181
|
-
var buf = slice.call(slab, offset, offset += size);
|
|
5182
|
-
if (offset & 7) // align to 32 bit
|
|
5183
|
-
offset = (offset | 7) + 1;
|
|
5184
|
-
return buf;
|
|
5185
|
-
};
|
|
5210
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5211
|
+
if (offset & 7) // align to 32 bit
|
|
5212
|
+
offset = (offset | 7) + 1;
|
|
5213
|
+
return buf;
|
|
5214
|
+
};
|
|
5215
|
+
}
|
|
5216
|
+
return pool_1;
|
|
5186
5217
|
}
|
|
5187
5218
|
|
|
5188
5219
|
var longbits;
|
|
@@ -5408,19 +5439,19 @@ function requireMinimal () {
|
|
|
5408
5439
|
util.base64 = requireBase64();
|
|
5409
5440
|
|
|
5410
5441
|
// base class of rpc.Service
|
|
5411
|
-
util.EventEmitter =
|
|
5442
|
+
util.EventEmitter = requireEventemitter();
|
|
5412
5443
|
|
|
5413
5444
|
// float handling accross browsers
|
|
5414
5445
|
util.float = requireFloat();
|
|
5415
5446
|
|
|
5416
5447
|
// requires modules optionally and hides the call from bundlers
|
|
5417
|
-
util.inquire =
|
|
5448
|
+
util.inquire = requireInquire();
|
|
5418
5449
|
|
|
5419
5450
|
// converts to / from utf8 encoded strings
|
|
5420
|
-
util.utf8 =
|
|
5451
|
+
util.utf8 = requireUtf8();
|
|
5421
5452
|
|
|
5422
5453
|
// provides a node-like buffer pool in the browser
|
|
5423
|
-
util.pool =
|
|
5454
|
+
util.pool = requirePool();
|
|
5424
5455
|
|
|
5425
5456
|
// utility to work with the low and high bits of a 64 bit value
|
|
5426
5457
|
util.LongBits = requireLongbits();
|