Comparing version 3.2.0 to 3.2.2
@@ -19,3 +19,4 @@ /* jshint node: true */ | ||
type: 'record', | ||
name: 'org.apache.avro.file.Header', | ||
name: 'Header', | ||
namespace: 'org.apache.avro.file', | ||
fields : [ | ||
@@ -31,3 +32,4 @@ {name: 'magic', type: {type: 'fixed', name: 'Magic', size: 4}}, | ||
type: 'record', | ||
name: 'org.apache.avro.file.Block', | ||
name: 'Block', | ||
namespace: 'org.apache.avro.file', | ||
fields : [ | ||
@@ -161,4 +163,3 @@ {name: 'count', type: 'long'}, | ||
var tap = this._tap; | ||
var header = HEADER_TYPE._read(tap); | ||
if (!tap.isValid()) { | ||
if (tap.buf.length < MAGIC_BYTES.length) { | ||
// Wait until more data arrives. | ||
@@ -168,7 +169,12 @@ return false; | ||
if (!MAGIC_BYTES.equals(header.magic)) { | ||
if (!MAGIC_BYTES.equals(tap.buf.slice(0, MAGIC_BYTES.length))) { | ||
this.emit('error', new Error('invalid magic bytes')); | ||
return; | ||
return false; | ||
} | ||
var header = HEADER_TYPE._read(tap); | ||
if (!tap.isValid()) { | ||
return false; | ||
} | ||
var codec = (header.meta['avro.codec'] || 'null').toString(); | ||
@@ -175,0 +181,0 @@ this._decompress = (this._codecs || BlockDecoder.getDefaultCodecs())[codec]; |
{ | ||
"name": "avsc", | ||
"version": "3.2.0", | ||
"version": "3.2.2", | ||
"description": "Blazingly fast serialization", | ||
@@ -36,3 +36,2 @@ "homepage": "https://github.com/mtth/avsc", | ||
"clean": "rm -rf coverage node_modules", | ||
"dist": "browserify --standalone avsc . | uglifyjs -c -m --preamble \"/* v$(jq -r <package.json .version) */\" >dist/avsc.min.js", | ||
"perf": "node etc/benchmarks/javascript/perf.js etc/schemas/*", | ||
@@ -39,0 +38,0 @@ "test": "mocha", |
@@ -80,10 +80,2 @@ # Avsc [![NPM version](https://img.shields.io/npm/v/avsc.svg)](https://www.npmjs.com/package/avsc) [![Build status](https://travis-ci.org/mtth/avsc.svg?branch=master)](https://travis-ci.org/mtth/avsc) [![Coverage status](https://coveralls.io/repos/mtth/avsc/badge.svg?branch=master&service=github)](https://coveralls.io/github/mtth/avsc?branch=master) | ||
+ Check whether a value fits a given schema: | ||
```javascript | ||
var type = avsc.parse('./Person.avsc'); | ||
var person = {name: 'Bob', address: {city: 'Cambridge', zip: '02139'}}; | ||
var status = type.isValid(person); // Boolean status. | ||
``` | ||
+ Get a [readable stream][readable-stream] of decoded values from an Avro | ||
@@ -90,0 +82,0 @@ container file: |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4639
7
143846
110