MCPcopy Index your code
hub / github.com/atomicdata-dev/atomic-data-browser / getResourceAsync

Method getResourceAsync

lib/src/store.ts:184–191  ·  view source on GitHub ↗

* Gets a resource by URL. Fetches and parses it if it's not available in the * store. Not recommended to use this for rendering, because it might cause * resources to be fetched multiple times.

(subject: string)

Source from the content-addressed store, hash-verified

182 * resources to be fetched multiple times.
183 */
184 async getResourceAsync(subject: string): Promise<Resource> {
185 const found = this.resources.get(subject);
186 if (found == undefined) {
187 const newR = await this.fetchResource(subject);
188 return newR;
189 }
190 return found;
191 }
192
193 /** Gets a property by URL. */
194 async getProperty(subject: string): Promise<Property> {

Callers 6

checkSubjectTakenMethod · 0.95
getPropertyMethod · 0.95
commit.test.tsFile · 0.80
canWriteMethod · 0.80
getRightsMethod · 0.80
handleNewLineMaybeFunction · 0.80

Calls 2

fetchResourceMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected