Comparing version 3.1.0 to 3.1.1
@@ -105,3 +105,3 @@ /* jshint node: true */ | ||
} catch (err) { | ||
if (opts.assertLogicalType) { | ||
if (opts.assertLogicalTypes) { | ||
// The spec mandates that we fall through to the underlying type if | ||
@@ -1796,19 +1796,27 @@ // the logical type is invalid. We provide this option to ease | ||
LogicalType.prototype._write = function (tap, val) { | ||
this._underlyingType._write(tap, this._toValue(val)); | ||
LogicalType.prototype._write = function (tap, any) { | ||
this._underlyingType._write(tap, this._toValue(any)); | ||
}; | ||
LogicalType.prototype._check = function (val, cb) { | ||
return this._underlyingType._check(this._toValue(val), cb); | ||
LogicalType.prototype._check = function (any, cb) { | ||
try { | ||
var val = this._toValue(any); | ||
} catch (err) { | ||
if (cb) { | ||
cb(PATH.slice(), any, this); | ||
} | ||
return false; | ||
} | ||
return this._underlyingType._check(val, cb); | ||
}; | ||
LogicalType.prototype._copy = function (val, opts) { | ||
LogicalType.prototype._copy = function (any, opts) { | ||
var type = this._underlyingType; | ||
switch (opts && opts.coerce) { | ||
case 3: // To string. | ||
return type._copy(this._toValue(val), opts); | ||
return type._copy(this._toValue(any), opts); | ||
case 2: // From string. | ||
return this._fromValue(type._copy(val, opts)); | ||
return this._fromValue(type._copy(any, opts)); | ||
default: // Normal copy. | ||
return this._fromValue(type._copy(this._toValue(val), opts)); | ||
return this._fromValue(type._copy(this._toValue(any), opts)); | ||
} | ||
@@ -1815,0 +1823,0 @@ }; |
{ | ||
"name": "avsc", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Blazing fast serialization", | ||
@@ -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
106638
3423