Skip to content

Commit

Permalink
Remove (now unused) blob2topic() utility.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <[email protected]>
  • Loading branch information
svienot committed Dec 11, 2024
1 parent 7699870 commit 3975041
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/utils/URLUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*
*/

import {EntityID} from "@/utils/EntityID";
import {CID} from "multiformats";

export function blob2URL(blob: string | null, ipfsGateway: string | null, arweaveServer: string | null): string | null {
Expand All @@ -44,28 +43,6 @@ export function blob2URL(blob: string | null, ipfsGateway: string | null, arweav
return result
}

export function blob2Topic(blob: string | null): string | null {
let result: string | null
let id: string

if (blob !== null) {
if (blob.startsWith('hcs://') && blob.length > 6) {
const i = blob.lastIndexOf('/');
id = blob.substring(i + 1);
} else {
id = blob
}
if (EntityID.parse(id) !== null) {
result = id
} else {
result = null
}
} else {
result = null
}
return result
}

export function isSecureURL(blob: string): boolean {
let isValid: boolean
try {
Expand Down

0 comments on commit 3975041

Please sign in to comment.