Comparing version 3.0.0 to 3.1.0
@@ -0,1 +1,11 @@ | ||
<a name="3.1.0"></a> | ||
# [3.1.0](https://github.com/image-js/iobuffer/compare/v3.0.0...v3.1.0) (2016-12-15) | ||
### Features | ||
* add getBuffer method ([c798093](https://github.com/image-js/iobuffer/commit/c798093)) | ||
<a name="3.0.0"></a> | ||
@@ -2,0 +12,0 @@ # [3.0.0](https://github.com/image-js/iobuffer/compare/v2.1.0...v3.0.0) (2016-12-13) |
@@ -495,2 +495,14 @@ 'use strict'; | ||
/** | ||
* Same as {@link IOBuffer#toArray} but returns a Buffer if possible. Otherwise returns a Uint8Array. | ||
* @return {Buffer|Uint8Array} | ||
*/ | ||
getBuffer() { | ||
if (typeof Buffer !== 'undefined') { | ||
return Buffer.from(this.toArray()); | ||
} else { | ||
return this.toArray(); | ||
} | ||
} | ||
/** | ||
* Update the last written byte offset | ||
@@ -497,0 +509,0 @@ * @private |
{ | ||
"name": "iobuffer", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Read and write binary data on ArrayBuffers", | ||
@@ -5,0 +5,0 @@ "main": "./IOBuffer.js", |
@@ -48,5 +48,5 @@ # iobuffer | ||
[travis-url]: https://travis-ci.org/image-js/iobuffer | ||
[codecov-image]: https://img.shields.io/codecov/c/image-js/iobuffer.svg?style=flat-square | ||
[codecov-image]: https://img.shields.io/codecov/c/github/image-js/iobuffer.svg?style=flat-square | ||
[codecov-url]: https://codecov.io/gh/image-js/iobuffer | ||
[download-image]: https://img.shields.io/npm/dm/iobuffer.svg?style=flat-square | ||
[download-url]: https://www.npmjs.com/package/iobuffer |
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
20240
471