How to use the transform function from typescript

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

441
442
443
444
445
446
447
448
449
450
451
452
        source,
        ts.ScriptTarget.ESNext,
        /* setParentNodes */ true,
    );


    const result = ts.transform(sourceFile, [transformer]);
    return ts.createPrinter().printNode(ts.EmitHint.Unspecified, result.transformed[0], sourceFile);
}


/**
fork icon116
star icon294
watch icon29

+ 3 other calls in file

59
60
61
62
63
64
65
66
67
68
        emitSkipped: true,
    };
}
// All fast path transformers do not use a program
const transforms = getTransforms.map((getTf) => getTf(/* program */ undefined));
const result = ts.transform(tempSourceFile, transforms, tsOptions);
if (result.transformed.length === 0 || result.transformed[0] === tempSourceFile) {
    return {
        content: null,
        sourceMap: null,
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)