Skip to content

Commit

Permalink
fix(esm-path): Fixes esm import path, some typescript errors (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonluca authored Nov 7, 2022
1 parent 538905f commit e5e74e7
Show file tree
Hide file tree
Showing 3 changed files with 312 additions and 270 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"json-schema-walker": "^1.1.0",
"openapi-types": "^12.0.0",
"yargs": "^17.5.1"
"openapi-types": "^12.0.2",
"yargs": "^17.6.2"
},
"devDependencies": {
"@types/json-schema": "^7.0.11",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"c8": "^7.12.0",
"eslint": "^8.22.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^2.0.0",
"nock": "^13.2.9",
"prettier": "^2.7.1",
"typescript": "^4.7.4",
"vitest": "^0.22.1"
"typescript": "^4.8.4",
"vitest": "^0.24.5"
},
"prettier": {
"singleQuote": true,
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
JSONSchema6Definition,
JSONSchema7Definition,
} from 'json-schema';
import type { Options, SchemaType, SchemaTypeKeys } from './types';
import type { Options, SchemaType, SchemaTypeKeys } from './types.js';
import { Walker } from 'json-schema-walker';
import { allowedKeywords } from './const.js';
import type { OpenAPIV3 } from 'openapi-types';
Expand All @@ -19,7 +19,7 @@ class InvalidTypeError extends Error {

const oasExtensionPrefix = 'x-';

const handleDefinition = async <T>(
const handleDefinition = async <T extends JSONSchema = JSONSchema>(
def: JSONSchema7Definition | JSONSchema6Definition | JSONSchema4,
schema: T
) => {
Expand Down Expand Up @@ -69,7 +69,7 @@ const handleDefinition = async <T>(
return def;
};

const convert = async <T = JSONSchema>(
const convert = async <T extends JSONSchema = JSONSchema>(
schema: T,
options?: Options
): Promise<OpenAPIV3.Document> => {
Expand Down
Loading

0 comments on commit e5e74e7

Please sign in to comment.