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

@ovotech/avro-ts

Package Overview
Dependencies
Maintainers
324
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ovotech/avro-ts - npm Package Compare versions

Comparing version 6.0.8 to 6.0.9

4

dist/helpers.d.ts

@@ -1,5 +0,5 @@

import { Context } from './types';
import { Document } from '@ovotech/ts-compose';
import { schema as avroSchema } from 'avsc';
import { Document } from '@ovotech/ts-compose';
import * as ts from 'typescript';
import { Context } from './types';
export declare const fullName: (context: Context, schema: avroSchema.RecordType | avroSchema.EnumType) => string;

@@ -6,0 +6,0 @@ export declare const firstUpperCase: (name: string) => string;

@@ -25,8 +25,14 @@ "use strict";

const fullName = namespaceName ? [namespaceName, name] : name;
const fieldName = `${name}Name`;
const schemaName = `${namespace}.${fieldName}`;
const value = `${namespace}.${schema.name}`;
const contextWithRef = namespace
? ts_compose_1.withIdentifier(context, ts_compose_1.Node.Const({
name: `${name}Name`,
isExport: true,
value: `${namespace}.${schema.name}`,
}), namespaceName)
? /**
* If there is already a ref with the same name as our "named type", it means there is already
* a type with the same name and we're about to have a naming collision. To avoid this, we
* use the fully qualified name instead.
*/
context.refs && schemaName in context.refs
? ts_compose_1.withIdentifier(context, ts_compose_1.Node.Const({ name: `${namespaceName}${fieldName}`, isExport: true, value }), namespaceName)
: ts_compose_1.withIdentifier(context, ts_compose_1.Node.Const({ name: fieldName, isExport: true, value }), namespaceName)
: context;

@@ -33,0 +39,0 @@ return ts_compose_1.document(ts_compose_1.withIdentifier(contextWithRef, type, namespaceName), ts_compose_1.Type.Referance(fullName));

{
"name": "@ovotech/avro-ts",
"description": "Convert avro schemas into typescript interfaces",
"version": "6.0.8",
"version": "6.0.9",
"main": "dist/index.js",

@@ -40,3 +40,3 @@ "source": "src/index.ts",

},
"gitHead": "37a6da95b70999e248581acd32165aa8d536fd2c"
"gitHead": "4920d20f220ad5fe20acbbe736b7c7062e680dd7"
}
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