@xchainjs/xchain-thorchain 0.28.14 → 0.28.16
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 +5 -5
package/lib/index.esm.js
CHANGED
|
@@ -4564,81 +4564,89 @@ function requireBase64 () {
|
|
|
4564
4564
|
return base64$1;
|
|
4565
4565
|
}
|
|
4566
4566
|
|
|
4567
|
-
var eventemitter
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
*/
|
|
4575
|
-
function EventEmitter() {
|
|
4567
|
+
var eventemitter;
|
|
4568
|
+
var hasRequiredEventemitter;
|
|
4569
|
+
|
|
4570
|
+
function requireEventemitter () {
|
|
4571
|
+
if (hasRequiredEventemitter) return eventemitter;
|
|
4572
|
+
hasRequiredEventemitter = 1;
|
|
4573
|
+
eventemitter = EventEmitter;
|
|
4576
4574
|
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4575
|
+
/**
|
|
4576
|
+
* Constructs a new event emitter instance.
|
|
4577
|
+
* @classdesc A minimal event emitter.
|
|
4578
|
+
* @memberof util
|
|
4579
|
+
* @constructor
|
|
4580
|
+
*/
|
|
4581
|
+
function EventEmitter() {
|
|
4582
|
+
|
|
4583
|
+
/**
|
|
4584
|
+
* Registered listeners.
|
|
4585
|
+
* @type {Object.<string,*>}
|
|
4586
|
+
* @private
|
|
4587
|
+
*/
|
|
4588
|
+
this._listeners = {};
|
|
4589
|
+
}
|
|
4584
4590
|
|
|
4585
|
-
/**
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
};
|
|
4591
|
+
/**
|
|
4592
|
+
* Registers an event listener.
|
|
4593
|
+
* @param {string} evt Event name
|
|
4594
|
+
* @param {function} fn Listener
|
|
4595
|
+
* @param {*} [ctx] Listener context
|
|
4596
|
+
* @returns {util.EventEmitter} `this`
|
|
4597
|
+
*/
|
|
4598
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4599
|
+
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4600
|
+
fn : fn,
|
|
4601
|
+
ctx : ctx || this
|
|
4602
|
+
});
|
|
4603
|
+
return this;
|
|
4604
|
+
};
|
|
4599
4605
|
|
|
4600
|
-
/**
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
};
|
|
4606
|
+
/**
|
|
4607
|
+
* Removes an event listener or any matching listeners if arguments are omitted.
|
|
4608
|
+
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
|
4609
|
+
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
|
4610
|
+
* @returns {util.EventEmitter} `this`
|
|
4611
|
+
*/
|
|
4612
|
+
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4613
|
+
if (evt === undefined)
|
|
4614
|
+
this._listeners = {};
|
|
4615
|
+
else {
|
|
4616
|
+
if (fn === undefined)
|
|
4617
|
+
this._listeners[evt] = [];
|
|
4618
|
+
else {
|
|
4619
|
+
var listeners = this._listeners[evt];
|
|
4620
|
+
for (var i = 0; i < listeners.length;)
|
|
4621
|
+
if (listeners[i].fn === fn)
|
|
4622
|
+
listeners.splice(i, 1);
|
|
4623
|
+
else
|
|
4624
|
+
++i;
|
|
4625
|
+
}
|
|
4626
|
+
}
|
|
4627
|
+
return this;
|
|
4628
|
+
};
|
|
4623
4629
|
|
|
4624
|
-
/**
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
EventEmitter.prototype.emit = function emit(evt) {
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
};
|
|
4630
|
+
/**
|
|
4631
|
+
* Emits an event by calling its listeners with the specified arguments.
|
|
4632
|
+
* @param {string} evt Event name
|
|
4633
|
+
* @param {...*} args Arguments
|
|
4634
|
+
* @returns {util.EventEmitter} `this`
|
|
4635
|
+
*/
|
|
4636
|
+
EventEmitter.prototype.emit = function emit(evt) {
|
|
4637
|
+
var listeners = this._listeners[evt];
|
|
4638
|
+
if (listeners) {
|
|
4639
|
+
var args = [],
|
|
4640
|
+
i = 1;
|
|
4641
|
+
for (; i < arguments.length;)
|
|
4642
|
+
args.push(arguments[i++]);
|
|
4643
|
+
for (i = 0; i < listeners.length;)
|
|
4644
|
+
listeners[i].fn.apply(listeners[i++].ctx, args);
|
|
4645
|
+
}
|
|
4646
|
+
return this;
|
|
4647
|
+
};
|
|
4648
|
+
return eventemitter;
|
|
4649
|
+
}
|
|
4642
4650
|
|
|
4643
4651
|
var float;
|
|
4644
4652
|
var hasRequiredFloat;
|
|
@@ -4983,178 +4991,201 @@ function requireFloat () {
|
|
|
4983
4991
|
return float;
|
|
4984
4992
|
}
|
|
4985
4993
|
|
|
4986
|
-
var inquire_1
|
|
4994
|
+
var inquire_1;
|
|
4995
|
+
var hasRequiredInquire;
|
|
4996
|
+
|
|
4997
|
+
function requireInquire () {
|
|
4998
|
+
if (hasRequiredInquire) return inquire_1;
|
|
4999
|
+
hasRequiredInquire = 1;
|
|
5000
|
+
inquire_1 = inquire;
|
|
4987
5001
|
|
|
4988
|
-
/**
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
function inquire(moduleName) {
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5002
|
+
/**
|
|
5003
|
+
* Requires a module only if available.
|
|
5004
|
+
* @memberof util
|
|
5005
|
+
* @param {string} moduleName Module to require
|
|
5006
|
+
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
5007
|
+
*/
|
|
5008
|
+
function inquire(moduleName) {
|
|
5009
|
+
try {
|
|
5010
|
+
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
|
5011
|
+
if (mod && (mod.length || Object.keys(mod).length))
|
|
5012
|
+
return mod;
|
|
5013
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
5014
|
+
return null;
|
|
5015
|
+
}
|
|
5016
|
+
return inquire_1;
|
|
5001
5017
|
}
|
|
5002
5018
|
|
|
5003
5019
|
var utf8$2 = {};
|
|
5004
5020
|
|
|
5005
|
-
|
|
5021
|
+
var hasRequiredUtf8;
|
|
5022
|
+
|
|
5023
|
+
function requireUtf8 () {
|
|
5024
|
+
if (hasRequiredUtf8) return utf8$2;
|
|
5025
|
+
hasRequiredUtf8 = 1;
|
|
5026
|
+
(function (exports) {
|
|
5006
5027
|
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5028
|
+
/**
|
|
5029
|
+
* A minimal UTF8 implementation for number arrays.
|
|
5030
|
+
* @memberof util
|
|
5031
|
+
* @namespace
|
|
5032
|
+
*/
|
|
5033
|
+
var utf8 = exports;
|
|
5034
|
+
|
|
5035
|
+
/**
|
|
5036
|
+
* Calculates the UTF8 byte length of a string.
|
|
5037
|
+
* @param {string} string String
|
|
5038
|
+
* @returns {number} Byte length
|
|
5039
|
+
*/
|
|
5040
|
+
utf8.length = function utf8_length(string) {
|
|
5041
|
+
var len = 0,
|
|
5042
|
+
c = 0;
|
|
5043
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5044
|
+
c = string.charCodeAt(i);
|
|
5045
|
+
if (c < 128)
|
|
5046
|
+
len += 1;
|
|
5047
|
+
else if (c < 2048)
|
|
5048
|
+
len += 2;
|
|
5049
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5050
|
+
++i;
|
|
5051
|
+
len += 4;
|
|
5052
|
+
} else
|
|
5053
|
+
len += 3;
|
|
5054
|
+
}
|
|
5055
|
+
return len;
|
|
5056
|
+
};
|
|
5057
|
+
|
|
5058
|
+
/**
|
|
5059
|
+
* Reads UTF8 bytes as a string.
|
|
5060
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5061
|
+
* @param {number} start Source start
|
|
5062
|
+
* @param {number} end Source end
|
|
5063
|
+
* @returns {string} String read
|
|
5064
|
+
*/
|
|
5065
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5066
|
+
var len = end - start;
|
|
5067
|
+
if (len < 1)
|
|
5068
|
+
return "";
|
|
5069
|
+
var parts = null,
|
|
5070
|
+
chunk = [],
|
|
5071
|
+
i = 0, // char offset
|
|
5072
|
+
t; // temporary
|
|
5073
|
+
while (start < end) {
|
|
5074
|
+
t = buffer[start++];
|
|
5075
|
+
if (t < 128)
|
|
5076
|
+
chunk[i++] = t;
|
|
5077
|
+
else if (t > 191 && t < 224)
|
|
5078
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5079
|
+
else if (t > 239 && t < 365) {
|
|
5080
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5081
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5082
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5083
|
+
} else
|
|
5084
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5085
|
+
if (i > 8191) {
|
|
5086
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5087
|
+
i = 0;
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
5090
|
+
if (parts) {
|
|
5091
|
+
if (i)
|
|
5092
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5093
|
+
return parts.join("");
|
|
5094
|
+
}
|
|
5095
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5096
|
+
};
|
|
5097
|
+
|
|
5098
|
+
/**
|
|
5099
|
+
* Writes a string as UTF8 bytes.
|
|
5100
|
+
* @param {string} string Source string
|
|
5101
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5102
|
+
* @param {number} offset Destination offset
|
|
5103
|
+
* @returns {number} Bytes written
|
|
5104
|
+
*/
|
|
5105
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5106
|
+
var start = offset,
|
|
5107
|
+
c1, // character 1
|
|
5108
|
+
c2; // character 2
|
|
5109
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5110
|
+
c1 = string.charCodeAt(i);
|
|
5111
|
+
if (c1 < 128) {
|
|
5112
|
+
buffer[offset++] = c1;
|
|
5113
|
+
} else if (c1 < 2048) {
|
|
5114
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5115
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5116
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5117
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5118
|
+
++i;
|
|
5119
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5120
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5121
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5122
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5123
|
+
} else {
|
|
5124
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5125
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5126
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5127
|
+
}
|
|
5128
|
+
}
|
|
5129
|
+
return offset - start;
|
|
5130
|
+
};
|
|
5131
|
+
} (utf8$2));
|
|
5132
|
+
return utf8$2;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
var pool_1;
|
|
5136
|
+
var hasRequiredPool;
|
|
5137
|
+
|
|
5138
|
+
function requirePool () {
|
|
5139
|
+
if (hasRequiredPool) return pool_1;
|
|
5140
|
+
hasRequiredPool = 1;
|
|
5141
|
+
pool_1 = pool;
|
|
5013
5142
|
|
|
5014
5143
|
/**
|
|
5015
|
-
*
|
|
5016
|
-
* @
|
|
5017
|
-
* @
|
|
5144
|
+
* An allocator as used by {@link util.pool}.
|
|
5145
|
+
* @typedef PoolAllocator
|
|
5146
|
+
* @type {function}
|
|
5147
|
+
* @param {number} size Buffer size
|
|
5148
|
+
* @returns {Uint8Array} Buffer
|
|
5018
5149
|
*/
|
|
5019
|
-
utf8.length = function utf8_length(string) {
|
|
5020
|
-
var len = 0,
|
|
5021
|
-
c = 0;
|
|
5022
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5023
|
-
c = string.charCodeAt(i);
|
|
5024
|
-
if (c < 128)
|
|
5025
|
-
len += 1;
|
|
5026
|
-
else if (c < 2048)
|
|
5027
|
-
len += 2;
|
|
5028
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5029
|
-
++i;
|
|
5030
|
-
len += 4;
|
|
5031
|
-
} else
|
|
5032
|
-
len += 3;
|
|
5033
|
-
}
|
|
5034
|
-
return len;
|
|
5035
|
-
};
|
|
5036
5150
|
|
|
5037
5151
|
/**
|
|
5038
|
-
*
|
|
5039
|
-
* @
|
|
5040
|
-
* @
|
|
5041
|
-
* @param {number}
|
|
5042
|
-
* @
|
|
5152
|
+
* A slicer as used by {@link util.pool}.
|
|
5153
|
+
* @typedef PoolSlicer
|
|
5154
|
+
* @type {function}
|
|
5155
|
+
* @param {number} start Start offset
|
|
5156
|
+
* @param {number} end End offset
|
|
5157
|
+
* @returns {Uint8Array} Buffer slice
|
|
5158
|
+
* @this {Uint8Array}
|
|
5043
5159
|
*/
|
|
5044
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5045
|
-
var len = end - start;
|
|
5046
|
-
if (len < 1)
|
|
5047
|
-
return "";
|
|
5048
|
-
var parts = null,
|
|
5049
|
-
chunk = [],
|
|
5050
|
-
i = 0, // char offset
|
|
5051
|
-
t; // temporary
|
|
5052
|
-
while (start < end) {
|
|
5053
|
-
t = buffer[start++];
|
|
5054
|
-
if (t < 128)
|
|
5055
|
-
chunk[i++] = t;
|
|
5056
|
-
else if (t > 191 && t < 224)
|
|
5057
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5058
|
-
else if (t > 239 && t < 365) {
|
|
5059
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5060
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5061
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5062
|
-
} else
|
|
5063
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5064
|
-
if (i > 8191) {
|
|
5065
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5066
|
-
i = 0;
|
|
5067
|
-
}
|
|
5068
|
-
}
|
|
5069
|
-
if (parts) {
|
|
5070
|
-
if (i)
|
|
5071
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5072
|
-
return parts.join("");
|
|
5073
|
-
}
|
|
5074
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5075
|
-
};
|
|
5076
5160
|
|
|
5077
5161
|
/**
|
|
5078
|
-
*
|
|
5079
|
-
* @
|
|
5080
|
-
* @
|
|
5081
|
-
* @param {
|
|
5082
|
-
* @
|
|
5162
|
+
* A general purpose buffer pool.
|
|
5163
|
+
* @memberof util
|
|
5164
|
+
* @function
|
|
5165
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5166
|
+
* @param {PoolSlicer} slice Slicer
|
|
5167
|
+
* @param {number} [size=8192] Slab size
|
|
5168
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5083
5169
|
*/
|
|
5084
|
-
|
|
5085
|
-
var
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
if (
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5096
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5097
|
-
++i;
|
|
5098
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5099
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5100
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5101
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5102
|
-
} else {
|
|
5103
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5104
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5105
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5170
|
+
function pool(alloc, slice, size) {
|
|
5171
|
+
var SIZE = size || 8192;
|
|
5172
|
+
var MAX = SIZE >>> 1;
|
|
5173
|
+
var slab = null;
|
|
5174
|
+
var offset = SIZE;
|
|
5175
|
+
return function pool_alloc(size) {
|
|
5176
|
+
if (size < 1 || size > MAX)
|
|
5177
|
+
return alloc(size);
|
|
5178
|
+
if (offset + size > SIZE) {
|
|
5179
|
+
slab = alloc(SIZE);
|
|
5180
|
+
offset = 0;
|
|
5106
5181
|
}
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
/**
|
|
5115
|
-
* An allocator as used by {@link util.pool}.
|
|
5116
|
-
* @typedef PoolAllocator
|
|
5117
|
-
* @type {function}
|
|
5118
|
-
* @param {number} size Buffer size
|
|
5119
|
-
* @returns {Uint8Array} Buffer
|
|
5120
|
-
*/
|
|
5121
|
-
|
|
5122
|
-
/**
|
|
5123
|
-
* A slicer as used by {@link util.pool}.
|
|
5124
|
-
* @typedef PoolSlicer
|
|
5125
|
-
* @type {function}
|
|
5126
|
-
* @param {number} start Start offset
|
|
5127
|
-
* @param {number} end End offset
|
|
5128
|
-
* @returns {Uint8Array} Buffer slice
|
|
5129
|
-
* @this {Uint8Array}
|
|
5130
|
-
*/
|
|
5131
|
-
|
|
5132
|
-
/**
|
|
5133
|
-
* A general purpose buffer pool.
|
|
5134
|
-
* @memberof util
|
|
5135
|
-
* @function
|
|
5136
|
-
* @param {PoolAllocator} alloc Allocator
|
|
5137
|
-
* @param {PoolSlicer} slice Slicer
|
|
5138
|
-
* @param {number} [size=8192] Slab size
|
|
5139
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5140
|
-
*/
|
|
5141
|
-
function pool(alloc, slice, size) {
|
|
5142
|
-
var SIZE = size || 8192;
|
|
5143
|
-
var MAX = SIZE >>> 1;
|
|
5144
|
-
var slab = null;
|
|
5145
|
-
var offset = SIZE;
|
|
5146
|
-
return function pool_alloc(size) {
|
|
5147
|
-
if (size < 1 || size > MAX)
|
|
5148
|
-
return alloc(size);
|
|
5149
|
-
if (offset + size > SIZE) {
|
|
5150
|
-
slab = alloc(SIZE);
|
|
5151
|
-
offset = 0;
|
|
5152
|
-
}
|
|
5153
|
-
var buf = slice.call(slab, offset, offset += size);
|
|
5154
|
-
if (offset & 7) // align to 32 bit
|
|
5155
|
-
offset = (offset | 7) + 1;
|
|
5156
|
-
return buf;
|
|
5157
|
-
};
|
|
5182
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5183
|
+
if (offset & 7) // align to 32 bit
|
|
5184
|
+
offset = (offset | 7) + 1;
|
|
5185
|
+
return buf;
|
|
5186
|
+
};
|
|
5187
|
+
}
|
|
5188
|
+
return pool_1;
|
|
5158
5189
|
}
|
|
5159
5190
|
|
|
5160
5191
|
var longbits;
|
|
@@ -5380,19 +5411,19 @@ function requireMinimal () {
|
|
|
5380
5411
|
util.base64 = requireBase64();
|
|
5381
5412
|
|
|
5382
5413
|
// base class of rpc.Service
|
|
5383
|
-
util.EventEmitter =
|
|
5414
|
+
util.EventEmitter = requireEventemitter();
|
|
5384
5415
|
|
|
5385
5416
|
// float handling accross browsers
|
|
5386
5417
|
util.float = requireFloat();
|
|
5387
5418
|
|
|
5388
5419
|
// requires modules optionally and hides the call from bundlers
|
|
5389
|
-
util.inquire =
|
|
5420
|
+
util.inquire = requireInquire();
|
|
5390
5421
|
|
|
5391
5422
|
// converts to / from utf8 encoded strings
|
|
5392
|
-
util.utf8 =
|
|
5423
|
+
util.utf8 = requireUtf8();
|
|
5393
5424
|
|
|
5394
5425
|
// provides a node-like buffer pool in the browser
|
|
5395
|
-
util.pool =
|
|
5426
|
+
util.pool = requirePool();
|
|
5396
5427
|
|
|
5397
5428
|
// utility to work with the low and high bits of a 64 bit value
|
|
5398
5429
|
util.LongBits = requireLongbits();
|