summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer')
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.npmignore5
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.travis.yml11
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/LICENSE20
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/README.md307
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js726
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js.map1
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/lib/smart-buffer.js371
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/package.json70
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/test/smart-buffer.test.js410
-rw-r--r--deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/typings/index.d.ts383
10 files changed, 0 insertions, 2304 deletions
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.npmignore b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.npmignore
deleted file mode 100644
index 6bcbf6f77d..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.git*
-.idea*
-node_modules/
-npm-debug.log
-coverage \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.travis.yml b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.travis.yml
deleted file mode 100644
index 9d67de5878..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: node_js
-node_js:
- - 0.10
- - 0.12
- - 4
- - 6
- - stable
-
-script: "npm run coverage"
-# Send coverage data to Coveralls
-after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/LICENSE b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/LICENSE
deleted file mode 100644
index b2442a9e71..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Josh Glazebrook
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/README.md b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/README.md
deleted file mode 100644
index 178ce8827f..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/README.md
+++ /dev/null
@@ -1,307 +0,0 @@
-smart-buffer [![Build Status](https://travis-ci.org/JoshGlazebrook/smart-buffer.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/smart-buffer) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/smart-buffer/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/smart-buffer?branch=master)
-=============
-
-smart-buffer is a light Buffer wrapper that takes away the need to keep track of what position to read and write data to and from the underlying Buffer. It also adds null terminating string operations and **grows** as you add more data.
-
-
-### What it's useful for:
-
-I created smart-buffer because I wanted to simplify the process of using Buffer for building and reading network packets to send over a socket. Rather than having to keep track of which position I need to write a UInt16 to after adding a string of variable length, I simply don't have to.
-
-Key Features:
-* Proxies all of the Buffer write and read functions.
-* Keeps track of read and write positions for you.
-* Grows the internal Buffer as you add data to it.
-* Useful string operations. (Null terminating strings)
-* Allows for inserting values at specific points in the internal Buffer.
-
-#### Note:
-smart-buffer can be used for writing to an underlying buffer as well as reading from it. It however does not function correctly if you're mixing both read and write operations with each other.
-
-## Installing:
-
-`npm install smart-buffer`
-
-## Using smart-buffer
-
-### Example
-
-Say you were building a packet that had to conform to the following protocol:
-
-`[PacketType:2][PacketLength:2][Data:XX]`
-
-To build this packet using the vanilla Buffer class, you would have to count up the length of the data payload beforehand. You would also need to keep track of the current "cursor" position in your Buffer so you write everything in the right places. With smart-buffer you don't have to do either of those things.
-
-```javascript
-function createLoginPacket(username, password, age, country) {
- var packet = new SmartBuffer();
- packet.writeUInt16LE(0x0060); // Login Packet Type/ID
- packet.writeStringNT(username);
- packet.writeStringNT(password);
- packet.writeUInt8(age);
- packet.writeStringNT(country);
- packet.writeUInt16LE(packet.length - 2, 2);
-
- return packet.toBuffer();
-}
-```
-With the above function, you now can do this:
-```javascript
-var login = createLoginPacket("Josh", "secret123", 22, "United States");
-
-// <Buffer 60 00 1e 00 4a 6f 73 68 00 73 65 63 72 65 74 31 32 33 00 16 55 6e 69 74 65 64 20 53 74 61 74 65 73 00>
-```
-Notice that the `[PacketLength:2]` part of the packet was inserted after we had added everything else, and as shown in the Buffer dump above, is in the correct location along with everything else.
-
-Reading back the packet we created above is just as easy:
-```javascript
-
-var reader = new SmartBuffer(login);
-
-var logininfo = {
- packetType: reader.readUInt16LE(),
- packetLength: reader.readUInt16LE(),
- username: reader.readStringNT(),
- password: reader.readStringNT(),
- age: reader.readUInt8(),
- country: reader.readStringNT()
-};
-
-/*
-{
- packetType: 96, (0x0060)
- packetLength: 30,
- username: 'Josh',
- password: 'secret123',
- age: 22,
- country: 'United States'
-};
-*/
-```
-
-# Api Reference:
-
-### Constructing a smart-buffer
-
-smart-buffer has a few different constructor signatures you can use. By default, utf8 encoding is used, and the internal Buffer length will be 4096. When reading from a Buffer, smart-buffer does NOT make a copy of the Buffer. It reads from the Buffer it was given.
-
-```javascript
-var SmartBuffer = require('smart-buffer');
-
-// Reading from an existing Buffer:
-var reader = new SmartBuffer(buffer);
-var reader = new SmartBuffer(buffer, 'ascii');
-
-// Writing to a new Buffer:
-var writer = new SmartBuffer(); // Defaults to utf8, 4096 length internal Buffer.
-var writer = new SmartBuffer(1024); // Defaults to utf8, 1024 length internal Buffer.
-var writer = new SmartBuffer('ascii'); // Sets to ascii encoding, 4096 length internal buffer.
-var writer = new SmartBuffer(1024, 'ascii'); // Sets to ascii encoding, 1024 length internal buffer.
-```
-
-## Reading Data
-
-smart-buffer supports all of the common read functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to start reading from. This is possible because as you read data out of a smart-buffer, it automatically progresses an internal read offset/position to know where to pick up from on the next read.
-
-## Reading Numeric Values
-
-When numeric values, you simply need to call the function you want, and the data is returned.
-
-Supported Operations:
-* readInt8
-* readInt16BE
-* readInt16LE
-* readInt32BE
-* readInt32LE
-* readUInt8
-* readUInt16BE
-* readUInt16LE
-* readUInt32BE
-* readUInt32LE
-* readFloatBE
-* readFloatLE
-* readDoubleBE
-* readDoubleLE
-
-```javascript
-var reader = new SmartBuffer(somebuffer);
-var num = reader.readInt8();
-```
-
-## Reading String Values
-
-When reading String values, you can either choose to read a null terminated string, or a string of a specified length.
-
-### SmartBuffer.readStringNT( [encoding] )
-> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
-
-returns `String`
-
-> Note: When readStringNT is called and there is no null character found, smart-buffer will read to the end of the internal Buffer.
-
-### SmartBuffer.readString( [length], [encoding] )
-### SmartBuffer.readString( [length] )
-### SmartBuffer.readString( [encoding] )
-> `Number` **Length of the string to read**
-
-> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
-
-returns `String`
-
-> Note: When readString is called without a specified length, smart-buffer will read to the end of the internal Buffer.
-
-
-
-## Reading Buffer Values
-
-### SmartBuffer.readBuffer( length )
-> `Number` **Length of data to read into a Buffer**
-
-returns `Buffer`
-
-> Note: This function uses `slice` to retrieve the Buffer.
-
-
-### SmartBuffer.readBufferNT()
-
-returns `Buffer`
-
-> Note: This reads the next sequence of bytes in the buffer until a null (0x00) value is found. (Null terminated buffer)
-> Note: This function uses `slice` to retrieve the Buffer.
-
-
-## Writing Data
-
-smart-buffer supports all of the common write functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to write to in your Buffer by default. You do however have the option of **inserting** a piece of data into your smart-buffer at a given location.
-
-
-## Writing Numeric Values
-
-
-For numeric values, you simply need to call the function you want, and the data is written at the end of the internal Buffer's current write position. You can specify a offset/position to **insert** the given value at, but keep in mind this does not override data at the given position. This feature also does not work properly when inserting a value beyond the current internal length of the smart-buffer (length being the .length property of the smart-buffer instance you're writing to)
-
-Supported Operations:
-* writeInt8
-* writeInt16BE
-* writeInt16LE
-* writeInt32BE
-* writeInt32LE
-* writeUInt8
-* writeUInt16BE
-* writeUInt16LE
-* writeUInt32BE
-* writeUInt32LE
-* writeFloatBE
-* writeFloatLE
-* writeDoubleBE
-* writeDoubleLE
-
-The following signature is the same for all the above functions:
-
-### SmartBuffer.writeInt8( value, [offset] )
-> `Number` **A valid Int8 number**
-
-> `Number` **The position to insert this value at**
-
-returns this
-
-> Note: All write operations return `this` to allow for chaining.
-
-## Writing String Values
-
-When reading String values, you can either choose to write a null terminated string, or a non null terminated string.
-
-### SmartBuffer.writeStringNT( value, [offset], [encoding] )
-### SmartBuffer.writeStringNT( value, [offset] )
-### SmartBuffer.writeStringNT( value, [encoding] )
-> `String` **String value to write**
-
-> `Number` **The position to insert this String at**
-
-> `String` **The String encoding to use.** - Defaults to the encoding set in the constructor, or utf8.
-
-returns this
-
-### SmartBuffer.writeString( value, [offset], [encoding] )
-### SmartBuffer.writeString( value, [offset] )
-### SmartBuffer.writeString( value, [encoding] )
-> `String` **String value to write**
-
-> `Number` **The position to insert this String at**
-
-> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
-
-returns this
-
-
-## Writing Buffer Values
-
-### SmartBuffer.writeBuffer( value, [offset] )
-> `Buffer` **Buffer value to write**
-
-> `Number` **The position to insert this Buffer's content at**
-
-returns this
-
-### SmartBuffer.writeBufferNT( value, [offset] )
-> `Buffer` **Buffer value to write**
-
-> `Number` **The position to insert this Buffer's content at**
-
-returns this
-
-
-## Utility Functions
-
-### SmartBuffer.clear()
-Resets the SmartBuffer to its default state where it can be reused for reading or writing.
-
-### SmartBuffer.remaining()
-
-returns `Number` The amount of data left to read based on the current read Position.
-
-### SmartBuffer.skip( value )
-> `Number` **The amount of bytes to skip ahead**
-
-Skips the read position ahead by the given value.
-
-returns this
-
-### SmartBuffer.rewind( value )
-> `Number` **The amount of bytes to reward backwards**
-
-Rewinds the read position backwards by the given value.
-
-returns this
-
-### SmartBuffer.skipTo( position )
-> `Number` **The point to skip the read position to**
-
-Moves the read position to the given point.
-returns this
-
-### SmartBuffer.toBuffer()
-
-returns `Buffer` A Buffer containing the contents of the internal Buffer.
-
-> Note: This uses the slice function.
-
-### SmartBuffer.toString( [encoding] )
-> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
-
-returns `String` The internal Buffer in String representation.
-
-### SmartBuffer.destroy()
-Attempts to destroy the smart-buffer.
-
-returns this
-
-## Properties
-
-### SmartBuffer.length
-
-returns `Number` **The length of the data that is being tracked in the internal Buffer** - Does NOT return the absolute length of the internal Buffer being written to.
-
-## License
-
-This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js
deleted file mode 100644
index ef53b9fd4d..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js
+++ /dev/null
@@ -1,726 +0,0 @@
-"use strict";
-// The default Buffer size if one is not provided.
-const DEFAULT_SMARTBUFFER_SIZE = 4096;
-// The default string encoding to use for reading/writing strings.
-const DEFAULT_SMARTBUFFER_ENCODING = 'utf8';
-class SmartBuffer {
- /**
- * Creates a new SmartBuffer instance.
- *
- * @param arg1 { Number | BufferEncoding | Buffer | SmartBufferOptions }
- * @param arg2 { BufferEncoding }
- */
- constructor(arg1, arg2) {
- this.length = 0;
- this.encoding = DEFAULT_SMARTBUFFER_ENCODING;
- this.writeOffset = 0;
- this.readOffset = 0;
- // Initial buffer size provided
- if (typeof arg1 === 'number') {
- if (Number.isFinite(arg1) && Number.isInteger(arg1) && arg1 > 0) {
- this.buff = Buffer.allocUnsafe(arg1);
- }
- else {
- throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
- }
- }
- else if (typeof arg1 === 'string') {
- if (Buffer.isEncoding(arg1)) {
- this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
- this.encoding = arg1;
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- else if (arg1 instanceof Buffer) {
- this.buff = arg1;
- this.length = arg1.length;
- }
- else if (SmartBuffer.isSmartBufferOptions(arg1)) {
- // Checks for encoding
- if (arg1.encoding) {
- if (Buffer.isEncoding(arg1.encoding)) {
- this.encoding = arg1.encoding;
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- // Checks for initial size length
- if (arg1.size) {
- if (Number.isFinite(arg1.size) && Number.isInteger(arg1.size) && arg1.size > 0) {
- this.buff = Buffer.allocUnsafe(arg1.size);
- }
- else {
- throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
- }
- }
- else if (arg1.buff) {
- if (arg1.buff instanceof Buffer) {
- this.buff = arg1.buff;
- this.length = arg1.buff.length;
- }
- else {
- throw new Error('Invalid buffer provided in SmartBufferOptions.');
- }
- }
- else {
- this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
- }
- }
- else if (typeof arg1 === 'object') {
- throw new Error('Invalid object supplied to SmartBuffer constructor.');
- }
- else {
- this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
- }
- // Check for encoding (Buffer, Encoding) constructor.
- if (typeof arg2 === 'string') {
- if (Buffer.isEncoding(arg2)) {
- this.encoding = arg2;
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- }
- /**
- * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
- *
- * @param size { Number } The size of the internal Buffer.
- * @param encoding { String } The BufferEncoding to use for strings.
- *
- * @return { SmartBuffer }
- */
- static fromSize(size, encoding) {
- return new this({
- size: size,
- encoding: encoding
- });
- }
- /**
- * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
- *
- * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
- * @param encoding { String } The BufferEncoding to use for strings.
- *
- * @return { SmartBuffer }
- */
- static fromBuffer(buff, encoding) {
- return new this({
- buff: buff,
- encoding: encoding
- });
- }
- /**
- * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
- *
- * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
- */
- static fromOptions(options) {
- return new this(options);
- }
- /**
- * Ensures that the internal Buffer is large enough to write data.
- *
- * @param minLength { Number } The minimum length of the data that needs to be written.
- * @param offset { Number } The offset of the data to be written.
- */
- ensureWriteable(minLength, offset) {
- const offsetVal = typeof offset === 'number' ? offset : 0;
- // Ensure there is enough internal Buffer capacity.
- this.ensureCapacity(this.length + minLength + offsetVal);
- // If offset is provided, copy data into appropriate location in regards to the offset.
- if (typeof offset === 'number') {
- this.buff.copy(this.buff, offsetVal + minLength, offsetVal, this.buff.length);
- }
- // Adjust instance length.
- this.length = Math.max(this.length + minLength, offsetVal + minLength);
- }
- /**
- * Ensures that the internal Buffer is large enough to write at least the given amount of data.
- *
- * @param minLength { Number } The minimum length of the data needs to be written.
- */
- ensureCapacity(minLength) {
- const oldLength = this.buff.length;
- if (minLength > oldLength) {
- let data = this.buff;
- let newLength = (oldLength * 3) / 2 + 1;
- if (newLength < minLength) {
- newLength = minLength;
- }
- this.buff = Buffer.allocUnsafe(newLength);
- data.copy(this.buff, 0, 0, oldLength);
- }
- }
- /**
- * Reads a numeric number value using the provided function.
- *
- * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
- * @param byteSize { Number } The number of bytes read.
- *
- * @param { Number }
- */
- readNumberValue(func, byteSize) {
- // Call Buffer.readXXXX();
- const value = func.call(this.buff, this.readOffset);
- // Adjust internal read offset
- this.readOffset += byteSize;
- return value;
- }
- /**
- * Writes a numeric number value using the provided function.
- *
- * @param func { Function(offset: number, offset?) => number} The function to write data on the internal Buffer with.
- * @param byteSize { Number } The number of bytes written.
- * @param value { Number } The number value to write.
- * @param offset { Number } the offset to write the number at.
- *
- */
- writeNumberValue(func, byteSize, value, offset) {
- const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
- // Ensure there is enough internal Buffer capacity. (raw offset is passed)
- this.ensureWriteable(byteSize, offset);
- // Call buffer.writeXXXX();
- func.call(this.buff, value, offsetVal);
- // Adjusts internal write offset
- this.writeOffset += byteSize;
- }
- // Signed integers
- /**
- * Reads an Int8 value from the current read position.
- *
- * @return { Number }
- */
- readInt8() {
- return this.readNumberValue(Buffer.prototype.readUInt8, 1);
- }
- /**
- * Reads an Int16BE value from the current read position.
- *
- * @return { Number }
- */
- readInt16BE() {
- return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
- }
- /**
- * Reads an Int16LE value from the current read position.
- *
- * @return { Number }
- */
- readInt16LE() {
- return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
- }
- /**
- * Reads an Int32BE value from the current read position.
- *
- * @return { Number }
- */
- readInt32BE() {
- return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
- }
- /**
- * Reads an Int32LE value from the current read position.
- *
- * @return { Number }
- */
- readInt32LE() {
- return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
- }
- /**
- * Writes an Int8 value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeInt8(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
- return this;
- }
- /**
- * Writes an Int16BE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeInt16BE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
- return this;
- }
- /**
- * Writes an Int16LE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeInt16LE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
- return this;
- }
- /**
- * Writes an Int32BE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeInt32BE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
- return this;
- }
- /**
- * Writes an Int32LE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeInt32LE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
- return this;
- }
- // Unsigned Integers
- /**
- * Reads an UInt8 value from the current read position.
- *
- * @return { Number }
- */
- readUInt8() {
- return this.readNumberValue(Buffer.prototype.readUInt8, 1);
- }
- /**
- * Reads an UInt16BE value from the current read position.
- *
- * @return { Number }
- */
- readUInt16BE() {
- return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
- }
- /**
- * Reads an UInt16LE value from the current read position.
- *
- * @return { Number }
- */
- readUInt16LE() {
- return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
- }
- /**
- * Reads an UInt32BE value from the current read position.
- *
- * @return { Number }
- */
- readUInt32BE() {
- return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
- }
- /**
- * Reads an UInt32LE value from the current read position.
- *
- * @return { Number }
- */
- readUInt32LE() {
- return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
- }
- /**
- * Writes an UInt8 value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeUInt8(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
- return this;
- }
- /**
- * Writes an UInt16BE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeUInt16BE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
- return this;
- }
- /**
- * Writes an UInt16LE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeUInt16LE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
- return this;
- }
- /**
- * Writes an UInt32BE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeUInt32BE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
- return this;
- }
- /**
- * Writes an UInt32LE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeUInt32LE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
- return this;
- }
- // Floating Point
- /**
- * Reads an FloatBE value from the current read position.
- *
- * @return { Number }
- */
- readFloatBE() {
- return this.readNumberValue(Buffer.prototype.readFloatBE, 4);
- }
- /**
- * Reads an FloatLE value from the current read position.
- *
- * @return { Number }
- */
- readFloatLE() {
- return this.readNumberValue(Buffer.prototype.readFloatLE, 4);
- }
- /**
- * Writes a FloatBE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeFloatBE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
- return this;
- }
- /**
- * Writes a FloatLE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeFloatLE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
- return this;
- }
- // Double Floating Point
- /**
- * Reads an DoublEBE value from the current read position.
- *
- * @return { Number }
- */
- readDoubleBE() {
- return this.readNumberValue(Buffer.prototype.readDoubleBE, 8);
- }
- /**
- * Reads an DoubleLE value from the current read position.
- *
- * @return { Number }
- */
- readDoubleLE() {
- return this.readNumberValue(Buffer.prototype.readDoubleLE, 8);
- }
- /**
- * Writes a DoubleBE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeDoubleBE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
- return this;
- }
- /**
- * Writes a DoubleLE value to the current write position (or at optional offset).
- *
- * @param value { Number } The value to write.
- * @param offset { Number } The offset to write the value at.
- *
- * @return this
- */
- writeDoubleLE(value, offset) {
- this.writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
- return this;
- }
- // Strings
- /**
- * Reads a String from the current read position.
- *
- * @param length { Number } The number of bytes to read as a String.
- * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
- *
- * @return { String }
- */
- readString(length, encoding) {
- const lengthVal = Math.min(length, this.length - this.readOffset) || this.length - this.readOffset;
- const value = this.buff.slice(this.readOffset, this.readOffset + lengthVal).toString(encoding || this.encoding);
- this.readOffset += lengthVal;
- return value;
- }
- /**
- * Writes a String to the current write position.
- *
- * @param value { String } The String value to write.
- * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
- * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
- */
- writeString(value, arg2, encoding) {
- let offsetVal = this.writeOffset;
- let encodingVal = this.encoding;
- // Check for offset
- if (typeof arg2 === 'number') {
- offsetVal = arg2;
- }
- else if (typeof arg2 === 'string') {
- if (Buffer.isEncoding(arg2)) {
- encodingVal = arg2;
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- // Check for encoding (third param)
- if (typeof encoding === 'string') {
- if (Buffer.isEncoding(encoding)) {
- encodingVal = encoding;
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- // Calculate bytelength of string.
- const byteLength = Buffer.byteLength(value, encodingVal);
- // Ensure there is enough internal Buffer capacity.
- this.ensureWriteable(byteLength, offsetVal);
- // Write value
- this.buff.write(value, offsetVal, byteLength, encodingVal);
- // Increment internal Buffer write offset;
- this.writeOffset += byteLength;
- return this;
- }
- /**
- * Reads a null-terminated String from the current read position.
- *
- * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
- *
- * @return { String }
- */
- readStringNT(encoding) {
- // Set null character position to the end SmartBuffer instance.
- let nullPos = this.length;
- // Find next null character (if one is not found, default from above is used)
- for (let i = this.readOffset; i < this.length; i++) {
- if (this.buff[i] === 0x00) {
- nullPos = i;
- break;
- }
- }
- // Read string value
- const value = this.buff.slice(this.readOffset, nullPos);
- // Increment internal Buffer read offset
- this.readOffset = nullPos + 1;
- return value.toString(encoding || this.encoding);
- }
- /**
- * Writes a null-terminated String to the current write position.
- *
- * @param value { String } The String value to write.
- * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
- * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
- */
- writeStringNT(value, offset, encoding) {
- // Write Values
- this.writeString(value, offset, encoding);
- this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
- }
- // Buffers
- /**
- * Reads a Buffer from the internal read position.
- *
- * @param length { Number } The length of data to read as a Buffer.
- *
- * @return { Buffer }
- */
- readBuffer(length) {
- const lengthVal = typeof length === 'number' ? length : this.length;
- const endPoint = Math.min(this.length, this.readOffset + lengthVal);
- // Read buffer value
- const value = this.buff.slice(this.readOffset, endPoint);
- // Increment internal Buffer read offset
- this.readOffset = endPoint;
- return value;
- }
- /**
- * Writes a Buffer to the current write position.
- *
- * @param value { Buffer } The Buffer to write.
- * @param offset { Number } The offset to write the Buffer to.
- */
- writeBuffer(value, offset) {
- const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
- // Ensure there is enough internal Buffer capacity.
- this.ensureWriteable(value.length, offsetVal);
- // Write buffer value
- value.copy(this.buff, offsetVal);
- // Increment internal Buffer write offset
- this.writeOffset += value.length;
- return this;
- }
- /**
- * Reads a null-terminated Buffer from the current read poisiton.
- *
- * @return { Buffer }
- */
- readBufferNT() {
- // Set null character position to the end SmartBuffer instance.
- let nullPos = this.length;
- // Find next null character (if one is not found, default from above is used)
- for (let i = this.readOffset; i < this.length; i++) {
- if (this.buff[i] === 0x00) {
- nullPos = i;
- break;
- }
- }
- // Read value
- const value = this.buff.slice(this.readOffset, nullPos);
- // Increment internal Buffer read offset
- this.readOffset = nullPos + 1;
- return value;
- }
- /**
- * Writes a null-terminated Buffer to the current write position.
- *
- * @param value { Buffer } The Buffer to write.
- * @param offset { Number } The offset to write the Buffer to.
- */
- writeBufferNT(value, offset) {
- // Write Values
- this.writeBuffer(value, offset);
- this.writeUInt8(0, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
- return this;
- }
- /**
- * Clears the SmartBuffer instance to its original empty state.
- */
- clear() {
- this.writeOffset = 0;
- this.readOffset = 0;
- this.length = 0;
- }
- /**
- * Gets the remaining data left to be read from the SmartBuffer instance.
- *
- * @return { Number }
- */
- remaining() {
- return this.length - this.readOffset;
- }
- /**
- * Moves the read offset forward.
- *
- * @param amount { Number } The amount to move the read offset forward by.
- */
- skip(amount) {
- if (this.readOffset + amount > this.length) {
- throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
- }
- this.readOffset += amount;
- }
- /**
- * Moves the read offset backwards.
- *
- * @param amount { Number } The amount to move the read offset backwards by.
- */
- rewind(amount) {
- if (this.readOffset - amount < 0) {
- throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
- }
- this.readOffset -= amount;
- }
- /**
- * Moves the read offset to a specific position.
- *
- * @param position { Number } The position to move the read offset to.
- */
- skipTo(position) {
- this.moveTo(position);
- }
- /**
- * Moves the read offset to a specific position.
- *
- * @param position { Number } The position to move the read offset to.
- */
- moveTo(position) {
- if (position > this.length) {
- throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
- }
- this.readOffset = position;
- }
- /**
- * Gets the value of the internal managed Buffer
- *
- * @param { Buffer }
- */
- toBuffer() {
- return this.buff.slice(0, this.length);
- }
- /**
- * Gets the String value of the internal managed Buffer
- *
- * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
- */
- toString(encoding) {
- const encodingVal = typeof encoding === 'string' ? encoding : this.encoding;
- if (Buffer.isEncoding(encodingVal)) {
- return this.buff.toString(encodingVal, 0, this.length);
- }
- else {
- throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
- }
- }
- /**
- * Destroys the SmartBuffer instance.
- */
- destroy() {
- this.clear();
- }
- /**
- * Type checking function that determines if an object is a SmartBufferOptions object.
- */
- static isSmartBufferOptions(options) {
- const castOptions = options;
- return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);
- }
-}
-module.exports = SmartBuffer;
-//# sourceMappingURL=smartbuffer.js.map \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js.map b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js.map
deleted file mode 100644
index 60af067a2c..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/build/smartbuffer.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"smartbuffer.js","sourceRoot":"","sources":["../src/smartbuffer.ts"],"names":[],"mappings":";AAaA,kDAAkD;AAClD,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,mEAAmE;AACnE,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAE5C;IASI;;;;;OAKG;IACH,YAAY,IAA4D,EAAE,IAAqB;QAbxF,WAAM,GAAW,CAAC,CAAC;QACnB,aAAQ,GAAmB,4BAA4B,CAAC;QAEvD,gBAAW,GAAW,CAAC,CAAC;QACxB,eAAU,GAAW,CAAC,CAAC;QAW3B,+BAA+B;QAC/B,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAE3B,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC9D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAC9F,CAAC;QAEL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AAC;QACxH,CAAC;IACL,CAAC;IAED;;OAEG;IACH,OAAO;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAA2B;QACnD,MAAM,WAAW,GAAwB,OAAQ,CAAC;QAElD,MAAM,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACnI,CAAC;CACJ;AAGD,iBAAS,WAAW,CAAC"} \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/lib/smart-buffer.js b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/lib/smart-buffer.js
deleted file mode 100644
index ea69cfc09a..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/lib/smart-buffer.js
+++ /dev/null
@@ -1,371 +0,0 @@
-var SmartBuffer = (function () {
-
- /**
- * Constructor for SmartBuffer.
- * @param arg1 {Buffer || Number || String} Buffer to read from, or expected size to write to, or encoding to use.
- * @param arg2 {String} Encoding to use for writing and reading strings. Defaults to utf8. If encoding is given in arg1, this is ignored.
- * @constructor
- *
- * There are a few ways to construct a SmartBuffer:
- *
- * SmartBuffer() - Defaults to utf8, 4096 pre-set internal Buffer length.
- * SmartBuffer(size) - Defaults to utf8, sets internal Buffer length to the size given.
- * SmartBuffer(encoding) - Sets the given encoding, defaults to 4096 pre-set internal Buffer length.
- * SmartBuffer(Buffer) - Defaults to utf8, sets the internal Buffer to the given buffer (same memory).
- * SmartBuffer(Buffer, encoding) - Sets the given encoding, sets the internal Buffer to the given buffer (same memory).
- *
- */
- function SmartBuffer(arg1, arg2) {
- var type;
- switch (type = typeof arg1) {
- case 'number':
- if (isFinite(arg1) && arg1 > 0) {
- this.buff = new Buffer(Math.ceil(arg1));
- this.length = 0;
- } else {
- throw new Error('When specifying a size, it must be a valid number above zero.');
- }
- break;
-
- case 'string':
- if (Buffer.isEncoding(arg1)) {
- this.buff = new Buffer(4096);
- this.length = 0;
- this.encoding = arg1;
- } else {
- throw new Error('Invalid Encoding');
- }
- break;
-
- case 'object':
- if (Buffer.isBuffer(arg1)) {
- this.buff = arg1;
- this.length = arg1.length;
- } else {
- throw new TypeError('First argument must be a Buffer, Number representing the size, or a String representing the encoding.');
- }
- break;
-
- default:
- this.buff = new Buffer(4096);
- this.length = 0;
- break;
- }
-
- if (typeof this.encoding === 'undefined') {
- if (typeof arg2 === 'string') {
- if (Buffer.isEncoding(arg2)) {
- this.encoding = arg2;
- } else {
- throw new Error('Invalid Encoding');
- }
- }
- }
-
- this._readOffset = 0;
- this._writeOffset = 0;
- }
-
-
- SmartBuffer.prototype._ensureWritable = function (len, offset) {
- this._ensureCapacity(this.length + len + (typeof offset === 'number' ? offset : 0));
-
- if (typeof offset === 'number') {
- this.buff.copy(this.buff, offset + len, offset, this.buff.length);
- }
- this.length = Math.max(this.length + len, (typeof offset === 'number' ? offset : 0) + len);
- };
-
- SmartBuffer.prototype._ensureCapacity = function (minlen) {
- var oldlen = this.buff.length;
-
- if (minlen > oldlen) {
- var data = this.buff;
- var newlen = (oldlen * 3) / 2 + 1;
- if (newlen < minlen)
- newlen = minlen;
- this.buff = new Buffer(newlen);
- data.copy(this.buff, 0, 0, oldlen);
- }
- };
-
-
- var makeReader = function (func, size) {
- return function () {
- var ret = func.call(this.buff, this._readOffset);
- this._readOffset += size;
- return ret;
- }
- };
-
- var makeWriter = function (func, size) {
- return function (value, offset) {
- this._ensureWritable(size, offset);
- func.call(this.buff, value, typeof offset === 'number' ? offset : this._writeOffset);
- this._writeOffset += size;
- return this;
- }
- };
-
-
- /*
- Read Operations
- */
-
- SmartBuffer.prototype.readInt8 = makeReader(Buffer.prototype.readInt8, 1);
- SmartBuffer.prototype.readInt16BE = makeReader(Buffer.prototype.readInt16BE, 2);
- SmartBuffer.prototype.readInt16LE = makeReader(Buffer.prototype.readInt16LE, 2);
- SmartBuffer.prototype.readInt32BE = makeReader(Buffer.prototype.readInt32BE, 4);
- SmartBuffer.prototype.readInt32LE = makeReader(Buffer.prototype.readInt32LE, 4);
-
- SmartBuffer.prototype.readUInt8 = makeReader(Buffer.prototype.readUInt8, 1);
- SmartBuffer.prototype.readUInt16BE = makeReader(Buffer.prototype.readUInt16BE, 2);
- SmartBuffer.prototype.readUInt16LE = makeReader(Buffer.prototype.readUInt16LE, 2);
- SmartBuffer.prototype.readUInt32BE = makeReader(Buffer.prototype.readUInt32BE, 4);
- SmartBuffer.prototype.readUInt32LE = makeReader(Buffer.prototype.readUInt32LE, 4);
-
- SmartBuffer.prototype.readFloatBE = makeReader(Buffer.prototype.readFloatBE, 4);
- SmartBuffer.prototype.readFloatLE = makeReader(Buffer.prototype.readFloatLE, 4);
-
- SmartBuffer.prototype.readDoubleBE = makeReader(Buffer.prototype.readDoubleBE, 8);
- SmartBuffer.prototype.readDoubleLE = makeReader(Buffer.prototype.readDoubleLE, 8);
-
-
- /**
- * Reads a string of the given length.
- * @param length {Number} The length of the string to read. (Defaults to the length of the remaining data)
- * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or utf8)
- * @returns {string} The string.
- */
- SmartBuffer.prototype.readString = function (length, encoding) {
- var len = Math.min(length, this.length - this._readOffset) || (this.length - this._readOffset);
- var ret = this.buff.slice(this._readOffset, this._readOffset + len).toString(encoding || this.encoding);
- this._readOffset += len;
- return ret;
- };
-
- /**
- * Reads a null terminated string from the underlying buffer.
- * @param encoding {String} Encoding to use. Defaults to encoding set in constructor, or utf8.
- * @returns {string}
- */
- SmartBuffer.prototype.readStringNT = function (encoding) {
- var nullpos = this.length;
- for (var i = this._readOffset; i < this.length; i++) {
- if (this.buff[i] == 0x00) {
- nullpos = i;
- break;
- }
- }
-
- var result = this.buff.slice(this._readOffset, nullpos);
- this._readOffset = nullpos + 1;
-
- return result.toString(encoding || this.encoding);
- };
-
-
- /**
- * Reads a specified number of bytes.
- * @param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
- * @returns {Buffer} Buffer containing the read bytes.
- */
- SmartBuffer.prototype.readBuffer = function (len) {
- var endpoint = Math.min(this.length, this._readOffset + (typeof len === 'number' ? len : this.length));
- var ret = this.buff.slice(this._readOffset, endpoint);
- this._readOffset = endpoint;
- return ret;
- };
-
- /**
- * Reads a null terminated sequence of bytes from the underlying buffer.
- * @returns {Buffer} Buffer containing the read bytes.
- */
- SmartBuffer.prototype.readBufferNT = function () {
- var nullpos = this.length;
- for (var i = this._readOffset; i < this.length; i++) {
- if (this.buff[i] == 0x00) {
- nullpos = i;
- break;
- }
- }
-
- var ret = this.buff.slice(this._readOffset, nullpos);
- this._readOffset = nullpos + 1;
-
- return ret;
- };
-
-
- /*
- Write Operations
- */
-
-
- SmartBuffer.prototype.writeInt8 = makeWriter(Buffer.prototype.writeInt8, 1);
- SmartBuffer.prototype.writeInt16BE = makeWriter(Buffer.prototype.writeInt16BE, 2);
- SmartBuffer.prototype.writeInt16LE = makeWriter(Buffer.prototype.writeInt16LE, 2);
- SmartBuffer.prototype.writeInt32BE = makeWriter(Buffer.prototype.writeInt32BE, 4);
- SmartBuffer.prototype.writeInt32LE = makeWriter(Buffer.prototype.writeInt32LE, 4);
-
- SmartBuffer.prototype.writeUInt8 = makeWriter(Buffer.prototype.writeUInt8, 1);
- SmartBuffer.prototype.writeUInt16BE = makeWriter(Buffer.prototype.writeUInt16BE, 2);
- SmartBuffer.prototype.writeUInt16LE = makeWriter(Buffer.prototype.writeUInt16LE, 2);
- SmartBuffer.prototype.writeUInt32BE = makeWriter(Buffer.prototype.writeUInt32BE, 4);
- SmartBuffer.prototype.writeUInt32LE = makeWriter(Buffer.prototype.writeUInt32LE, 4);
-
- SmartBuffer.prototype.writeFloatBE = makeWriter(Buffer.prototype.writeFloatBE, 4);
- SmartBuffer.prototype.writeFloatLE = makeWriter(Buffer.prototype.writeFloatLE, 4);
-
- SmartBuffer.prototype.writeDoubleBE = makeWriter(Buffer.prototype.writeDoubleBE, 8);
- SmartBuffer.prototype.writeDoubleLE = makeWriter(Buffer.prototype.writeDoubleLE, 8);
-
-
- /**
- * Writes a string to the underlying buffer.
- * @param value {String} The string to write.
- * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
- * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
- * @returns {*}
- */
- SmartBuffer.prototype.writeString = function (value, offset, encoding) {
- var len, _offset, type = typeof offset;
-
- if (type === 'number') {
- _offset = offset;
- } else if (type === 'string') {
- encoding = offset;
- offset = this._writeOffset;
- } else {
- encoding = undefined;
- offset = this._writeOffset;
- }
-
- len = Buffer.byteLength(value, encoding || this.encoding);
- this._ensureWritable(len, _offset);
-
- this.buff.write(value, offset, len, encoding || this.encoding);
- this._writeOffset += len;
- return this;
- };
-
- /**
- * Writes a null terminated string to the underlying buffer.
- * @param value {String} The string to write.
- * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
- * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
- * @returns {*}
- */
- SmartBuffer.prototype.writeStringNT = function (value, offset, encoding) {
- this.writeString(value, offset, encoding);
- this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
- return this;
- };
-
- /**
- * Writes a Buffer to the underlying buffer.
- * @param value {Buffer} The buffer to write.
- * @param offset {Number} The offset to write the Buffer to.
- * @returns {*}
- */
- SmartBuffer.prototype.writeBuffer = function (value, offset) {
- var len = value.length;
- this._ensureWritable(len, offset);
- value.copy(this.buff, typeof offset === 'number' ? offset : this._writeOffset);
- this._writeOffset += len;
- return this;
- };
-
- /**
- * Writes a null terminated Buffer to the underlying buffer.
- * @param value {Buffer} The buffer to write.
- * @param offset {Number} The offset to write the Buffer to.
- * @returns {*}
- */
- SmartBuffer.prototype.writeBufferNT = function (value, offset) {
- this.writeBuffer(value, offset);
- this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
-
- return this;
- };
-
-
- /**
- * Resets the Endless Buffer.
- */
- SmartBuffer.prototype.clear = function () {
- this._writeOffset = 0;
- this._readOffset = 0;
- this.length = 0;
- };
-
- /**
- * Gets the remaining number of bytes to be read from the existing Buffer.
- * @returns {number} The number of bytes remaining.
- */
- SmartBuffer.prototype.remaining = function () {
- return this.length - this._readOffset;
- };
-
- /**
- * Skips the read position forward by the amount of given.
- * @param amount {Number} The amount of bytes to skip forward.
- */
- SmartBuffer.prototype.skip = function (amount) {
- if (this._readOffset + amount > this.length)
- throw new Error('Target position is beyond the bounds of the data.');
-
- this._readOffset += amount;
- };
-
- /**
- * Rewinds the read position backward by the amount given.
- * @param amount {Number} The amount of bytes to reverse backward.
- */
- SmartBuffer.prototype.rewind = function (amount) {
- if (this._readOffset - amount < 0)
- throw new Error('Target position is beyond the bounds of the data.');
-
- this._readOffset -= amount;
- };
-
- /**
- * Skips the read position to the given position.
- * @param position {Number} The position to skip to.
- */
- SmartBuffer.prototype.skipTo = function (position) {
- if (position < 0 || position > this.length)
- throw new Error('Target position is beyond the bounds of the data.');
-
- this._readOffset = position;
- };
-
- /**
- * Gets the underlying Buffer.
- * @returns {*}
- */
- SmartBuffer.prototype.toBuffer = function () {
- return this.buff.slice(0, this.length);
- };
-
- /**
- * Gets a string representation of the underlying Buffer.
- * @param encoding {String} Encoding to use. (Defaults to encoding set in constructor, or utf8.)
- * @returns {*}
- */
- SmartBuffer.prototype.toString = function (encoding) {
- return this.buff.toString(encoding || this.encoding, 0, this.length);
- };
-
- /**
- * Destroys the underlying Buffer, and resets the SmartBuffer.
- */
- SmartBuffer.prototype.destroy = function () {
- delete this.buff;
- this.clear();
- };
-
- return SmartBuffer;
-})();
-
-module.exports = SmartBuffer; \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/package.json b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/package.json
deleted file mode 100644
index f6e183c589..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/package.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "_from": "smart-buffer@^1.0.13",
- "_id": "smart-buffer@1.1.15",
- "_inBundle": false,
- "_integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=",
- "_location": "/npm-registry-fetch/smart-buffer",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "smart-buffer@^1.0.13",
- "name": "smart-buffer",
- "escapedName": "smart-buffer",
- "rawSpec": "^1.0.13",
- "saveSpec": null,
- "fetchSpec": "^1.0.13"
- },
- "_requiredBy": [
- "/npm-registry-fetch/socks"
- ],
- "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
- "_shasum": "7f114b5b65fab3e2a35aa775bb12f0d1c649bf16",
- "_spec": "smart-buffer@^1.0.13",
- "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-fetch/node_modules/socks",
- "author": {
- "name": "Josh Glazebrook"
- },
- "bugs": {
- "url": "https://github.com/JoshGlazebrook/smart-buffer/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "A smarter Buffer that keeps track of its own read and write positions while growing endlessly.",
- "devDependencies": {
- "chai": "^3.5.0",
- "coveralls": "^2.11.15",
- "istanbul": "^0.4.3",
- "mocha": "^3.2.0",
- "mocha-lcov-reporter": "^1.2.0"
- },
- "engines": {
- "node": ">= 0.10.15",
- "npm": ">= 1.3.5"
- },
- "homepage": "https://github.com/JoshGlazebrook/smart-buffer/",
- "keywords": [
- "buffer",
- "smart",
- "serialize",
- "packet",
- "network",
- "cursor",
- "simple"
- ],
- "license": "MIT",
- "main": "lib/smart-buffer.js",
- "name": "smart-buffer",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/JoshGlazebrook/smart-buffer.git"
- },
- "scripts": {
- "coverage": "istanbul cover node_modules/mocha/bin/_mocha recursive test",
- "fullcoverage": "istanbul -include-all-sources cover node_modules/mocha/bin/_mocha recursive test",
- "test": "mocha test/smart-buffer.test.js"
- },
- "typings": "typings/index",
- "version": "1.1.15"
-}
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/test/smart-buffer.test.js b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/test/smart-buffer.test.js
deleted file mode 100644
index 0897d54c2f..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/test/smart-buffer.test.js
+++ /dev/null
@@ -1,410 +0,0 @@
-var SmartBuffer = require('../lib/smart-buffer.js');
-var assert = require('chai').assert;
-
-
-describe('Constructing a SmartBuffer', function () {
- describe('Constructing with an existing Buffer', function () {
- var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
- var reader = new SmartBuffer(buff);
-
- it('should have the exact same internal Buffer when constructed with a Buffer', function () {
- assert.strictEqual(reader.buff, buff);
- });
-
- it('should return a buffer with the same content', function () {
- assert.deepEqual(reader.toBuffer(), buff);
- });
- });
-
- describe('Constructing with an existing Buffer and setting the encoding', function () {
- var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
- var reader = new SmartBuffer(buff, 'ascii');
-
- it('should have the exact same internal Buffer', function () {
- assert.strictEqual(reader.buff, buff);
- });
-
- it('should have the same encoding that was set', function () {
- assert.strictEqual(reader.encoding, 'ascii');
- });
- });
-
- describe('Constructing with a specified size', function () {
- var size = 128;
- var reader = new SmartBuffer(size);
-
- it('should have an internal Buffer with the same length as the size defined in the constructor', function () {
- assert.strictEqual(reader.buff.length, size);
- });
- });
-
- describe('Constructing with a specified encoding', function () {
- var encoding = 'utf8';
-
- it('should have an internal encoding with the encoding given to the constructor (1st argument)', function () {
- var reader = new SmartBuffer(encoding);
- assert.strictEqual(reader.encoding, encoding);
- });
-
- it('should have an internal encoding with the encoding given to the constructor (2nd argument)', function () {
- var reader = new SmartBuffer(1024, encoding);
- assert.strictEqual(reader.encoding, encoding);
- });
-
- });
-
- describe('Constructing with invalid parameters', function () {
- it('should throw an exception when given an invalid number size', function () {
- assert.throws(function () {
- var reader = new SmartBuffer(-100);
- }, Error);
- });
-
- it('should throw an exception when give a invalid encoding', function () {
- assert.throws(function () {
- var reader = new SmartBuffer('invalid');
- }, Error);
-
- assert.throws(function () {
- var reader = new SmartBuffer(1024, 'invalid');
- }, Error);
- });
-
- it('should throw and exception when given an object that is not a Buffer', function () {
- assert.throws(function () {
- var reader = new SmartBuffer(null);
- }, TypeError);
- });
- });
-});
-
-
-describe('Reading/Writing To/From SmartBuffer', function () {
- /**
- * Technically, if one of these works, they all should. But they're all here anyways.
- */
-
- describe('Numeric Values', function () {
- var reader = new SmartBuffer();
- reader.writeInt8(0x44);
- reader.writeUInt8(0xFF);
- reader.writeInt16BE(0x6699);
- reader.writeInt16LE(0x6699);
- reader.writeUInt16BE(0xFFDD);
- reader.writeUInt16LE(0xFFDD);
- reader.writeInt32BE(0x77889900);
- reader.writeInt32LE(0x77889900);
- reader.writeUInt32BE(0xFFDDCCBB);
- reader.writeUInt32LE(0xFFDDCCBB);
- reader.writeFloatBE(1.234);
- reader.writeFloatLE(1.234);
- reader.writeDoubleBE(1.234567890);
- reader.writeDoubleLE(1.234567890);
-
- it('should equal the correct values that were written above', function () {
- assert.strictEqual(reader.readInt8(), 0x44);
- assert.strictEqual(reader.readUInt8(), 0xFF);
- assert.strictEqual(reader.readInt16BE(), 0x6699);
- assert.strictEqual(reader.readInt16LE(), 0x6699);
- assert.strictEqual(reader.readUInt16BE(), 0xFFDD);
- assert.strictEqual(reader.readUInt16LE(), 0xFFDD);
- assert.strictEqual(reader.readInt32BE(), 0x77889900);
- assert.strictEqual(reader.readInt32LE(), 0x77889900);
- assert.strictEqual(reader.readUInt32BE(), 0xFFDDCCBB);
- assert.strictEqual(reader.readUInt32LE(), 0xFFDDCCBB);
- assert.closeTo(reader.readFloatBE(), 1.234, 0.001);
- assert.closeTo(reader.readFloatLE(), 1.234, 0.001);
- assert.closeTo(reader.readDoubleBE(), 1.234567890, 0.001);
- assert.closeTo(reader.readDoubleLE(), 1.234567890, 0.001);
- });
-
- });
-
- describe('Basic String Values', function () {
- var reader = new SmartBuffer();
- reader.writeStringNT('hello');
- reader.writeString('world');
- reader.writeStringNT('✎✏✎✏✎✏');
-
- it('should equal the correct strings that were written above', function () {
- assert.strictEqual(reader.readStringNT(), 'hello');
- assert.strictEqual(reader.readString(5), 'world');
- assert.strictEqual(reader.readStringNT(), '✎✏✎✏✎✏');
- });
- });
-
- describe('Mixed Encoding Strings', function () {
- var reader = new SmartBuffer('ascii');
- reader.writeStringNT('some ascii text');
- reader.writeStringNT('ѕσмє υтƒ8 тєχт', 'utf8');
-
- it('should equal the correct strings that were written above', function () {
- assert.strictEqual(reader.readStringNT(), 'some ascii text');
- assert.strictEqual(reader.readStringNT('utf8'), 'ѕσмє υтƒ8 тєχт');
- });
- });
-
- describe('Null/non-null terminating strings', function () {
- var reader = new SmartBuffer();
- reader.writeString('hello\0test\0bleh');
-
- it('should equal hello', function () {
- assert.strictEqual(reader.readStringNT(), 'hello');
- });
-
- it('should equal: test', function () {
- assert.strictEqual(reader.readString(4), 'test');
- });
-
- it('should have a length of zero', function () {
- assert.strictEqual(reader.readStringNT().length, 0);
- });
-
- it('should equal: bleh', function () {
- assert.strictEqual(reader.readStringNT(), 'bleh');
- });
-
-
- });
-
- describe('Reading string without specifying length', function () {
- var str = 'hello123';
- var writer = new SmartBuffer();
- writer.writeString(str);
-
- var reader = new SmartBuffer(writer.toBuffer());
-
- assert.strictEqual(reader.readString(), str);
- });
-
- describe('Write string as specific position', function () {
- var str = 'hello123';
- var writer = new SmartBuffer();
- writer.writeString(str, 10);
-
- var reader = new SmartBuffer(writer.toBuffer());
-
- reader.skipTo(10);
- it('Should read the correct string from the original position it was written to.', function () {
- assert.strictEqual(reader.readString(), str);
- });
-
-
- });
-
- describe('Buffer Values', function () {
- describe('Writing buffer to position 0', function () {
- var buff = new SmartBuffer();
- var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
- buff.writeStringNT('hello');
- buff.writeBuffer(frontBuff, 0);
-
- it('should write the buffer to the front of the smart buffer instance', function () {
- var readBuff = buff.readBuffer(frontBuff.length);
- assert.deepEqual(readBuff, frontBuff);
- });
- });
-
- describe('Writing null terminated buffer to position 0', function () {
- var buff = new SmartBuffer();
- var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
- buff.writeStringNT('hello');
- buff.writeBufferNT(frontBuff, 0);
-
- console.log(buff);
-
- it('should write the buffer to the front of the smart buffer instance', function () {
- var readBuff = buff.readBufferNT();
- console.log(readBuff);
- assert.deepEqual(readBuff, frontBuff);
- });
- });
-
- describe('Explicit lengths', function () {
- var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
- var reader = new SmartBuffer();
- reader.writeBuffer(buff);
-
- it('should equal the buffer that was written above.', function () {
- assert.deepEqual(reader.readBuffer(7), buff);
- });
- });
-
- describe('Implicit lengths', function () {
- var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
- var reader = new SmartBuffer();
- reader.writeBuffer(buff);
-
- it('should equal the buffer that was written above.', function () {
- assert.deepEqual(reader.readBuffer(), buff);
- });
- });
-
- describe('Null Terminated Buffer Reading', function () {
- var buff = new SmartBuffer();
- buff.writeBuffer(new Buffer([0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03]));
-
- var read1 = buff.readBufferNT();
- var read2 = buff.readBufferNT();
-
- it('Should return a length of 4 for the four bytes before the first null in the buffer.', function () {
- assert.equal(read1.length, 4);
- });
-
- it('Should return a length of 3 for the three bytes after the first null in the buffer after reading to end.', function () {
- assert.equal(read2.length, 3);
- });
- });
-
- describe('Null Terminated Buffer Writing', function () {
- var buff = new SmartBuffer();
- buff.writeBufferNT(new Buffer([0x01, 0x02, 0x03, 0x04]));
-
- var read1 = buff.readBufferNT();
-
- it('Should read the correct null terminated buffer data.', function () {
- assert.equal(read1.length, 4);
- });
-
- })
-
- });
-
- describe('Inserting values into specific positions', function () {
- var reader = new SmartBuffer();
-
- reader.writeUInt16LE(0x0060);
- reader.writeStringNT('something');
- reader.writeUInt32LE(8485934);
- reader.writeUInt16LE(6699);
- reader.writeStringNT('else');
- reader.writeUInt16LE(reader.length - 2, 2);
-
-
- it('should equal the size of the remaining data in the buffer', function () {
- reader.readUInt16LE();
- var size = reader.readUInt16LE();
- assert.strictEqual(reader.remaining(), size);
- });
- });
-
- describe('Adding more data to the buffer than the internal buffer currently allows.', function () {
- it('Should automatically adjust internal buffer size when needed', function () {
- var writer = new SmartBuffer();
- var largeBuff = new Buffer(10000);
-
- writer.writeBuffer(largeBuff);
-
- assert.strictEqual(writer.length, largeBuff.length);
- });
- });
-
-});
-
-describe('Skipping around data', function () {
- var writer = new SmartBuffer();
- writer.writeStringNT('hello');
- writer.writeUInt16LE(6699);
- writer.writeStringNT('world!');
-
- it('Should equal the UInt16 that was written above', function () {
- var reader = new SmartBuffer(writer.toBuffer());
- reader.skip(6);
- assert.strictEqual(reader.readUInt16LE(), 6699);
- reader.skipTo(0);
- assert.strictEqual(reader.readStringNT(), 'hello');
- reader.rewind(6);
- assert.strictEqual(reader.readStringNT(), 'hello');
- });
-
- it('Should throw an error when attempting to skip more bytes than actually exist.', function () {
- var reader = new SmartBuffer(writer.toBuffer());
-
- assert.throws(function () {
- reader.skip(10000);
- });
- });
-
- it('Should throw an error when attempting to skip to a position that does not exist.', function () {
- var reader = new SmartBuffer(writer.toBuffer());
-
- assert.throws(function () {
- reader.skipTo(10000);
- });
- });
-
- it('Should throw an error when attempting to rewind past the start of the buffer.', function () {
- var buff = new SmartBuffer();
- assert.throws(function () {
- buff.rewind(10000);
- });
- });
-});
-
-describe('Automatic internal buffer resizing', function () {
- var writer;
-
- it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo fails)', function () {
- var str = 'String larger than one byte';
- writer = new SmartBuffer(1);
- writer.writeString(str);
-
- assert.strictEqual(writer.buff.length, str.length);
-
- });
-
- it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo succeeds)', function () {
- writer = new SmartBuffer(100);
- var buff = new Buffer(105);
-
- writer.writeBuffer(buff);
-
- // Test internal array growth algo.
- assert.strictEqual(writer.buff.length, (100 * 3 / 2 + 1));
- });
-});
-
-describe('Clearing the buffer', function () {
- var writer = new SmartBuffer();
- writer.writeString('somedata');
-
- it('Should contain some data.', function () {
- assert.notStrictEqual(writer.length, 0);
- });
-
- it('Should contain zero data after being cleared.', function () {
- writer.clear();
- assert.strictEqual(writer.length, 0);
- });
-});
-
-describe('Displaying the buffer as a string', function () {
- var buff = new Buffer([1, 2, 3, 4]);
- var sbuff = new SmartBuffer(buff);
-
- var str = buff.toString();
- var str64 = buff.toString('base64');
-
- it('Should return a valid string representing the internal buffer', function () {
- assert.strictEqual(str, sbuff.toString());
- });
-
- it('Should return a valid base64 string representing the internal buffer', function () {
- assert.strictEqual(str64, sbuff.toString('base64'));
- });
-});
-
-describe('Destroying the buffer', function () {
- var writer = new SmartBuffer();
- writer.writeString('hello123');
-
- writer.destroy();
-
- it('Should have a length of zero when buffer is destroyed', function () {
- assert.strictEqual(0, writer.length);
- });
-
- it('Should have no internal buff property when buffer is destroyed', function () {
- assert.notProperty(writer, 'buff');
- });
-}); \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/typings/index.d.ts b/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/typings/index.d.ts
deleted file mode 100644
index b567f1e97c..0000000000
--- a/deps/npm/node_modules/npm-registry-fetch/node_modules/smart-buffer/typings/index.d.ts
+++ /dev/null
@@ -1,383 +0,0 @@
-// Type definitions for smart-buffer
-// Project: https://github.com/JoshGlazebrook/smart-buffer
-// Definitions by: Josh Glazebrook <https://github.com/JoshGlazebrook>
-
-
-
-declare class SmartBuffer {
- /**
- * Creates a new SmartBuffer instance (defaults to utf8 encoding)
- */
- constructor();
-
- /**
- * Creates a new SmartBuffer instance
- *
- * @param arg1 { Number } The size the underlying buffer instance should be instantiated to (defaults to 4096)
- * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
- */
- constructor(size: number, encoding?: string);
-
- /**
- * Creates a new SmartBuffer instance
- *
- * @param arg1 { String } The string encoding to use for reading/writing strings (defaults to utf8)
- */
- constructor(encoding?: string);
-
- /**
- * Creates a new SmartBuffer instance
- *
- * @param arg1 { Buffer } An existing buffer instance to copy to this smart buffer instance
- * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
- */
- constructor(buffer: Buffer, encoding?: string)
-
-
-
- // Signed number readers
-
- /**
- * Reads a 8-bit signed integer
- */
- readInt8(): number;
-
- /**
- * Reads a 16-bit signed integer (big endian)
- */
- readInt16BE(): number;
-
- /**
- * Reads a 16-bit signed integer (little endian)
- */
- readInt16LE(): number;
-
- /**
- * Reads a 32-bit signed integer (big endian)
- */
- readInt32BE(): number;
-
- /**
- * Reads a 32-bit signed integer (little endian)
- */
- readInt32LE(): number;
-
- // Unsigned number readers
-
- /**
- * Reads a 8-bit unsigned integer
- */
- readUInt8(): number;
-
- /**
- * Reads a 16-bit unsigned integer (big endian)
- */
- readUInt16BE(): number;
-
- /**
- * Reads a 16-bit unsigned integer (little endian)
- */
- readUInt16LE(): number;
-
- /**
- * Reads a 32-bit unsigned integer (big endian)
- */
- readUInt32BE(): number;
-
- /**
- * Reads a 32-bit unsigned integer (little endian)
- */
- readUInt32LE(): number;
-
- // Floating point readers
-
- /**
- * Reads a float (big endian)
- */
- readFloatBE(): number;
-
- /**
- * Reads a float (little endian)
- */
- readFloatLE(): number;
-
- /**
- * Reads a double (big endian)
- */
- readDoubleBE(): number;
-
- /**
- * Reads a double (little endian)
- */
- readDoubleLE(): number;
-
- // String readers
-
- /**
- * Reads a string
- *
- * @param length { Number } The length of the string to read
- * @param encoding { Number} The encoding to use (defaults to instance level encoding)
- */
- readString(length?: number, encoding?: string): string;
-
- /**
- * Reads a null terminated string
- *
- * @param encoding The encoding to use (defaults to instance level encoding)
- */
- readStringNT(encoding?: string): string;
-
- // Buffer readers
-
- /**
- * Reads binary data into a Buffer
- *
- * @param len { Number } The amount of data to read
- */
- readBuffer(len?: number): Buffer;
-
- /**
- * Reads null terminated binary data into a Buffer
- */
- readBufferNT(): Buffer;
-
-
- // Signed number writers
-
- /**
- * Writes a 8-bit signed integer value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeInt8(value: number, offset?: number): this;
-
- /**
- * Writes a 16-bit signed integer (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeInt16BE(value: number, offset?: number): this;
-
- /**
- * Writes a 16-bit signed integer (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeInt16LE(value: number, offset?: number): this;
-
- /**
- * Writes a 32-bit signed integer (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeInt32BE(value: number, offset?: number): this;
-
- /**
- * Writes a 32-bit signed integer (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeInt32LE(value: number, offset?: number): this;
-
- // Unsigned number writers
-
- /**
- * Writes a 8-bit unsigned integer value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeUInt8(value: number, offset?: number): this;
-
- /**
- * Writes a 16-bit unsigned integer (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeUInt16BE(value: number, offset?: number): this;
-
- /**
- * Writes a 16-bit unsigned integer (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeUInt16LE(value: number, offset?: number): this;
-
- /**
- * Writes a 32-bit unsigned integer (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeUInt32BE(value: number, offset?: number): this;
-
- /**
- * Writes a 32-bit unsigned integer (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeUInt32LE(value: number, offset?: number): this;
-
- // Floating point writers
-
- /**
- * Writes a float (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeFloatBE(value: number, offset?: number): this;
-
- /**
- * Writes a float (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeFloatLE(value: number, offset?: number): this;
-
- /**
- * Writes a double (big endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeDoubleBE(value: number, offset?: number): this;
-
- /**
- * Writes a double (little endian) value
- *
- * @param value { Number } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeDoubleLE(value: number, offset?: number): this;
-
- // String writers
-
- /**
- * Writes a string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- /**
- * Writes a string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
- */
- /**
- * Writes a string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
- */
- writeString(value: string, offset?: number | string, encoding?: string): this;
-
- /**
- * Writes a null terminated string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- */
- /**
- * Writes a null terminated string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
- */
- /**
- * Writes a null terminated string
- *
- * @param value { String } The value to write to the buffer
- * @param offset { Number } The offset position to write the value to
- * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
- */
- writeStringNT(value: string, offset?: number | string, encoding?: string): this;
-
- // Buffer writers
-
- /**
- * Writes a Buffer
- *
- * @param value { Buffer } The Buffer to write to the smart buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeBuffer(value: Buffer, offset?: number): this;
-
- /**
- * Writes a Buffer with null termination
- *
- * @param value { Buffer } The buffer to write to the smart buffer
- * @param offset { Number } The offset position to write the value to
- */
- writeBufferNT(value: Buffer, offset?: number): this;
-
-
- // Misc Functions
-
- /**
- * Clears the smart buffer
- */
- clear();
-
- /**
- * Gets the number of bytes that remain to be read
- */
- remaining(): number;
-
- /**
- * Increases the read offset position
- *
- * @param amount { Number } The amount to increase the read offset position by
- */
- skip(amount: number);
-
- /**
- * Changes the read offset position
- *
- * @param position { Number } The position to change the read offset to
- */
- skipTo(position: number);
-
- /**
- * Decreases the read offset position
- *
- * @param amount { Number } The amount to decrease the read offset position by
- */
- rewind(amount: number);
-
- /**
- * Gets the underlying Buffer instance
- */
- toBuffer(): Buffer;
-
- /**
- * Gets the string representation of the underlying Buffer
- *
- * @param encoding { String } The encoding to use (defaults to instance level encoding)
- */
- toString(encoding?: string): string;
-
- /**
- * Destroys the smart buffer instance
- */
- destroy();
-
- /**
- * Gets the current length of the smart buffer instance
- */
- length: number;
-}
-
-export = SmartBuffer; \ No newline at end of file