Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avsc

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avsc - npm Package Compare versions

Comparing version 3.3.1 to 3.3.2

29

lib/schemas.js

@@ -58,3 +58,10 @@ /* jshint node: true */

opts = opts || {};
opts.reader = opts.reader || createReader();
// TODO: Remove this legacy hook name in next major release. (It also wasn't
// as flexible since it didn't expose the import kind.)
/* istanbul ignore next */
if (opts.reader) {
opts.importHook = wrapReader(opts.reader);
} else {
opts.importHook = opts.importHook || createImportHook();
}

@@ -66,3 +73,3 @@ var attrs = {types: [], messages: {}}; // Final result.

opts.reader(path.resolve(fpath), function (err, str) {
opts.importHook(path.resolve(fpath), 'idl', function (err, str) {
if (err) {

@@ -108,4 +115,4 @@ cb(err);

// attributes for named type declarations, they are all top level).
if (importAttrs.namespace) {
typeAttrs.namespace = typeAttrs.namespace || importAttrs.namespace;
if (importAttrs.namespace && typeAttrs.namespace === undefined) {
typeAttrs.namespace = importAttrs.namespace;
}

@@ -137,3 +144,3 @@ importedTypes.push(typeAttrs);

// We are importing a protocol or schema file.
opts.reader(info.path, function (err, str) {
opts.importHook(info.path, info.kind, function (err, str) {
if (err) {

@@ -385,5 +392,5 @@ cb(err);

*/
function createReader() {
function createImportHook() {
var imports = {};
return function (fpath, cb) {
return function (fpath, kind, cb) {
if (imports[fpath]) {

@@ -400,2 +407,10 @@ // Already imported, return nothing to avoid duplicating attributes.

/**
* Legacy import hook.
*
*/
/* istanbul ignore next */ var wrapReader = util.deprecate(function (reader) {
return function (fpath, kind, cb) { reader(fpath, cb); };
}, '`reader` option is deprecated please use `importHook` instead');
/**
* Simple class to split an input string into tokens.

@@ -402,0 +417,0 @@ *

{
"name": "avsc",
"version": "3.3.1",
"version": "3.3.2",
"description": "Avro for JavaScript",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/mtth/avsc",

Sorry, the diff of this file is too big to display

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