MCPcopy Index your code
hub / github.com/ampproject/amphtml / set

Method set

build-system/common/transform-cache.js:54–62  ·  view source on GitHub ↗

* @param {string} hash * @param {Promise } transformPromise

(hash, transformPromise)

Source from the content-addressed store, hash-verified

52 * @param {Promise<T>} transformPromise
53 */
54 set(hash, transformPromise) {
55 if (this.transformMap.has(hash)) {
56 throw new Error(`Read race: Attempting to transform ${hash} file twice.`);
57 }
58 this.transformMap.set(hash, transformPromise);
59
60 const filepath = path.join(this.cacheDir, this.key_(hash));
61 transformPromise.then((contents) => fs.outputJson(filepath, contents));
62 }
63
64 /**
65 * @param {string} hash

Callers 15

setStructFunction · 0.45
ImportDeclarationFunction · 0.45
createFunction · 0.45
[memberSelector]Function · 0.45
[destructureSelector]Function · 0.45
resolveImportedEnumFunction · 0.45
resolveLocalFunction · 0.45
resolveEnumFunction · 0.45
inlineIsEnumValueFunction · 0.45
inlineEnumValuesFunction · 0.45
compileJssFunction · 0.45

Calls 3

key_Method · 0.95
hasMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected