Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
build: update several dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
joolfe committed Mar 14, 2021
1 parent f2e2843 commit bff147f
Show file tree
Hide file tree
Showing 28 changed files with 1,853 additions and 2,575 deletions.
40 changes: 21 additions & 19 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { promises: { writeFile, readFile } } = require('fs')
const { safeDump } = require('js-yaml')
const { dump } = require('js-yaml')
const { parseMdTable } = require('./md-utils')
const { version } = require('../package.json')

Expand Down Expand Up @@ -52,7 +52,7 @@ async function postmanToOpenApi (input, output, { info = {}, defaultTag = 'defau
paths
}

const openApiYml = safeDump(openApi, { skipInvalid: true })
const openApiYml = dump(openApi, { skipInvalid: true })
if (output != null) {
await writeFile(output, openApiYml, 'utf8')
}
Expand Down Expand Up @@ -90,12 +90,12 @@ function parseContact (variables, optsContact = {}) {
const { name = nameVar, url = urlVar, email = emailVar } = optsContact
return [name, url, email].some(e => e != null)
? {
contact: {
...(name ? { name } : {}),
...(url ? { url } : {}),
...(email ? { email } : {})
contact: {
...(name ? { name } : {}),
...(url ? { url } : {}),
...(email ? { email } : {})
}
}
}
: {}
}

Expand Down Expand Up @@ -212,19 +212,21 @@ function parseAuth ({ auth }, optAuth) {
/* Parse a postman auth definition */
function parsePostmanAuth (postmanAuth = {}) {
const { type } = postmanAuth
return (type != null) ? {
components: {
securitySchemes: {
[type + 'Auth']: {
type: 'http',
scheme: type
}
return (type != null)
? {
components: {
securitySchemes: {
[type + 'Auth']: {
type: 'http',
scheme: type
}
}
},
security: [{
[type + 'Auth']: []
}]
}
},
security: [{
[type + 'Auth']: []
}]
} : {}
: {}
}

/* Parse a options global auth */
Expand Down
Loading

0 comments on commit bff147f

Please sign in to comment.