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

Function getTypeFromBindingPattern

test/fixtures/snapshot/typescript.js:56471–56477  ·  view source on GitHub ↗
(pattern, includePatternInType, reportErrors)

Source from the content-addressed store, hash-verified

56469 // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of
56470 // the parameter.
56471 function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
56472 if (includePatternInType === void 0) { includePatternInType = false; }
56473 if (reportErrors === void 0) { reportErrors = false; }
56474 return pattern.kind === 201 /* SyntaxKind.ObjectBindingPattern */
56475 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
56476 : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
56477 }
56478 // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type
56479 // specified in a type annotation or inferred from an initializer. However, in the case of a destructuring declaration it
56480 // is a bit more involved. For example:

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…