New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swagger-axios-codegen

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-axios-codegen - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

1

dist/baseInterfaces.d.ts

@@ -12,2 +12,3 @@ export interface ISwaggerOptions {

include?: Array<string | IInclude>;
format?: (s: string) => string;
}

@@ -14,0 +15,0 @@ export interface IPropDef {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -0,0 +0,0 @@ import { IDefinitionProperties } from "../saggerInterfaces";

@@ -0,0 +0,0 @@ import { IEnumDef } from "../baseInterfaces";

@@ -0,0 +0,0 @@ import { IDefinitions } from '../saggerInterfaces';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IDefinitionProperty } from "../saggerInterfaces";

@@ -0,0 +0,0 @@ "use strict";

import { ISwaggerOptions } from './baseInterfaces';
export declare function codegen(params: ISwaggerOptions): Promise<void>;

15

dist/index.js

@@ -67,3 +67,3 @@ "use strict";

const fileDir = path.join(options.outputDir || '', 'definitions');
writeFile(fileDir, item.name + '.ts', format(text));
writeFile(fileDir, item.name + '.ts', format(text, options));
});

@@ -73,3 +73,3 @@ Object.values(models).forEach(item => {

const fileDir = path.join(options.outputDir || '', 'definitions');
writeFile(fileDir, item.name, format(text));
writeFile(fileDir, item.name, format(text, options));
});

@@ -138,3 +138,3 @@ }

apiSource += reqSource + defSource;
writeFile(options.outputDir || '', options.fileName || '', format(apiSource));
writeFile(options.outputDir || '', options.fileName || '', format(apiSource, options));
}

@@ -165,3 +165,3 @@ else {

});
writeFile(options.outputDir || '', options.fileName || '', format(apiSource));
writeFile(options.outputDir || '', options.fileName || '', format(apiSource, options));
}

@@ -186,3 +186,8 @@ catch (error) {

}
function format(text) {
function format(text, options) {
if (options.format) {
console.log('use custom formatter');
return options.format(text);
}
console.log('use default formatter');
return prettier_1.default.format(text, {

@@ -189,0 +194,0 @@ "printWidth": 120,

@@ -0,0 +0,0 @@ import { IParameter } from "../saggerInterfaces";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IRequestMethod } from "../saggerInterfaces";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IPaths } from '../saggerInterfaces';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export interface ISwaggerSource {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -0,0 +0,0 @@ import { IPropDef } from "./baseInterfaces";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IDefinitionClass, IDefinitionEnum } from "./baseInterfaces";

@@ -0,0 +0,0 @@ "use strict";

{
"name": "swagger-axios-codegen",
"version": "0.4.2",
"version": "0.5.0",
"main": "./dist/index",

@@ -39,2 +39,2 @@ "typings": "./dist/",

}
}
}

@@ -41,3 +41,3 @@ # swagger-axios-codegen

fileName: 'index.ts',
useStaticMethod: true,
useStaticMethod: true, // >= 0.4
useCustomerRequestInstance: false

@@ -44,0 +44,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