Skip to content

Commit e5e74e7

Browse files
authored
fix(esm-path): Fixes esm import path, some typescript errors (#40)
1 parent 538905f commit e5e74e7

File tree

3 files changed

+312
-270
lines changed

3 files changed

+312
-270
lines changed

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@
3636
"dependencies": {
3737
"@apidevtools/json-schema-ref-parser": "^9.0.9",
3838
"json-schema-walker": "^1.1.0",
39-
"openapi-types": "^12.0.0",
40-
"yargs": "^17.5.1"
39+
"openapi-types": "^12.0.2",
40+
"yargs": "^17.6.2"
4141
},
4242
"devDependencies": {
4343
"@types/json-schema": "^7.0.11",
44-
"@typescript-eslint/eslint-plugin": "^5.33.1",
45-
"@typescript-eslint/parser": "^5.33.1",
44+
"@typescript-eslint/eslint-plugin": "^5.42.0",
45+
"@typescript-eslint/parser": "^5.42.0",
4646
"c8": "^7.12.0",
47-
"eslint": "^8.22.0",
47+
"eslint": "^8.27.0",
4848
"eslint-config-prettier": "^8.5.0",
4949
"eslint-plugin-prettier": "^4.2.1",
5050
"eslint-plugin-unused-imports": "^2.0.0",
5151
"nock": "^13.2.9",
5252
"prettier": "^2.7.1",
53-
"typescript": "^4.7.4",
54-
"vitest": "^0.22.1"
53+
"typescript": "^4.8.4",
54+
"vitest": "^0.24.5"
5555
},
5656
"prettier": {
5757
"singleQuote": true,

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
JSONSchema6Definition,
55
JSONSchema7Definition,
66
} from 'json-schema';
7-
import type { Options, SchemaType, SchemaTypeKeys } from './types';
7+
import type { Options, SchemaType, SchemaTypeKeys } from './types.js';
88
import { Walker } from 'json-schema-walker';
99
import { allowedKeywords } from './const.js';
1010
import type { OpenAPIV3 } from 'openapi-types';
@@ -19,7 +19,7 @@ class InvalidTypeError extends Error {
1919

2020
const oasExtensionPrefix = 'x-';
2121

22-
const handleDefinition = async <T>(
22+
const handleDefinition = async <T extends JSONSchema = JSONSchema>(
2323
def: JSONSchema7Definition | JSONSchema6Definition | JSONSchema4,
2424
schema: T
2525
) => {
@@ -69,7 +69,7 @@ const handleDefinition = async <T>(
6969
return def;
7070
};
7171

72-
const convert = async <T = JSONSchema>(
72+
const convert = async <T extends JSONSchema = JSONSchema>(
7373
schema: T,
7474
options?: Options
7575
): Promise<OpenAPIV3.Document> => {

0 commit comments

Comments
 (0)