Comparing version 5.1.0 to 5.1.1
@@ -127,3 +127,6 @@ /* jshint node: true */ | ||
this._type = null; | ||
this._rType = opts.readerSchema !== undefined ? | ||
types.Type.forSchema(opts.readerSchema) : | ||
undefined; | ||
this._wType = null; | ||
this._codecs = opts.codecs; | ||
@@ -191,3 +194,3 @@ this._codec = undefined; | ||
} | ||
this._type = types.Type.forSchema(schema); | ||
this._wType = types.Type.forSchema(schema); | ||
} catch (err) { | ||
@@ -198,5 +201,5 @@ this.emit('error', err); | ||
this._readValue = createReader(this._noDecode, this._type); | ||
this._readValue = createReader(this._noDecode, this._wType, this._rType); | ||
this._syncMarker = header.sync; | ||
this.emit('metadata', this._type, this._codec, header); | ||
this.emit('metadata', this._wType, this._codec, header); | ||
return true; | ||
@@ -561,3 +564,3 @@ }; | ||
/** Create bytes consumer, either reading or skipping records. */ | ||
function createReader(noDecode, type) { | ||
function createReader(noDecode, writerType, readerType) { | ||
if (noDecode) { | ||
@@ -570,5 +573,8 @@ return (function (skipper) { | ||
}; | ||
})(type._skip); | ||
})(writerType._skip); | ||
} else if (readerType) { | ||
var resolver = readerType.createResolver(writerType); | ||
return function (tap) { return resolver._read(tap); }; | ||
} else { | ||
return function (tap) { return type._read(tap); }; | ||
return function (tap) { return writerType._read(tap); }; | ||
} | ||
@@ -575,0 +581,0 @@ } |
{ | ||
"name": "avsc", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "Avro for JavaScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/mtth/avsc", |
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
242296
7549