Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert files in
src
to next-gen JS.
- Loading branch information
1 parent
f8f4db4
commit 0317b53
Showing
91 changed files
with
6,789 additions
and
5,454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const TYPE = { | ||
QUERY_NOTIFICATIONS: 1, | ||
TXN_DESCRIPTOR: 2, | ||
TRACE_ACTIVITY: 3 | ||
}; | ||
|
||
const TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8; | ||
|
||
const TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN; | ||
|
||
export function writeToTrackingBuffer(buffer, txnDescriptor, outstandingRequestCount) { | ||
buffer.writeUInt32LE(0); | ||
buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN); | ||
buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR); | ||
buffer.writeBuffer(txnDescriptor); | ||
buffer.writeUInt32LE(outstandingRequestCount); | ||
|
||
const data = buffer.data; | ||
data.writeUInt32LE(data.length, 0); | ||
return buffer; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
if (!Buffer.concat) { | ||
Buffer.concat = function(buffers) { | ||
const buffersCount = buffers.length; | ||
|
||
let length = 0; | ||
for (let i = 0; i < buffersCount; i++) { | ||
const buffer = buffers[i]; | ||
length += buffer.length; | ||
} | ||
|
||
const result = new Buffer(length); | ||
let position = 0; | ||
for (let i = 0; i < buffersCount; i++) { | ||
const buffer = buffers[i]; | ||
buffer.copy(result, position, 0); | ||
position += buffer.length; | ||
} | ||
|
||
return result; | ||
}; | ||
} | ||
|
||
Buffer.prototype.toByteArray = function() { | ||
return Array.prototype.slice.call(this, 0); | ||
}; | ||
|
||
Buffer.prototype.equals = function(other) { | ||
if (this.length !== other.length) { | ||
return false; | ||
} | ||
|
||
for (let i = 0, len = this.length; i < len; i++) { | ||
if (this[i] !== other[i]) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.