MCPcopy Create free account
hub / github.com/nodejs/node / updateTypeParameterDeclaration

Function updateTypeParameterDeclaration

test/fixtures/snapshot/typescript.js:23206–23226  ·  view source on GitHub ↗
(node, modifiersOrName, nameOrConstraint, constraintOrDefault, defaultType)

Source from the content-addressed store, hash-verified

23204 return node;
23205 }
23206 function updateTypeParameterDeclaration(node, modifiersOrName, nameOrConstraint, constraintOrDefault, defaultType) {
23207 var name;
23208 var modifiers;
23209 var constraint;
23210 if (modifiersOrName === undefined || ts.isArray(modifiersOrName)) {
23211 modifiers = modifiersOrName;
23212 name = nameOrConstraint;
23213 constraint = constraintOrDefault;
23214 }
23215 else {
23216 modifiers = undefined;
23217 name = modifiersOrName;
23218 constraint = nameOrConstraint;
23219 }
23220 return node.modifiers !== modifiers
23221 || node.name !== name
23222 || node.constraint !== constraint
23223 || node.default !== defaultType
23224 ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node)
23225 : node;
23226 }
23227 // @api
23228 function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
23229 var node = createBaseVariableLikeDeclaration(164 /* SyntaxKind.Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));

Callers

nothing calls this directly

Calls 2

updateFunction · 0.70

Tested by

no test coverage detected