You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the existing utility function ts.isExternalOrCommonJsModule public by moving it from utilities.ts to utilitiesPublic.ts
π Motivating Example
TypeScript treats commonJS modules similar to external modules. But currently there's no way for an API user to know whether TypeScript considers a file as commonJS module. SourceFile#commonJsModuleIndicator is not exposed in the public API and there's no ts.isCommonJsModule as pendant to ts.isExternalModule.
π» Use Cases
My current use case is to determine whether a file (or top-level declaration inside of it) contributes to the global scope. Currently I can only handle external modules, which doesn't match what TypeScript does internally.
The text was updated successfully, but these errors were encountered:
Suggestion
π Search Terms
isExternalOrCommonJsModule, commonJsModuleIndicator
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Make the existing utility function
ts.isExternalOrCommonJsModule
public by moving it fromutilities.ts
toutilitiesPublic.ts
π Motivating Example
TypeScript treats commonJS modules similar to external modules. But currently there's no way for an API user to know whether TypeScript considers a file as commonJS module.
SourceFile#commonJsModuleIndicator
is not exposed in the public API and there's nots.isCommonJsModule
as pendant tots.isExternalModule
.π» Use Cases
My current use case is to determine whether a file (or top-level declaration inside of it) contributes to the global scope. Currently I can only handle external modules, which doesn't match what TypeScript does internally.
The text was updated successfully, but these errors were encountered: