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

Function getUniqueTypeParameterName

test/fixtures/snapshot/typescript.js:79752–79763  ·  view source on GitHub ↗
(typeParameters, baseName)

Source from the content-addressed store, hash-verified

79750 return ts.some(typeParameters, function (tp) { return tp.symbol.escapedName === name; });
79751 }
79752 function getUniqueTypeParameterName(typeParameters, baseName) {
79753 var len = baseName.length;
79754 while (len > 1 && baseName.charCodeAt(len - 1) >= 48 /* CharacterCodes._0 */ && baseName.charCodeAt(len - 1) <= 57 /* CharacterCodes._9 */)
79755 len--;
79756 var s = baseName.slice(0, len);
79757 for (var index = 1; true; index++) {
79758 var augmentedName = s + index;
79759 if (!hasTypeParameterByName(typeParameters, augmentedName)) {
79760 return augmentedName;
79761 }
79762 }
79763 }
79764 function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
79765 var signature = getSingleCallSignature(funcType);
79766 if (signature && !signature.typeParameters) {

Callers 1

getUniqueTypeParametersFunction · 0.85

Calls 2

hasTypeParameterByNameFunction · 0.85
sliceMethod · 0.65

Tested by

no test coverage detected