source: trip-planner-front/node_modules/@angular/compiler-cli/linker/src/file_linker/needs_linking.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler-cli/linker/src/file_linker/needs_linking", ["require", "exports", "@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.needsLinking = void 0;
20 var partial_linker_selector_1 = require("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector");
21 /**
22 * Determines if the provided source file may need to be processed by the linker, i.e. whether it
23 * potentially contains any declarations. If true is returned, then the source file should be
24 * processed by the linker as it may contain declarations that need to be fully compiled. If false
25 * is returned, parsing and processing of the source file can safely be skipped to improve
26 * performance.
27 *
28 * This function may return true even for source files that don't actually contain any declarations
29 * that need to be compiled.
30 *
31 * @param path the absolute path of the source file for which to determine whether linking may be
32 * needed.
33 * @param source the source file content as a string.
34 * @returns whether the source file may contain declarations that need to be linked.
35 */
36 function needsLinking(path, source) {
37 return partial_linker_selector_1.declarationFunctions.some(function (fn) { return source.includes(fn); });
38 }
39 exports.needsLinking = needsLinking;
40});
41//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVlZHNfbGlua2luZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9saW5rZXIvc3JjL2ZpbGVfbGlua2Vy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