How to use the factory function from typescript

Find comprehensive JavaScript typescript.factory code examples handpicked from public code repositorys.

25
26
27
28
29
30
31
32
33
34
if (
  ts.isCallExpression(node) &&
  ts.isPropertyAccessExpression(node.expression) &&
  node.expression.name.text === "log"
) {
  const logFunc = ts.factory.createStringLiteralFromNode(
    ts.factory.createStringLiteral('myLog')
  );
  const newArgs = ts.factory.createNodeArray([
    ts.factory.createStringLiteral(
fork icon0
star icon0
watch icon1

+ 303 other calls in file

24
25
26
27
28
29
30
31
32
33
if (
  (node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral ||
    ts.isStringLiteral(node)) &&
  node.getFullText().trim().startsWith('// language=markdown')
) {
  return ts.factory.createStringLiteral(marked.parse(node.text));
}

if (
  ts.isImportDeclaration(node) &&
fork icon0
star icon0
watch icon1

Other functions in typescript

Sorted by popularity

function icon

typescript.SyntaxKind is the most popular function in typescript (82777 examples)