Microsoft/TypeScript

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

开放

#53,605 创建于 2023年3月31日

 (3 条评论) (0 个反应) (0 位负责人)TypeScript (13,395 个派生)batch import
BugDomain: Module ResolutionHelp Wanted

仓库指标

星标
 (108,860 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南