Skip to content

Commit

Permalink
Use resolve instead of join
Browse files Browse the repository at this point in the history
Fixes #2.
  • Loading branch information
qgustavor authored and ClaudiuCeia committed Sep 13, 2024
1 parent 982e8f4 commit 810c5d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dhash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {
GIF,
Image,
} from "https://deno.land/x/[email protected]/mod.ts";
import { normalize, join } from "https://deno.land/[email protected]/path/mod.ts";
import { normalize, resolve } from "https://deno.land/[email protected]/path/mod.ts";

export const dhash = async (pathOrSrc: string | Uint8Array) => {
let file = pathOrSrc;

if (typeof pathOrSrc === "string") {
const resolvedPath = join(Deno.cwd(), normalize(pathOrSrc));
const resolvedPath = resolve(Deno.cwd(), normalize(pathOrSrc));

try {
file = await Deno.readFile(resolvedPath);
Expand Down

0 comments on commit 810c5d6

Please sign in to comment.