@@ -3,10 +3,10 @@ package ast
33import (
44 "iter"
55 "maps"
6- "strings"
76 "sync/atomic"
87
98 "github.com/microsoft/typescript-go/internal/collections"
9+ "github.com/microsoft/typescript-go/internal/deno"
1010 "github.com/microsoft/typescript-go/internal/tspath"
1111)
1212
@@ -350,17 +350,13 @@ func (c *DenoForkContext) GetGlobalsForName(name string) SymbolTable {
350350 }
351351}
352352
353- func isTypesNodePkgPath (path tspath.Path ) bool {
354- return strings .HasSuffix (string (path ), ".d.ts" ) && strings .Contains (string (path ), "/@types/node/" )
355- }
356-
357353func symbolHasAnyTypesNodePkgDecl (symbol * Symbol , hasNodeSourceFile func (* Node ) bool ) bool {
358354 if symbol == nil || symbol .Declarations == nil {
359355 return false
360356 }
361357 for _ , decl := range symbol .Declarations {
362358 sourceFile := GetSourceFileOfNode (decl )
363- if sourceFile != nil && hasNodeSourceFile (decl ) && isTypesNodePkgPath (sourceFile .Path ()) {
359+ if sourceFile != nil && hasNodeSourceFile (decl ) && deno . IsTypesNodePkgPath (sourceFile .Path ()) {
364360 return true
365361 }
366362 }
@@ -370,7 +366,7 @@ func symbolHasAnyTypesNodePkgDecl(symbol *Symbol, hasNodeSourceFile func(*Node)
370366func (c * DenoForkContext ) MergeGlobalSymbolTable (node * Node , source SymbolTable , unidirectional bool ) {
371367 sourceFile := GetSourceFileOfNode (node )
372368 isNodeFile := c .HasNodeSourceFile (node )
373- isTypesNodeSourceFile := isNodeFile && isTypesNodePkgPath (sourceFile .Path ())
369+ isTypesNodeSourceFile := isNodeFile && deno . IsTypesNodePkgPath (sourceFile .Path ())
374370
375371 for id , sourceSymbol := range source .Iter () {
376372 var target SymbolTable
0 commit comments