Skip to content

Commit

Permalink
fix: 解决 Windows 下类型引用错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 12, 2022
1 parent fd92bdb commit 5eb3644
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ export function jsonSchemaToJSTTJsonSchema(
if (jsonSchema.title?.startsWith('&')) {
const typeRelativePath = jsonSchema.title.substring(1)
const typeAbsolutePath = toUnixPath(
path.resolve(
path.dirname(`/${currentPath.join('/')}`.replace(/\/{2,}/g, '/')),
typeRelativePath,
),
path
.resolve(
path.dirname(`/${currentPath.join('/')}`.replace(/\/{2,}/g, '/')),
typeRelativePath,
)
.replace(/^[a-z]+:/i, ''),
)
const typeAbsolutePathArr = typeAbsolutePath.split('/').filter(Boolean)
const tsType = `${repeat(
Expand Down

0 comments on commit 5eb3644

Please sign in to comment.