Skip to content

Commit 400a68b

Browse files
authored
fix: make hash optional in URL regex (#9)
1 parent 50bd1c4 commit 400a68b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/object-url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SquareCloudBlobError } from "../structures/error";
22

33
const objectUrlRegex =
4-
/^(?<url>https:\/\/public-blob\.squarecloud\.dev)?\/?(?<userId>[\w\d]+\/)(?<prefix>[\w\d\-_]+\/)?(?<name>[\w\d_]+)-(?<hash>[\w\d]+)(-ex\d+)?\.(?<extension>\w+)$/;
4+
/^(?<url>https:\/\/public-blob\.squarecloud\.dev)?\/?(?<userId>[\w\d]+\/)(?<prefix>[\w\d\-_]+\/)?(?<name>[\w\d_]+)(?:-(?<hash>[\w\d]+))?(?:-ex\d+)?\.(?<extension>\w+)$/;
55

66
/**
77
* Parses the object URL to extract id, userId, prefix, name, hash and extension.

0 commit comments

Comments
 (0)