Skip to content

esModuleInterop: true with class static method #45133

Description

Bug Report

🔎 Search Terms

class static import

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play?module=1#code/JYWwDg9gTgLgBAYQJIBEA0cDedgGdkpwC+cAZlBCHAOQDGwAJrtQNwCwAUJwKYAeksMgFcAdrRjAIIuGACGMABYAVCAkYAKegwBccXDCjARAczgAfRKgCUu-YZOdMnAJDBScdQQB0eApsZWVi5OHM7OUNwwQlDSWl4wEADKBkbG6kGhRJwuEVExcHERYAA2srTc6gD0AHoAOpXAYADaIqQAurj1lRjU1BlZXBx8AvCkouKS0nKKKmoMAEz+OnopJuaWKDYr9saOLm4evqhLgcEu4ZHRsYzxSatpGc4DOZf5hdwlZRU19Y0t7Z1Kt0aH1OM8ONNlKoNL0MpDZoxFrDOEA

💻 Code

importCID,{isCID}from'cids';exportfunctionpathToCid(cid: string|CID): string{if(CID.isCID(cid)){returncid.toString()}returncid.replace(/^\/ip[nf]s\//,'')}exportfunctionpathToCid2(cid: string|CID): string{if(isCID(cid)){returncid.toString()}returncid.replace(/^\/ip[nf]s\//,'')}pathToCid('')pathToCid2('')

🙁 Actual behavior

TypeError: (0,cids_1.isCID)isnotafunction

🙂 Expected behavior

  • no error on output js file
  • or show typescript error for warn this

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScriptRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions