protobuf.js
Advanced tools
Comparing version 0.0.12 to 0.0.13
12
index.js
var fs = require('fs'), | ||
path = require('path'), | ||
butils = require('butils'); | ||
butils = require('butils'), | ||
wtf = require('wtf8'); | ||
@@ -151,3 +152,3 @@ function Protobuf(schema) { | ||
} else { | ||
val = butils.readString(buffer, pos + varint.bytes + 1, pos + len); | ||
val = new Buffer(wtf.decode(buffer.slice(pos + varint.bytes + 1, pos + len))); | ||
} | ||
@@ -204,4 +205,7 @@ } else { | ||
bytes.push((schema[key].field << 3) + schema[key].type); | ||
butils.writeVarint(bytes, Buffer.byteLength(params[key]), bytes.length); | ||
butils.writeString(bytes, params[key], bytes.length); | ||
var buf = wtf.encode(params[key]); | ||
butils.writeVarint(bytes, buf.length, bytes.length); | ||
Array.prototype.slice.call(buf, 0).forEach(function(byte) { | ||
bytes.push(byte); | ||
}); | ||
} | ||
@@ -208,0 +212,0 @@ } else if (schema[key].type === 0) { |
{ | ||
"name": "protobuf.js", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "a pure javascript protocol buffer encoding implementation, written specifically for riak", | ||
"main": "index.js", | ||
"dependencies": { | ||
"butils": "" | ||
"butils": "", | ||
"wtf8": "https://github.com/lautis/wtf8/tarball/master" | ||
}, | ||
@@ -9,0 +10,0 @@ "repository": { |
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
10767
2
6
205