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

@openapi-generator-plus/generator-common

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-generator-plus/generator-common - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

dist/index.d.ts
import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types';
export * from './case-transforms';
export * from './http-methods';
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelNameFromPropertyName'>;
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelName'>;
export declare function apiBasePath(servers: CodegenServer[] | undefined): string;

@@ -9,2 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("@openapi-generator-plus/types");
const case_transforms_1 = require("./case-transforms");

@@ -25,4 +26,9 @@ __export(require("./case-transforms"));

},
toModelNameFromPropertyName: (name, state) => {
return state.generator.toClassName(pluralize_1.default.singular(name), state);
toModelName: (name, options, state) => {
if (options.purpose === types_1.CodegenSchemaPurpose.ARRAY_ITEM || options.purpose === types_1.CodegenSchemaPurpose.MAP_VALUE) {
return state.generator.toClassName(pluralize_1.default.singular(name), state);
}
else {
return state.generator.toClassName(name, state);
}
},

@@ -29,0 +35,0 @@ };

{
"name": "@openapi-generator-plus/generator-common",
"version": "0.3.1",
"version": "0.3.2",
"description": "Common utilities for openapi-generator-plus generators",

@@ -24,3 +24,3 @@ "main": "dist/index.js",

"dependencies": {
"@openapi-generator-plus/types": "^0.7.0",
"@openapi-generator-plus/types": "^0.8.0",
"pluralize": "^8.0.0",

@@ -32,3 +32,3 @@ "url-parse": "^1.4.7"

},
"gitHead": "1417dfe522b31430bfd1e3f7274ef8efe4ef695a"
"gitHead": "ef8774d3f7001408a65789bd3ad2a8939a3520d8"
}

@@ -1,2 +0,2 @@

import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types'
import { CodegenGenerator, CodegenServer, CodegenSchemaPurpose } from '@openapi-generator-plus/types'
import { camelCase } from './case-transforms'

@@ -8,3 +8,3 @@ export * from './case-transforms'

export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelNameFromPropertyName'> {
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelName'> {
return {

@@ -21,4 +21,8 @@

toModelNameFromPropertyName: (name, state) => {
return state.generator.toClassName(pluralize.singular(name), state)
toModelName: (name, options, state) => {
if (options.purpose === CodegenSchemaPurpose.ARRAY_ITEM || options.purpose === CodegenSchemaPurpose.MAP_VALUE) {
return state.generator.toClassName(pluralize.singular(name), state)
} else {
return state.generator.toClassName(name, state)
}
},

@@ -25,0 +29,0 @@

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