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

@ovotech/avro-ts

Package Overview
Dependencies
Maintainers
145
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 4.1.2 to 4.2.1

1

dist/convert.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toTypeScript = exports.convertType = exports.nameParts = exports.convertNamespace = exports.firstUpperCase = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const wrapped_union_1 = require("./types/wrapped-union");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fullName = void 0;
exports.fullName = (context, schema) => { var _a; return `${(_a = schema.namespace) !== null && _a !== void 0 ? _a : context.namespace}.${schema.name}`; };

4

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var convert_1 = require("./convert");
exports.toTypeScript = convert_1.toTypeScript;
exports.convertType = convert_1.convertType;
Object.defineProperty(exports, "toTypeScript", { enumerable: true, get: function () { return convert_1.toTypeScript; } });
Object.defineProperty(exports, "convertType", { enumerable: true, get: function () { return convert_1.convertType; } });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertArrayType = exports.isArrayType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const convert_1 = require("../convert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertEnumType = exports.isEnumType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -7,3 +8,3 @@ exports.isEnumType = (type) => typeof type === 'object' && 'type' in type && type.type === 'enum';

context,
type: ts_compose_1.Type.Union(type.symbols.map(symbol => ts_compose_1.Type.Literal(symbol))),
type: ts_compose_1.Type.Union(type.symbols.map((symbol) => ts_compose_1.Type.Literal(symbol))),
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertFixedType = exports.isFixedType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");
exports.isFixedType = (type) => typeof type === 'object' && 'type' in type && type.type === 'fixed';
exports.convertFixedType = context => ({
exports.convertFixedType = (context) => ({
context,
type: ts_compose_1.Type.String,
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertLogicalType = exports.isLogicalType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const convert_1 = require("../convert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertMapType = exports.isMapType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const convert_1 = require("../convert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertPrimitiveType = exports.isPrimitiveType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const primitiveTypeMap = {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertRecordType = exports.isRecordType = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const convert_1 = require("../convert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertUnionType = exports.isUnion = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -4,0 +5,0 @@ const convert_1 = require("../convert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertWrappedUnionType = exports.isWrappedUnion = void 0;
const ts_compose_1 = require("@ovotech/ts-compose");

@@ -8,3 +9,3 @@ const union_1 = require("./union");

const helpers_1 = require("../helpers");
exports.isWrappedUnion = (type) => union_1.isUnion(type) && type.every(item => record_1.isRecordType(item) && type.length > 1);
exports.isWrappedUnion = (type) => union_1.isUnion(type) && type.every((item) => record_1.isRecordType(item) && type.length > 1);
exports.convertWrappedUnionType = (context, schema) => {

@@ -16,3 +17,3 @@ const map = ts_compose_1.mapWithContext(context, schema, (itemContext, item) => {

type: ts_compose_1.Type.TypeLiteral({
props: schema.map(schemaItem => ts_compose_1.Type.Prop({
props: schema.map((schemaItem) => ts_compose_1.Type.Prop({
name: helpers_1.fullName(context, schemaItem),

@@ -19,0 +20,0 @@ isOptional: schemaItem.name === item.name ? false : true,

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

@@ -21,12 +21,11 @@ "source": "src/index.ts",

"devDependencies": {
"@ovotech/avro-logical-types": "^1.0.0",
"@types/jest": "^25.1.4",
"@types/node": "^13.9.8",
"@types/jest": "^26.0.3",
"@types/node": "^14.0.14",
"avsc": "^5.4.21",
"eslint-config-prettier": "^6.10.1",
"jest": "^25.2.6",
"moment": "^2.24.0",
"prettier": "^2.0.2",
"ts-jest": "^25.3.0",
"ts-node": "^8.8.1"
"eslint-config-prettier": "^6.11.0",
"jest": "^26.1.0",
"moment": "^2.27.0",
"prettier": "^2.0.5",
"ts-jest": "^26.1.1",
"ts-node": "^8.10.2"
},

@@ -37,6 +36,6 @@ "jest": {

"dependencies": {
"@ovotech/ts-compose": "^0.11.1",
"typescript": "^3.8.3"
"@ovotech/ts-compose": "^0.12.0",
"typescript": "^3.9.6"
},
"gitHead": "433ec4040cb425d8ebc55abee90df10806d0fd83"
"gitHead": "5ed53d1a8bc5d8364decd0e008c2bc70f7f31dba"
}
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