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

Function getDirectiveFromComment

test/fixtures/snapshot/typescript.js:11979–11991  ·  view source on GitHub ↗
(text, commentDirectiveRegEx)

Source from the content-addressed store, hash-verified

11977 });
11978 }
11979 function getDirectiveFromComment(text, commentDirectiveRegEx) {
11980 var match = commentDirectiveRegEx.exec(text);
11981 if (!match) {
11982 return undefined;
11983 }
11984 switch (match[1]) {
11985 case "ts-expect-error":
11986 return 0 /* CommentDirectiveType.ExpectError */;
11987 case "ts-ignore":
11988 return 1 /* CommentDirectiveType.Ignore */;
11989 }
11990 return undefined;
11991 }
11992 /**
11993 * Unconditionally back up and scan a template expression portion.
11994 */

Callers 1

appendIfCommentDirectiveFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…