notepack.io
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -7,12 +7,13 @@ 'use strict'; | ||
this.buffer = buffer; | ||
this.view = new DataView(this.buffer); | ||
} else if (ArrayBuffer.isView(buffer)) { | ||
this.buffer = buffer.buffer; | ||
this.view = new DataView(this.buffer, buffer.byteOffset, buffer.byteLength); | ||
} else { | ||
throw new Error('Invalid argument'); | ||
} | ||
this.view = new DataView(buffer); | ||
} | ||
function utf8Read(view, offset, length) { | ||
var string = ''; | ||
var string = '', chr = 0; | ||
for (var i = offset, end = offset + length; i < end; i++) { | ||
@@ -40,8 +41,12 @@ var byte = view.getUint8(i); | ||
if ((byte & 0xf8) === 0xf0) { | ||
string += String.fromCharCode( | ||
((byte & 0x07) << 18) | | ||
chr = ((byte & 0x07) << 18) | | ||
((view.getUint8(++i) & 0x3f) << 12) | | ||
((view.getUint8(++i) & 0x3f) << 6) | | ||
((view.getUint8(++i) & 0x3f) << 0) | ||
); | ||
((view.getUint8(++i) & 0x3f) << 0); | ||
if (chr >= 0x010000) { // surrogate pair | ||
chr -= 0x010000; | ||
string += String.fromCharCode((chr >>> 10) + 0xD800, (chr & 0x3FF) + 0xDC00); | ||
} else { | ||
string += String.fromCharCode(chr); | ||
} | ||
continue; | ||
@@ -48,0 +53,0 @@ } |
@@ -0,16 +1,39 @@ | ||
<a name="2.1.1"></a> | ||
## [2.1.1](https://github.com/darrachequesne/notepack/compare/2.1.0...2.1.1) (2017-08-08) | ||
2.1.0 / 2017-07-31 | ||
=================== | ||
* feat(*): add support for toJSON method (#8) | ||
### Bug Fixes | ||
2.0.1 / 2017-06-06 | ||
=================== | ||
* **browser:** fix decoding for strings with surrogate pairs ([#13](https://github.com/darrachequesne/notepack/issues/13)) ([a89e566](https://github.com/darrachequesne/notepack/commit/a89e566)) | ||
* **browser:** preserve the offset and length when creating a DataView ([#11](https://github.com/darrachequesne/notepack/issues/11)) ([bd91aa7](https://github.com/darrachequesne/notepack/commit/bd91aa7)) | ||
* fix(encode): fix encoding for non-finite numbers (#4) | ||
2.0.0 / 2017-05-20 | ||
=================== | ||
* feat(*): Add support for ArrayBuffer (#2) | ||
* feat(browser): switch from Buffer polyfill to ArrayBuffer (#1) | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/darrachequesne/notepack/compare/2.0.1...2.1.0) (2017-07-31) | ||
### Features | ||
* add support for toJSON method ([#8](https://github.com/darrachequesne/notepack/issues/8)) ([9345f9f](https://github.com/darrachequesne/notepack/commit/9345f9f)), closes [#7](https://github.com/darrachequesne/notepack/issues/7) | ||
<a name="2.0.1"></a> | ||
## [2.0.1](https://github.com/darrachequesne/notepack/compare/2.0.0...2.0.1) (2017-06-06) | ||
### Bug Fixes | ||
* **encode:** fix encoding for non-finite numbers ([#4](https://github.com/darrachequesne/notepack/issues/4)) ([f0ed0f3](https://github.com/darrachequesne/notepack/commit/f0ed0f3)) | ||
<a name="2.0.0"></a> | ||
# [2.0.0](https://github.com/darrachequesne/notepack/compare/1.0.1...2.0.0) (2017-05-19) | ||
### Features | ||
* Add support for ArrayBuffer ([#2](https://github.com/darrachequesne/notepack/issues/2)) ([9eec8dc](https://github.com/darrachequesne/notepack/commit/9eec8dc)) | ||
* **browser:** switch from Buffer polyfill to ArrayBuffer ([#1](https://github.com/darrachequesne/notepack/issues/1)) ([8d7ce87](https://github.com/darrachequesne/notepack/commit/8d7ce87)) |
{ | ||
"name": "notepack.io", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A fast Node.js implementation of the latest MessagePack spec", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
38444
1108