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
The isWellFormed() method on strings works, but doesn't type-check.
% cat >> bug.ts
"".isWellFormed()
% deno check bug.ts
Check [redacted]/bug.ts
error: TS2339 [ERROR]: Property 'isWellFormed' does not exist on type '""'.
"".isWellFormed()
~~~~~~~~~~~~
at [redacted]/bug.ts:1:4
% deno
Deno 1.44.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> "".isWellFormed()
true
>
Here is a workaround:
interface ExtraStringMethods {
isWellFormed(): boolean;
}
function isWellFormed(str: string): boolean {
return (str as unknown as ExtraStringMethods).isWellFormed();
}
The text was updated successfully, but these errors were encountered:
➜ ~ cat -p a.ts
"".isWellFormed();
➜ ~ deno check a.ts
Check file:///Users/sr/a.ts
error: TS2339 [ERROR]: Property 'isWellFormed' does not exist on type '""'.
"".isWellFormed();
~~~~~~~~~~~~
at file:///Users/sr/a.ts:1:4
➜ ~ tsc a.ts
a.ts:1:4 - error TS2339: Property 'isWellFormed' does not exist on type '""'.
1 "".isWellFormed();
~~~~~~~~~~~~
Found 1 error in a.ts:1
Version: Deno 1.44.2
The isWellFormed() method on strings works, but doesn't type-check.
Here is a workaround:
The text was updated successfully, but these errors were encountered: