Skip to content

Commit

Permalink
chore: update comment and remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
HJunyuan committed Jul 26, 2024
1 parent 7851cd7 commit 867191e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/4.0/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let isFirstLoad = true;
// https://github.com/digitalbazaar/jsonld.js?tab=readme-ov-file#custom-document-loader
// FIXME: @types/json-ld seems to be outdated as callback is supposed to be options
const documentLoader: Options.DocLoader["documentLoader"] = async (url, _) => {
// On first load: Preload hardcoded contexts so that no network call is necessary
// On first load: Preload frequently used contexts so that no network request will be made on runtime
if (isFirstLoad) {
isFirstLoad = false;
for (const [url, value] of contextsMap) {
Expand Down Expand Up @@ -57,12 +57,3 @@ export class UnableToInterpretContextError extends Error {
Object.setPrototypeOf(this, UnableToInterpretContextError.prototype);
}
}

/**
* Convert URL to a filename-safe string
* @param url string
* @returns string
*/
export function urlToSafeFilename(url: string) {
return url.replace(/[/\\?%*:|"<>]/g, "-");
}

0 comments on commit 867191e

Please sign in to comment.