Skip to content

Commit

Permalink
fix: update [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Mar 14, 2021
1 parent 1617256 commit 9d730c9
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 298 deletions.
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"prettier/standard"
"prettier"
],
"parserOptions": {
"ecmaVersion": 2018,
Expand Down Expand Up @@ -85,7 +84,7 @@
]
},
"dependencies": {
"aspida": "^1.4.1",
"aspida": "^1.6.3",
"js-yaml": "^4.0.0",
"openapi-types": "^7.2.3",
"swagger-parser": "^10.0.2",
Expand All @@ -95,21 +94,21 @@
"@types/jest": "^26.0.20",
"@types/js-yaml": "^4.0.0",
"@types/minimist": "^1.2.1",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jest": "^24.3.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^5.0.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"standard-version": "^9.1.0",
"ts-jest": "^26.5.1",
"typescript": "^4.1.3"
"standard-version": "^9.1.1",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3"
}
}
7 changes: 3 additions & 4 deletions src/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { OpenAPI } from 'openapi-types'
import { AspidaConfig, getConfigs } from 'aspida/dist/commands'

export type Config = {
export type Config = Pick<AspidaConfig, 'outputEachDir' | 'outputMode' | 'trailingSlash'> & {
input: string | OpenAPI.Document
output: string
trailingSlash: boolean
outputEachDir: boolean
isYaml: boolean
}

Expand All @@ -16,14 +14,15 @@ export type ConfigFile = AspidaConfig & {
}
}

const createConfig = (config: ConfigFile) => {
const createConfig = (config: ConfigFile): Config => {
const openapi = config.openapi!

return {
input: openapi.inputFile,
output: config.input,
trailingSlash: config.trailingSlash,
outputEachDir: config.outputEachDir,
outputMode: config.outputMode,
isYaml: openapi.yaml ?? !openapi.inputFile.endsWith('.json')
}
}
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default (configs?: Parameters<typeof getConfig>[0]) =>
config: {
input: config.output,
baseURL,
outputMode: config.outputMode,
outputEachDir: config.outputEachDir,
trailingSlash: config.trailingSlash
},
Expand Down
Loading

0 comments on commit 9d730c9

Please sign in to comment.