dist/src/index.js
function generateOutput(source) {
    return __awaiter(this, void 0, void 0, function () {
        var isCached, artifact, compiled, artifact, _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, caching.has(source.codeHash)];
                case 1:
                    isCached = _b.sent();
                    if (!isCached) return [3 /*break*/, 3];
                    return [4 /*yield*/, caching.get(source.codeHash)];
                case 2:
                    artifact = _b.sent();
                    return [2 /*return*/, artifact];
                case 3: return [4 /*yield*/, solc_install_1.installVersion(source.solcVersion)];
                case 4:
                    _b.sent();
                    return [4 /*yield*/, compile_1.default(source)];
                case 5:
                    compiled = _b.sent();
                    _a = {
                        compiled: compiled
                    };
                    return [4 /*yield*/, output_files_1.createJavascriptFile(source, compiled)];
                case 6:
                    _a.javascript = _b.sent();
                    return [4 /*yield*/, output_files_1.createTypescriptFile(source, compiled)];
                case 7:
                    artifact = (_a.typescript = _b.sent(),
                        _a);
                    return [4 /*yield*/, caching.set(source.codeHash, artifact)];
                case 8:
                    _b.sent();
                    return [2 /*return*/, artifact];
            }
        });
    });
}
function generateOutput(source) {
    return __awaiter(this, void 0, void 0, function () {
        var isCached, artifact, compiled, artifact, _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, caching.has(source.codeHash)];
                case 1:
                    isCached = _b.sent();
                    if (!isCached) return [3 /*break*/, 3];
                    return [4 /*yield*/, caching.get(source.codeHash)];
                case 2:
                    artifact = _b.sent();
                    return [2 /*return*/, artifact];
                case 3: return [4 /*yield*/, solc_install_1.installVersion(source.solcVersion)];
                case 4:
                    _b.sent();
                    return [4 /*yield*/, compile_1.default(source)];
                case 5:
                    compiled = _b.sent();
                    _a = {
                        compiled: compiled
                    };
                    return [4 /*yield*/, output_files_1.createJavascriptFile(source, compiled)];
                case 6:
                    _a.javascript = _b.sent();
                    return [4 /*yield*/, output_files_1.createTypescriptFile(source, compiled)];
                case 7:
                    artifact = (_a.typescript = _b.sent(),
                        _a);
                    return [4 /*yield*/, caching.set(source.codeHash, artifact)];
                case 8:
                    _b.sent();
                    return [2 /*return*/, artifact];
            }
        });
    });
}
function generateOutput ( source ) { return __awaiter ( this , void 0 , void 0 , function ( ) { var isCached , artifact , compiled , artifact , _a ; return __generator ( this , function ( _b ) { switch ( _b . label ) { case 0 : return [ 4 /*yield*/ , caching . has ( source . codeHash ) ] ; case 1 : isCached = _b . sent ( ) ; if ( ! isCached ) return [ 3 /*break*/ , 3 ] ; return [ 4 /*yield*/ , caching . get ( source . codeHash ) ] ; case 2 : artifact = _b . sent ( ) ; return [ 2 /*return*/ , artifact ] ; case 3 : return [ 4 /*yield*/ , solc_install_1 . installVersion ( source . solcVersion ) ] ; case 4 : _b . sent ( ) ; return [ 4 /*yield*/ , compile_1 . default ( source ) ] ; case 5 : compiled = _b . sent ( ) ; _a = { compiled : compiled } ; return [ 4 /*yield*/ , output_files_1 . createJavascriptFile ( source , compiled ) ] ; case 6 : _a . javascript = _b . sent ( ) ; return [ 4 /*yield*/ , output_files_1 . createTypescriptFile ( source , compiled ) ] ; case 7 : artifact = ( _a . typescript = _b . sent ( ) , _a ) ; return [ 4 /*yield*/ , caching . set ( source . codeHash , artifact ) ] ; case 8 : _b . sent ( ) ; return [ 2 /*return*/ , artifact ] ; } } ) ; } ) ; }
generates the output
or retrieves it from cache
generates the output or retrieves it from cache