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

Function getUnusedName

test/fixtures/snapshot/typescript.js:55289–55311  ·  view source on GitHub ↗
(input, symbol)

Source from the content-addressed store, hash-verified

55287 }
55288 }
55289 function getUnusedName(input, symbol) {
55290 var _a, _b;
55291 var id = symbol ? getSymbolId(symbol) : undefined;
55292 if (id) {
55293 if (context.remappedSymbolNames.has(id)) {
55294 return context.remappedSymbolNames.get(id);
55295 }
55296 }
55297 if (symbol) {
55298 input = getNameCandidateWorker(symbol, input);
55299 }
55300 var i = 0;
55301 var original = input;
55302 while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
55303 i++;
55304 input = "".concat(original, "_").concat(i);
55305 }
55306 (_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
55307 if (id) {
55308 context.remappedSymbolNames.set(id, input);
55309 }
55310 return input;
55311 }
55312 function getNameCandidateWorker(symbol, localName) {
55313 if (localName === "default" /* InternalSymbolName.Default */ || localName === "__class" /* InternalSymbolName.Class */ || localName === "__function" /* InternalSymbolName.Function */) {
55314 var flags = context.flags;

Callers 4

serializeSymbolWorkerFunction · 0.85
includePrivateSymbolFunction · 0.85
serializeBaseTypeFunction · 0.85

Calls 7

getSymbolIdFunction · 0.85
getNameCandidateWorkerFunction · 0.85
concatMethod · 0.80
hasMethod · 0.65
getMethod · 0.65
addMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected