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

@ovotech/laminar-cli

Package Overview
Dependencies
Maintainers
287
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ovotech/laminar-cli - npm Package Compare versions

Comparing version 0.13.12 to 0.13.13

2

dist/commands/avro/types/union.d.ts
import { schema, Schema } from 'avsc';
import { Convert } from '../types';
export declare const isUnion: (type: Schema) => type is schema.NamedType[];
export declare const isUnion: (type: Schema) => type is (schema.PrimitiveType | schema.NamedType)[];
export declare const convertUnionType: Convert<schema.DefinedType[]>;
import { schema, Schema } from 'avsc';
import { Convert, Context } from '../types';
export declare const isWrappedUnion: (type: Schema, context: Context) => type is schema.RecordType[];
export declare const convertWrappedUnionType: Convert<schema.RecordType[]>;
declare type WrappedUnionItem = schema.RecordType | 'null';
export declare const isWrappedUnion: (type: Schema, context: Context) => type is WrappedUnionItem[];
export declare const convertWrappedUnionType: Convert<WrappedUnionItem[]>;
export {};

@@ -10,3 +10,5 @@ "use strict";

const resolveItem = (context, item) => { var _a, _b; return typeof item === 'string' && ((_a = context.refs) === null || _a === void 0 ? void 0 : _a[item]) ? (_b = context.refs) === null || _b === void 0 ? void 0 : _b[item] : item; };
const isWrappedUnion = (type, context) => (0, union_1.isUnion)(type) && type.length > 1 && type.every((item) => (0, record_1.isRecordType)(resolveItem(context, item)));
const isWrappedUnion = (type, context) => (0, union_1.isUnion)(type) &&
type.filter((item) => item !== 'null').length > 1 &&
type.filter((item) => item !== 'null').every((item) => (0, record_1.isRecordType)(resolveItem(context, item)));
exports.isWrappedUnion = isWrappedUnion;

@@ -19,11 +21,13 @@ const convertWrappedUnionType = (context, schema) => {

context: { ...converted.context, namespace: context.namespace },
type: ts_compose_1.Type.TypeLiteral({
props: resolved.map((schemaItem) => {
return ts_compose_1.Type.Prop({
name: (0, helpers_1.fullName)(context, schemaItem),
isOptional: schemaItem.name === item.name ? false : true,
type: schemaItem.name === item.name ? converted.type : ts_compose_1.Type.Never,
});
}),
}),
type: (0, record_1.isRecordType)(item)
? ts_compose_1.Type.TypeLiteral({
props: resolved.filter(record_1.isRecordType).map((schemaItem) => {
return ts_compose_1.Type.Prop({
name: (0, helpers_1.fullName)(context, schemaItem),
isOptional: schemaItem.name === item.name ? false : true,
type: schemaItem.name === item.name ? converted.type : ts_compose_1.Type.Never,
});
}),
})
: ts_compose_1.Type.Null,
};

@@ -30,0 +34,0 @@ });

{
"name": "@ovotech/laminar-cli",
"version": "0.13.12",
"version": "0.13.13",
"main": "dist/index.js",

@@ -13,3 +13,3 @@ "types": "dist/index.d.ts",

"@ikerin/build-readme": "^1.1.1",
"@ovotech/laminar": "0.13.10",
"@ovotech/laminar": "0.13.11",
"@types/jest": "^27.4.0",

@@ -16,0 +16,0 @@ "@types/node": "^14.18.9",

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