From baa3173dac2ab08cc433ec5e6458ae3d60c27702 Mon Sep 17 00:00:00 2001 From: Jorge Date: Wed, 19 May 2021 09:34:50 +0200 Subject: [PATCH] fix: use export default for the main function in ts --- package-lock.json | 4 ++-- package.json | 2 +- types/index.d.ts | 2 +- types/typescript-test.ts | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99cec2c..5ceaf0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "postman-to-openapi", - "version": "1.9.1", + "version": "1.9.2", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.9.1", + "version": "1.9.2", "license": "MIT", "dependencies": { "commander": "^7.2.0", diff --git a/package.json b/package.json index a660312..8f8b6f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postman-to-openapi", - "version": "1.9.1", + "version": "1.9.2", "description": "Convert postman collection to OpenAPI spec", "main": "lib/index.js", "types": "types/index.d.ts", diff --git a/types/index.d.ts b/types/index.d.ts index b4bc5ce..c961cbf 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -80,4 +80,4 @@ export interface Options { folders?: FoldersOption } -export function postmanToOpenApi (input: string, output?: string, options?: Options) : string +export default function postmanToOpenApi (input: string, output?: string, options?: Options) : string diff --git a/types/typescript-test.ts b/types/typescript-test.ts index 98a66a0..edc115f 100644 --- a/types/typescript-test.ts +++ b/types/typescript-test.ts @@ -1,9 +1,9 @@ 'use strict' -import { +import postmanToOpenApi, { Options, ContactObject, LicenseObject, InfoObject, ServerObject, SecurityObject, ExternalDocsObject, - FoldersOption, postmanToOpenApi + FoldersOption, } from './index.d' const contact:ContactObject = { @@ -81,5 +81,3 @@ const options:Options = { const openAPI3 = postmanToOpenApi('./path/to/postman_collection.json', './path/to/result/openApi.yml', options) })(); -// TODO what is really mandatory or not as is not the same that the object is mandatory -// and then inside the object what should be complete, example type in auth? \ No newline at end of file