Comparing version 1.1.1 to 1.1.2
@@ -127,2 +127,21 @@ /*! | ||
/** | ||
* Finish rendering the buffer. Fill | ||
* remaining bytes with zeroes. | ||
* @returns {Buffer} Rendered buffer. | ||
*/ | ||
finish() { | ||
const {data, offset} = this; | ||
if (offset > data.length) | ||
throw new EncodingError(offset, 'Out of bounds write'); | ||
data.fill(0, offset, data.length); | ||
this.destroy(); | ||
return data; | ||
} | ||
/** | ||
* Get size of data written so far. | ||
@@ -129,0 +148,0 @@ * @returns {Number} |
{ | ||
"name": "bufio", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Buffer and serialization utilities for javascript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98345
3761