/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define("@angular/compiler-cli/src/metadata/index_writer", ["require", "exports", "tslib"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.privateEntriesToIndex = void 0; var tslib_1 = require("tslib"); var INDEX_HEADER = "/**\n * Generated bundle index. Do not edit.\n */\n"; function privateEntriesToIndex(index, privates) { var e_1, _a, e_2, _b; var results = [INDEX_HEADER]; // Export all of the index symbols. results.push("export * from '" + index + "';", ''); // Simplify the exports var exports = new Map(); try { for (var privates_1 = tslib_1.__values(privates), privates_1_1 = privates_1.next(); !privates_1_1.done; privates_1_1 = privates_1.next()) { var entry = privates_1_1.value; var entries = exports.get(entry.module); if (!entries) { entries = []; exports.set(entry.module, entries); } entries.push(entry); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (privates_1_1 && !privates_1_1.done && (_a = privates_1.return)) _a.call(privates_1); } finally { if (e_1) throw e_1.error; } } var compareEntries = compare(function (e) { return e.name; }); var compareModules = compare(function (e) { return e[0]; }); var orderedExports = Array.from(exports) .map(function (_a) { var _b = tslib_1.__read(_a, 2), module = _b[0], entries = _b[1]; return [module, entries.sort(compareEntries)]; }) .sort(compareModules); try { for (var orderedExports_1 = tslib_1.__values(orderedExports), orderedExports_1_1 = orderedExports_1.next(); !orderedExports_1_1.done; orderedExports_1_1 = orderedExports_1.next()) { var _c = tslib_1.__read(orderedExports_1_1.value, 2), module_1 = _c[0], entries = _c[1]; var symbols = entries.map(function (e) { return e.name + " as " + e.privateName; }); results.push("export {" + symbols + "} from '" + module_1 + "';"); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (orderedExports_1_1 && !orderedExports_1_1.done && (_b = orderedExports_1.return)) _b.call(orderedExports_1); } finally { if (e_2) throw e_2.error; } } return results.join('\n'); } exports.privateEntriesToIndex = privateEntriesToIndex; function compare(select) { return function (a, b) { var ak = select(a); var bk = select(b); return ak > bk ? 1 : ak < bk ? -1 : 0; }; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhfd3JpdGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL3NyYy9tZXRhZGF0YS9pbmRleF93cml0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUlILElBQU0sWUFBWSxHQUFHLHFEQUdwQixDQUFDO0lBSUYsU0FBZ0IscUJBQXFCLENBQUMsS0FBYSxFQUFFLFFBQThCOztRQUNqRixJQUFNLE9BQU8sR0FBYSxDQUFDLFlBQVksQ0FBQyxDQUFDO1FBRXpDLG1DQUFtQztRQUNuQyxPQUFPLENBQUMsSUFBSSxDQUFDLG9CQUFrQixLQUFLLE9BQUksRUFBRSxFQUFFLENBQUMsQ0FBQztRQUU5Qyx1QkFBdUI7UUFDdkIsSUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQWdDLENBQUM7O1lBRXhELEtBQW9CLElBQUEsYUFBQSxpQkFBQSxRQUFRLENBQUEsa0NBQUEsd0RBQUU7Z0JBQXpCLElBQU0sS0FBSyxxQkFBQTtnQkFDZCxJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztnQkFDeEMsSUFBSSxDQUFDLE9BQU8sRUFBRTtvQkFDWixPQUFPLEdBQUcsRUFBRSxDQUFDO29CQUNiLE9BQU8sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxPQUFPLENBQUMsQ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