Skip to content

Commit

Permalink
more checks for isString
Browse files Browse the repository at this point in the history
  • Loading branch information
j50n committed Dec 8, 2023
1 parent 37d92ba commit cccc355
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion site/scripts/process/output.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { run } from "https://deno.land/x/[email protected].6/mod.ts";
import { run } from "https://deno.land/x/[email protected].7/mod.ts";

await run("echo", "Hello, world.").forEach((it) => console.dir(it));

Expand Down
3 changes: 2 additions & 1 deletion src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export async function sleep(delayms: number): Promise<void> {
* @returns `true` if the thing is a string.
*/
export function isString(s: unknown): s is string {
return Object.prototype.toString.call(s) === "[object String]";
return typeof s === "string" || s instanceof String ||
Object.prototype.toString.call(s) === "[object String]";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.21.7"}
{"version":"0.21.8"}

0 comments on commit cccc355

Please sign in to comment.