@openapi-generator-plus/generator-common
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
/** Create a default operation name for operations that lack an operationId */ | ||
export declare function defaultOperationName(path: string, method: string): string; | ||
import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/core'; | ||
export declare function commonGenerator<O extends CodegenOptions>(): Partial<CodegenGenerator<O>>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@openapi-generator-plus/core"); | ||
/** Create a default operation name for operations that lack an operationId */ | ||
function defaultOperationName(path, method) { | ||
/* Remove path variables from the path */ | ||
const sanitisedPath = path.replace(/\{[^}]*\}/g, ''); | ||
const combined = `${method.toLocaleLowerCase()}_${sanitisedPath}`; | ||
const sanitizedCombined = combined.replace(/[^a-zA-Z0-9]/g, '_').replace(/_+$/, ''); | ||
return core_1.camelCase(sanitizedCombined); | ||
// Change to Pick<CodegenGenerator<O>, 'NAME'> when we implement something here | ||
function commonGenerator() { | ||
return {}; | ||
} | ||
exports.defaultOperationName = defaultOperationName; | ||
exports.commonGenerator = commonGenerator; |
{ | ||
"name": "@openapi-generator-plus/generator-common", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Common utilities for openapi-generator-plus generators", | ||
@@ -10,3 +10,2 @@ "main": "dist/index.js", | ||
"clean": "../../node_modules/.bin/rimraf dist", | ||
"prepare": "npm run clean && npm run build", | ||
"watch": "../../node_modules/.bin/tsc --watch" | ||
@@ -25,3 +24,3 @@ }, | ||
"dependencies": { | ||
"@openapi-generator-plus/core": "0.0.20" | ||
"@openapi-generator-plus/core": "0.0.26" | ||
}, | ||
@@ -31,3 +30,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "148678e4b7099adfe33967f651864b79ac60e3cb" | ||
"gitHead": "81bde866345c95e847060532424ce8e22bd0a124" | ||
} |
@@ -1,10 +0,8 @@ | ||
import { camelCase } from '@openapi-generator-plus/core' | ||
import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/core' | ||
/** Create a default operation name for operations that lack an operationId */ | ||
export function defaultOperationName(path: string, method: string): string { | ||
/* Remove path variables from the path */ | ||
const sanitisedPath = path.replace(/\{[^}]*\}/g, '') | ||
const combined = `${method.toLocaleLowerCase()}_${sanitisedPath}` | ||
const sanitizedCombined = combined.replace(/[^a-zA-Z0-9]/g, '_').replace(/_+$/, '') | ||
return camelCase(sanitizedCombined) | ||
// Change to Pick<CodegenGenerator<O>, 'NAME'> when we implement something here | ||
export function commonGenerator<O extends CodegenOptions>(): Partial<CodegenGenerator<O>> { | ||
return { | ||
} | ||
} |
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
16933
80
+ Added@openapi-generator-plus/core@0.0.26(transitive)
+ Addedpluralize@8.0.0(transitive)
- Removed@openapi-generator-plus/core@0.0.20(transitive)