Comparing version 1.1.0 to 1.1.1
@@ -37,3 +37,3 @@ 'use strict'; | ||
startPos = this.pos; | ||
readField(tag, result); | ||
readField(tag, result, this); | ||
if (this.pos === startPos) this.skip(val); | ||
@@ -40,0 +40,0 @@ } |
{ | ||
"name": "pbf", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "a low-level, lightweight protocol buffers implementation in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -89,3 +89,4 @@ # pbf | ||
It optionally accepts an object that will be passed to the reading function for easier construction of decoded data: | ||
It optionally accepts an object that will be passed to the reading function for easier construction of decoded data, | ||
and also passes the Protobuf object as a third argument: | ||
@@ -95,3 +96,3 @@ ```js | ||
function callback(tag, result) { | ||
function callback(tag, result, pbf) { | ||
if (tag === 1) result.id = pbf.readVarint(); | ||
@@ -186,3 +187,3 @@ } | ||
#### 1.1.0 (Dec 26 2014) | ||
#### 1.1.1 (Dec 26 2014) | ||
@@ -189,0 +190,0 @@ Brings tons of improvements and fixes over the previous version (`0.0.2`). |
@@ -266,7 +266,8 @@ var Pbf = require('../'), | ||
layerOffsets = [], | ||
foo = {}, res, res2; | ||
foo = {}, res, res2, buf2; | ||
res2 = buf.readFields(function (tag, result) { | ||
res2 = buf.readFields(function (tag, result, buf) { | ||
if (tag == 3) layerOffsets.push(buf.pos); | ||
res = result; | ||
buf2 = buf; | ||
}, foo); | ||
@@ -276,2 +277,3 @@ | ||
t.equal(res2, foo); | ||
t.equal(buf2, buf); | ||
@@ -287,6 +289,6 @@ t.ok(buf.pos >= buf.length); | ||
layerNames = [], | ||
foo = {}, res, res2; | ||
foo = {}; | ||
buf.readFields(function (tag) { | ||
if (tag == 3) res2 = buf.readMessage(readLayer, foo); | ||
if (tag == 3) buf.readMessage(readLayer, foo); | ||
}, foo); | ||
@@ -296,8 +298,4 @@ | ||
if (tag === 1) layerNames.push(buf.readString()); | ||
res = result; | ||
} | ||
t.equal(res, foo); | ||
t.equal(res2, foo); | ||
t.same(layerNames, ["landuse","water","barrier_line","building","tunnel","road", | ||
@@ -304,0 +302,0 @@ "place_label","water_label","poi_label","road_label","housenum_label"]); |
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
161864
218
878