Socket
Socket
Sign inDemoInstall

avro-js

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avro-js - npm Package Compare versions

Comparing version 1.11.1 to 1.11.2

4

package.json
{
"name": "avro-js",
"version": "1.11.1",
"version": "1.11.2",
"author": "Avro Developers <dev@avro.apache.org>",

@@ -51,3 +51,3 @@ "description": "JavaScript Avro implementation",

"jshint": "^2.13.4",
"mocha": "10.0.0",
"mocha": "10.2.0",
"tmp": "^0.2.1"

@@ -54,0 +54,0 @@ },

@@ -100,5 +100,46 @@ <!--

+ Implement recursive schemata (due to lack of duck-typing):
```javascript
// example type: linked list with one long-int as element value
const recursiveRecordType = avro.parse({
"type": "record",
"name": "LongList",
"fields" : [
{"name": "value", "type": "long"},
{"name": "next", "type": ["null", "LongList"]} // optional next element via recursion
]
});
// will work
const validRecursiveRecordDTO = {
value: 1,
next: {
// no duck-typing support: from first nested level on the
// recursive type has to be explicitly specified.
LongList: {
value: 2,
next: null
}
}
};
const serializedValid = recursiveRecordType.parse(validRecursiveRecordDTO);
// will throw error
const invalidRecursiveRecordDTO = {
value: 1,
next: {
value: 2,
next: null
}
};
const serializedInvalid = recursiveRecordType.parse(invalidRecursiveRecordDTO);
```
[node.js]: https://nodejs.org/en/
[readable-stream]: https://nodejs.org/api/stream.html#stream_class_stream_readable
[browserify]: http://browserify.org/
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc