@openapi-generator-plus/generator-common
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -6,3 +6,3 @@ import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types'; | ||
export declare const GroupingStrategies: typeof allGroupingStrategies; | ||
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'>; | ||
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelNameFromPropertyName'>; | ||
export declare function apiBasePath(servers: CodegenServer[] | undefined): string; |
@@ -20,2 +20,3 @@ "use strict"; | ||
const url_parse_1 = __importDefault(require("url-parse")); | ||
const pluralize_1 = __importDefault(require("pluralize")); | ||
const allGroupingStrategies = __importStar(require("./operation-grouping")); | ||
@@ -33,2 +34,5 @@ exports.GroupingStrategies = allGroupingStrategies; | ||
}, | ||
toModelNameFromPropertyName: (name, state) => { | ||
return state.generator.toClassName(pluralize_1.default.singular(name), state); | ||
}, | ||
}; | ||
@@ -35,0 +39,0 @@ } |
{ | ||
"name": "@openapi-generator-plus/generator-common", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Common utilities for openapi-generator-plus generators", | ||
@@ -24,3 +24,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@openapi-generator-plus/types": "0.4.0", | ||
"@openapi-generator-plus/types": "^0.4.1", | ||
"pluralize": "^8.0.0", | ||
"url-parse": "^1.4.7" | ||
@@ -31,3 +32,3 @@ }, | ||
}, | ||
"gitHead": "9a1f42ea78cf09c8b1050d2b8339f006bfe6292d" | ||
"gitHead": "67a4a8f63640dfb802480ce6a41485f3f03a52d0" | ||
} |
@@ -6,2 +6,3 @@ import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types' | ||
import Url from 'url-parse' | ||
import pluralize from 'pluralize' | ||
@@ -11,3 +12,3 @@ import * as allGroupingStrategies from './operation-grouping' | ||
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'> { | ||
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelNameFromPropertyName'> { | ||
return { | ||
@@ -23,2 +24,6 @@ | ||
}, | ||
toModelNameFromPropertyName: (name, state) => { | ||
return state.generator.toClassName(pluralize.singular(name), state) | ||
}, | ||
@@ -25,0 +30,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29048
417
3
+ Addedpluralize@^8.0.0
+ Added@openapi-generator-plus/types@0.4.1(transitive)
+ Addedpluralize@8.0.0(transitive)
- Removed@openapi-generator-plus/types@0.4.0(transitive)