How to use the createLiteral function from typescript

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

129
130
131
132
133
134
135
136
137
138
function createResourceImport(node, loader, resourceImportDeclarations, moduleKind = ts.ModuleKind.ES2015) {
    const url = getResourceUrl(node, loader);
    if (!url) {
        return null;
    }
    const urlLiteral = ts.createLiteral(url);
    if (moduleKind < ts.ModuleKind.ES2015) {
        return ts.createPropertyAccess(ts.createCall(ts.createIdentifier('require'), [], [urlLiteral]), 'default');
    }
    else {
fork icon0
star icon0
watch icon1

+ 3 other calls in file

Other functions in typescript

Sorted by popularity

function icon

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