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.1.0 to 0.1.1

5

dist/index.d.ts

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

import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/types';
import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types';
export * from './case-transforms';

@@ -6,2 +6,3 @@ export * from './http-methods';

export declare const GroupingStrategies: typeof allGroupingStrategies;
export declare function commonGenerator<O extends CodegenOptions>(): Pick<CodegenGenerator<O>, 'toOperationName'>;
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'>;
export declare function apiBasePath(servers: CodegenServer[] | undefined): string;

@@ -5,2 +5,5 @@ "use strict";

}
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {

@@ -17,2 +20,3 @@ if (mod && mod.__esModule) return mod;

__export(require("./http-methods"));
const url_parse_1 = __importDefault(require("url-parse"));
const allGroupingStrategies = __importStar(require("./operation-grouping"));

@@ -33,1 +37,10 @@ exports.GroupingStrategies = allGroupingStrategies;

exports.commonGenerator = commonGenerator;
function apiBasePath(servers) {
if (!servers || !servers.length) {
return '/';
}
const server = servers[0];
const url = new url_parse_1.default(server.url);
return url.pathname;
}
exports.apiBasePath = apiBasePath;

7

package.json
{
"name": "@openapi-generator-plus/generator-common",
"version": "0.1.0",
"version": "0.1.1",
"description": "Common utilities for openapi-generator-plus generators",

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

"dependencies": {
"@openapi-generator-plus/types": "0.1.1"
"@openapi-generator-plus/types": "0.2.0",
"url-parse": "^1.4.7"
},

@@ -30,3 +31,3 @@ "publishConfig": {

},
"gitHead": "88a2bab87102887e9a1418390a1090b86a86e303"
"gitHead": "90428fc2a2c1cf2616af85ad530e29bc90829822"
}

@@ -1,5 +0,6 @@

import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/types'
import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types'
import { camelCase } from './case-transforms'
export * from './case-transforms'
export * from './http-methods'
import Url from 'url-parse'

@@ -9,3 +10,3 @@ import * as allGroupingStrategies from './operation-grouping'

export function commonGenerator<O extends CodegenOptions>(): Pick<CodegenGenerator<O>, 'toOperationName'> {
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'> {
return {

@@ -24,1 +25,11 @@

}
export function apiBasePath(servers: CodegenServer[] | undefined): string {
if (!servers || !servers.length) {
return '/'
}
const server = servers[0]
const url = new Url(server.url)
return url.pathname
}
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