Skip to content

Commit

Permalink
Move util function from sofClient to util file
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed Feb 14, 2025
1 parent eb51ea7 commit 8fe8d17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/lib/utils/sofClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,3 @@ async function getResourcesWithReferences(depth=1) {
}
return allResources;
}

// Utility function to validate a URL
function isValidUrl(url) {
try {
new URL(url);
return true;
} catch (e) {
return false;
}
}
10 changes: 10 additions & 0 deletions src/lib/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@ export async function packageSHC(content:SHCFile | Bundle | undefined): Promise<

return { verifiableCredential: [shc] };
}

// Utility function to validate a URL
export function isValidUrl(url: string) {
try {
new URL(url);
return true;
} catch (e) {
return false;
}
}

0 comments on commit 8fe8d17

Please sign in to comment.