1 | (function (factory) {
|
---|
2 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
3 | var v = factory(require, exports);
|
---|
4 | if (v !== undefined) module.exports = v;
|
---|
5 | }
|
---|
6 | else if (typeof define === "function" && define.amd) {
|
---|
7 | define("@angular/compiler-cli/ngcc/src/rendering/utils", ["require", "exports", "@angular/compiler-cli/src/ngtsc/imports", "@angular/compiler-cli/ngcc/src/rendering/ngcc_import_rewriter"], factory);
|
---|
8 | }
|
---|
9 | })(function (require, exports) {
|
---|
10 | "use strict";
|
---|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
12 | exports.stripExtension = exports.getImportRewriter = void 0;
|
---|
13 | var imports_1 = require("@angular/compiler-cli/src/ngtsc/imports");
|
---|
14 | var ngcc_import_rewriter_1 = require("@angular/compiler-cli/ngcc/src/rendering/ngcc_import_rewriter");
|
---|
15 | /**
|
---|
16 | * Create an appropriate ImportRewriter given the parameters.
|
---|
17 | */
|
---|
18 | function getImportRewriter(r3SymbolsFile, isCore, isFlat) {
|
---|
19 | if (isCore && isFlat) {
|
---|
20 | return new ngcc_import_rewriter_1.NgccFlatImportRewriter();
|
---|
21 | }
|
---|
22 | else if (isCore) {
|
---|
23 | return new imports_1.R3SymbolsImportRewriter(r3SymbolsFile.fileName);
|
---|
24 | }
|
---|
25 | else {
|
---|
26 | return new imports_1.NoopImportRewriter();
|
---|
27 | }
|
---|
28 | }
|
---|
29 | exports.getImportRewriter = getImportRewriter;
|
---|
30 | function stripExtension(filePath) {
|
---|
31 | return filePath.replace(/\.(js|d\.ts)$/, '');
|
---|
32 | }
|
---|
33 | exports.stripExtension = stripExtension;
|
---|
34 | });
|
---|
35 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbmdjYy9zcmMv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