How to use the tsickle.convertDecorators function in tsickle

To help you get started, we’ve selected a few tsickle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JuanDelgadillo / angular2-pokedex / vendors / @angular / tsc-wrapped / src / compiler_host.js View on Github external
this.getSourceFile = function (fileName, languageVersion, onError) {
            var originalContent = _this.delegate.readFile(fileName);
            var newContent = originalContent;
            if (!/\.d\.ts$/.test(fileName)) {
                try {
                    var converted = tsickle_1.convertDecorators(_this.program.getTypeChecker(), _this.program.getSourceFile(fileName));
                    if (converted.diagnostics) {
                        (_a = _this.diagnostics).push.apply(_a, converted.diagnostics);
                    }
                    newContent = converted.output + _this.TSICKLE_SUPPORT;
                }
                catch (e) {
                    console.error('Cannot convertDecorators on file', fileName);
                    throw e;
                }
            }
            return ts.createSourceFile(fileName, newContent, languageVersion, true);
            var _a;
        };
    }
github Promact / md2 / libs / @angular / tsc-wrapped / src / compiler_host.js View on Github external
this.getSourceFile = function (fileName, languageVersion, onError) {
            var originalContent = _this.delegate.readFile(fileName);
            var newContent = originalContent;
            if (!/\.d\.ts$/.test(fileName)) {
                try {
                    var converted = tsickle.convertDecorators(_this.program.getTypeChecker(), _this.program.getSourceFile(fileName));
                    if (converted.diagnostics) {
                        (_a = _this.diagnostics).push.apply(_a, converted.diagnostics);
                    }
                    newContent = converted.output + _this.ANNOTATION_SUPPORT;
                }
                catch (e) {
                    console.error('Cannot convertDecorators on file', fileName);
                    throw e;
                }
            }
            return ts.createSourceFile(fileName, newContent, languageVersion, true);
            var _a;
        };
    }