Comparing version 5.0.0 to 5.0.1
@@ -171,6 +171,7 @@ /* jshint node: true */ | ||
* | ||
* + If `str` contains a `/` and is a path to an existing file, it will first | ||
* be read as JSON, then as an IDL specification if JSON parsing failed. If | ||
* either succeeds, the result is returned, otherwise the next steps are run | ||
* using the file's content instead of the input path. | ||
* + If `str` contains `path.sep` (on windows `\`, otherwise `/`) and is a path | ||
* to an existing file, it will first be read as JSON, then as an IDL | ||
* specification if JSON parsing failed. If either succeeds, the result is | ||
* returned, otherwise the next steps are run using the file's content | ||
* instead of the input path. | ||
* + If `str` is a valid JSON string, it is parsed then returned. | ||
@@ -185,3 +186,3 @@ * + If `str` is a valid IDL protocol specification, it is parsed and returned | ||
var schema; | ||
if (typeof str == 'string' && ~str.indexOf('/') && files.existsSync(str)) { | ||
if (typeof str == 'string' && ~str.indexOf(path.sep) && files.existsSync(str)) { | ||
// Try interpreting `str` as path to a file contain a JSON schema or an IDL | ||
@@ -188,0 +189,0 @@ // protocol. Note that we add the second check to skip primitive references |
{ | ||
"name": "avsc", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Avro for JavaScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/mtth/avsc", |
@@ -56,2 +56,3 @@ # Avsc [![NPM version](https://img.shields.io/npm/v/avsc.svg)](https://www.npmjs.com/package/avsc) [![Download count](https://img.shields.io/npm/dm/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) | ||
}); | ||
const buf = type.toBuffer({kind: 'CAT', name: 'Albert'}); // Encoded buffer. | ||
@@ -69,2 +70,3 @@ const val = type.fromBuffer(buf); // = {kind: 'CAT', name: 'Albert'} | ||
}); | ||
// We can use `type` to encode any values with the same structure: | ||
@@ -96,2 +98,3 @@ const bufs = [ | ||
`); | ||
// We then create a corresponding server, implementing our endpoint. | ||
@@ -101,2 +104,3 @@ const server = avro.Service.forProtocol(protocol) | ||
.onStringLength(function (str, cb) { cb(null, str.length); }); | ||
// Finally, we use our server to respond to incoming TCP connections! | ||
@@ -119,4 +123,4 @@ require('net').createServer() | ||
[home]: https://github.com/mtth/avsc/wiki | ||
[rpc]: https://github.com/mtth/avsc/wiki/Advanced-usage#remote-procedure-calls | ||
[rpc]: https://github.com/mtth/avsc/wiki/Quickstart#services | ||
[releases]: https://github.com/mtth/avsc/releases | ||
[idl]: https://avro.apache.org/docs/current/idl.html |
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
238213
7432
122