smart-buffer
Advanced tools
Comparing version 4.0.0 to 4.0.1
# Change Log | ||
## 4.0 | ||
> Released xx/xx/2017 | ||
* Major breaking changes arriving in v4 | ||
> Released 10/21/2017 | ||
* Major breaking changes arriving in v4. | ||
@@ -16,5 +16,5 @@ ### New Features | ||
* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. Read more on the v4 docs. | ||
* rewind(), skip(), moveTo() has been removed. (see setting internal read and write offsets) | ||
* Internal private properties are now prefixed with underscores (_) | ||
* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert. (see write vs insert) | ||
* rewind(), skip(), moveTo() have been removed. | ||
* Internal private properties are now prefixed with underscores (_). | ||
* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert | ||
* insertXXX() methods have been added for when you want to insert data at a specific offset (this replaces the old behavior of writeXXX() when an offset was provided) | ||
@@ -21,0 +21,0 @@ |
{ | ||
"name": "smart-buffer", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", | ||
@@ -32,4 +32,4 @@ "main": "build/smartbuffer.js", | ||
"@types/chai": "4.0.4", | ||
"@types/mocha": "2.2.43", | ||
"@types/node": "8.0.46", | ||
"@types/mocha": "^2.2.44", | ||
"@types/node": "^8.0.51", | ||
"chai": "4.1.2", | ||
@@ -40,9 +40,9 @@ "coveralls": "3.0.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"nyc": "11.2.1", | ||
"nyc": "^11.3.0", | ||
"source-map-support": "0.5.0", | ||
"ts-node": "3.3.0", | ||
"tslint": "5.8.0", | ||
"typescript": "2.5.3" | ||
"typescript": "2.6.1" | ||
}, | ||
"typings": "typings", | ||
"typings": "typings/smartbuffer.d.ts", | ||
"dependencies": {}, | ||
@@ -49,0 +49,0 @@ "scripts": { |
@@ -27,3 +27,3 @@ 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) | ||
* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. | ||
* rewind(), skip(), moveTo() have been removed. (see setting internal read and write offsets) | ||
* rewind(), skip(), moveTo() have been removed. (see [offsets](#offsets)) | ||
* Internal private properties are now prefixed with underscores (_) | ||
@@ -36,3 +36,3 @@ * **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert. (see [write vs insert](#write-vs-insert)) | ||
Legacy documentation for version 3 and prior can be found [here](https://github.com/JoshGlazebrook/smart-buffer/docs/README_v3.md). | ||
Legacy documentation for version 3 and prior can be found [here](https://github.com/JoshGlazebrook/smart-buffer/blob/master/docs/README_v3.md). | ||
@@ -39,0 +39,0 @@ ## Installing: |
/// <reference types="node" /> | ||
/** | ||
declare module 'smart-buffer' { | ||
/** | ||
* Object interface for constructing new SmartBuffer instances. | ||
*/ | ||
interface SmartBufferOptions { | ||
interface SmartBufferOptions { | ||
encoding?: BufferEncoding; | ||
size?: number; | ||
buff?: Buffer; | ||
} | ||
declare class SmartBuffer { | ||
} | ||
class SmartBuffer { | ||
length: number; | ||
@@ -49,3 +50,5 @@ private _encoding; | ||
*/ | ||
static isSmartBufferOptions(options: SmartBufferOptions): options is SmartBufferOptions; | ||
static isSmartBufferOptions( | ||
options: SmartBufferOptions | ||
): options is SmartBufferOptions; | ||
/** | ||
@@ -410,3 +413,6 @@ * Reads an Int8 value from the current read position or an optionally provided offset. | ||
*/ | ||
readString(arg1?: number | BufferEncoding, encoding?: BufferEncoding): string; | ||
readString( | ||
arg1?: number | BufferEncoding, | ||
encoding?: BufferEncoding | ||
): string; | ||
/** | ||
@@ -419,3 +425,7 @@ * Inserts a String | ||
*/ | ||
insertString(value: string, offset: number, encoding?: BufferEncoding): SmartBuffer; | ||
insertString( | ||
value: string, | ||
offset: number, | ||
encoding?: BufferEncoding | ||
): SmartBuffer; | ||
/** | ||
@@ -428,3 +438,7 @@ * Writes a String | ||
*/ | ||
writeString(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): SmartBuffer; | ||
writeString( | ||
value: string, | ||
arg2?: number | BufferEncoding, | ||
encoding?: BufferEncoding | ||
): SmartBuffer; | ||
/** | ||
@@ -445,3 +459,7 @@ * Reads a null-terminated String from the current read position. | ||
*/ | ||
insertStringNT(value: string, offset: number, encoding?: BufferEncoding): void; | ||
insertStringNT( | ||
value: string, | ||
offset: number, | ||
encoding?: BufferEncoding | ||
): void; | ||
/** | ||
@@ -454,3 +472,7 @@ * Writes a null-terminated String. | ||
*/ | ||
writeStringNT(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): void; | ||
writeStringNT( | ||
value: string, | ||
arg2?: number | BufferEncoding, | ||
encoding?: BufferEncoding | ||
): void; | ||
/** | ||
@@ -636,3 +658,4 @@ * Reads a Buffer from the internal read position. | ||
private _writeNumberValue(func, byteSize, value, offset?); | ||
} | ||
export { SmartBufferOptions, SmartBuffer }; | ||
} | ||
export { SmartBufferOptions, SmartBuffer }; |
Sorry, the diff of this file is not supported yet
1893
191389
14