Simple buffer pool to avoid allocating many small buffers.
This provides significant speedups in recent versions of node (6+).
Generator of random things.
Inspired by: http://stackoverflow.com/a/424445/1062617
Ordered queue which returns items consecutively.
This is actually a heap by index, with the added requirements that elements can only be retrieved consecutively.
A tap is a buffer which remembers what has been already read.
It is optimized for performance, at the cost of failing silently when
overflowing the buffer. This is a purposeful trade-off given the expected
rarity of this case and the large performance hit necessary to enforce
validity. See isValid
below for more information.
"Abstract" function to help with "subclassing".
Batch-deprecate "getters" from an object's prototype.
Create a new buffer with the input contents.
The buffer's data.
Encoding, used if data is a string.
Uppercase the first letter of a string.
The string.
Compare two numbers.
The first one.
The second one.
Copy properties from one object to another.
The source object.
The destination object.
Whether to overwrite existing destination properties. Defaults to false.
Compute a string's hash.
The string to hash.
The algorithm used. Defaults to MD5.
Get option or default if undefined.
Options.
Name of the option.
Default value.
This is useful mostly for true-ish defaults and false-ish values (where the
usual ||
idiom breaks down).
Check whether an array has duplicates.
The array.
Optional function to apply to each element.
Invert all bits in a buffer.
Non-empty buffer to invert.
Buffer length (must be positive).
Returns offset in the string of the end of JSON object (-1 if past the end).
To keep the implementation simple, this function isn't a JSON validator. It will gladly return a result for invalid JSON (which is OK since that will be promptly rejected by the JSON parser). What matters is that it is guaranteed to return the correct end when presented with valid JSON.
Input string containing serialized JSON..
Starting position.
Create a new empty buffer.
The buffer's size.
Convert map to array of values (polyfill for Object.values
).
Map.
Find index of value in array.
Can also be a false-ish value.
Value to find.
Returns -1 if not found, -2 if found multiple times.
Convert array to map.
Elements.
Function returning an element's key.
Generated using TypeDoc
Various utilities used across this library.