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

Function createTemplateLiteralLikeNodeChecked

test/fixtures/snapshot/typescript.js:24538–24560  ·  view source on GitHub ↗
(kind, text, rawText, templateFlags)

Source from the content-addressed store, hash-verified

24536 : node;
24537 }
24538 function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags) {
24539 if (templateFlags === void 0) { templateFlags = 0 /* TokenFlags.None */; }
24540 ts.Debug.assert(!(templateFlags & ~2048 /* TokenFlags.TemplateLiteralLikeFlags */), "Unsupported template flags.");
24541 // NOTE: without the assignment to `undefined`, we don't narrow the initial type of `cooked`.
24542 // eslint-disable-next-line no-undef-init
24543 var cooked = undefined;
24544 if (rawText !== undefined && rawText !== text) {
24545 cooked = getCookedText(kind, rawText);
24546 if (typeof cooked === "object") {
24547 return ts.Debug.fail("Invalid raw text");
24548 }
24549 }
24550 if (text === undefined) {
24551 if (cooked === undefined) {
24552 return ts.Debug.fail("Arguments 'text' and 'rawText' may not both be undefined.");
24553 }
24554 text = cooked;
24555 }
24556 else if (cooked !== undefined) {
24557 ts.Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");
24558 }
24559 return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags);
24560 }
24561 // @api
24562 function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {
24563 var node = createBaseToken(kind);

Callers 4

createTemplateHeadFunction · 0.85
createTemplateMiddleFunction · 0.85
createTemplateTailFunction · 0.85

Calls 4

getCookedTextFunction · 0.85
assertMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected