MCPcopy Index your code
hub / github.com/nodejs/node / getOrUpdate

Function getOrUpdate

test/fixtures/snapshot/typescript.js:855–862  ·  view source on GitHub ↗
(map, key, callback)

Source from the content-addressed store, hash-verified

853 }
854 ts.mapDefinedValues = mapDefinedValues;
855 function getOrUpdate(map, key, callback) {
856 if (map.has(key)) {
857 return map.get(key);
858 }
859 var value = callback();
860 map.set(key, value);
861 return value;
862 }
863 ts.getOrUpdate = getOrUpdate;
864 function tryAddToSet(set, value) {
865 if (!set.has(value)) {

Callers

nothing calls this directly

Calls 4

callbackFunction · 0.70
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…