Skip to content

Commit

Permalink
fix(api): import ts as pure type
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Nov 7, 2022
1 parent 702abf2 commit 404a009
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/api/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert = require("assert")
import * as ts from "typescript"
import type * as ts from "typescript"
import {
wrapSafe,
isEmpty,
Expand Down Expand Up @@ -837,7 +837,10 @@ export function getSymbolOrTypeOfNode(
if (symbol) {
const symbolType = getSymbolType(ctx, symbol, node)

if (isValidType(symbolType) || symbol.flags & ts.SymbolFlags.Module) {
if (
isValidType(symbolType) ||
symbol.flags & ctx.ts.SymbolFlags.Module
) {
return { symbol, node }
}
}
Expand Down Expand Up @@ -886,7 +889,7 @@ function getDeclarationNodeFlagsFromSymbol(
symbol: ts.Symbol
): ts.NodeFlags {
return symbol.valueDeclaration
? ts.getCombinedNodeFlags(symbol.valueDeclaration)
? ctx.ts.getCombinedNodeFlags(symbol.valueDeclaration)
: 0
}

Expand Down

0 comments on commit 404a009

Please sign in to comment.