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

Function addElementToBindingPattern

test/fixtures/snapshot/typescript.js:153846–153854  ·  view source on GitHub ↗
(bindingPattern, name, propertyName)

Source from the content-addressed store, hash-verified

153844 }
153845 }
153846 function addElementToBindingPattern(bindingPattern, name, propertyName) {
153847 var element = ts.factory.createBindingElement(/*dotDotDotToken*/ undefined, propertyName, name);
153848 if (bindingPattern.elements.length) {
153849 changes.insertNodeInListAfter(sourceFile, ts.last(bindingPattern.elements), element);
153850 }
153851 else {
153852 changes.replaceNode(sourceFile, bindingPattern, ts.factory.createObjectBindingPattern([element]));
153853 }
153854 }
153855 }
153856 function addNamespaceQualifier(changes, sourceFile, _a) {
153857 var namespacePrefix = _a.namespacePrefix, position = _a.position;

Callers 1

doAddExistingFixFunction · 0.85

Calls 1

lastMethod · 0.45

Tested by

no test coverage detected