Microsoft/TypeScript

`ts.isUrl` and `ts.pathIsAbsolute` return false for data urls

Offen

#53.605 geöffnet am 31.03.2023

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (13.395 Forks)batch import
BugDomain: Module ResolutionHelp Wanted

Repository-Metriken

Stars
 (108.860 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Bug Report

ts.isUrl and ts.pathIsAbsolute return false for data urls.

This is an issue because when using data urls in TypeScript it will join the current working directory with the data url.

🔎 Search Terms

data url ts.isUrl

🕗 Version & Regression Information

ts.version
'5.1.0-dev.20230330'

⏯ Playground Link

N/A

💻 Code

> ts.version
'5.1.0-dev.20230330'
> ts.isUrl("data:application/typescript,42")
false
> ts.isUrl("https://deno.land/mod.ts")
true
> ts.pathIsAbsolute("data:application/typescript,42")
false
> ts.pathIsAbsolute("https://deno.land/mod.ts")
true

🙁 Actual behavior

Output as shown.

🙂 Expected behavior

Should return true for all of the above

Contributor Guide