We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f01f328 commit 4096713Copy full SHA for 4096713
1 file changed
src/ts/helpers/parse.ts
@@ -26,7 +26,7 @@ export function parseAndFormat<S, T>(input: S | undefined,
26
}
27
28
function toString<T>(source: T): string {
29
- if ("toString" in source && typeof (source as {toString: () => string}) === "function") {
+ if (source["toString"] && typeof source["toString"] === "function") {
30
return (source as {toString: () => string}).toString();
31
} else {
32
throw TypeError(`Can't convert type ${typeof source} to string`);
0 commit comments