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

Function getStringLikeTypeForType

test/fixtures/snapshot/typescript.js:68378–68380  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

68376 return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
68377 }
68378 function getStringLikeTypeForType(type) {
68379 return type.flags & (1 /* TypeFlags.Any */ | 402653316 /* TypeFlags.StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
68380 }
68381 // This function infers from the text parts and type parts of a source literal to a target template literal. The number
68382 // of text parts is always one more than the number of type parts, and a source string literal is treated as a source
68383 // with one text part and zero type parts. The function returns an array of inferred string or template literal types

Callers

nothing calls this directly

Calls 1

getTemplateLiteralTypeFunction · 0.85

Tested by

no test coverage detected