diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 20:21:29 +0000 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 20:21:29 +0000 |
commit | 61cb1570a3410c85a4489b97c172e3a50715f36c (patch) | |
tree | 8fe4a5b77ea54bba80abc817ce2c9ef0e79e7e66 /sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js | |
parent | 21a53d349788c99d2007cba91a923db982353b31 (diff) | |
parent | a9ee9e0a500a4a15bd0b5dcaf041f827228ed309 (diff) |
Merge branch 'researchML' into 'dev'
Research ml
See merge request igrannonica/neuronstellar!6
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js new file mode 100644 index 00000000..bf2f5a98 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js @@ -0,0 +1,86 @@ +"use strict"; +/** + * @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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FallbackEngineHost = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const src_1 = require("../src"); +/** + * An EngineHost that support multiple hosts in a fallback configuration. If a host does not + * have a collection/schematics, use the following host before giving up. + */ +class FallbackEngineHost { + constructor() { + this._hosts = []; + } + addHost(host) { + this._hosts.push(host); + } + createCollectionDescription(name, requester) { + for (const host of this._hosts) { + try { + const description = host.createCollectionDescription(name, requester); + return { name, host, description }; + } + catch (_) { } + } + throw new src_1.UnknownCollectionException(name); + } + createSchematicDescription(name, collection) { + const description = collection.host.createSchematicDescription(name, collection.description); + if (!description) { + return null; + } + return { name, collection, description }; + } + getSchematicRuleFactory(schematic, collection) { + return collection.host.getSchematicRuleFactory(schematic.description, collection.description); + } + createSourceFromUrl(url, context) { + return context.schematic.collection.description.host.createSourceFromUrl(url, context); + } + transformOptions(schematic, options, context) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (0, rxjs_1.of)(options).pipe(...this._hosts.map((host) => (0, operators_1.mergeMap)((opt) => host.transformOptions(schematic, opt, context)))); + } + transformContext(context) { + let result = context; + this._hosts.forEach((host) => { + result = (host.transformContext(result) || result); + }); + return result; + } + listSchematicNames(collection) { + const allNames = new Set(); + this._hosts.forEach((host) => { + try { + host.listSchematicNames(collection.description).forEach((name) => allNames.add(name)); + } + catch (_) { } + }); + return [...allNames]; + } + createTaskExecutor(name) { + for (const host of this._hosts) { + if (host.hasTaskExecutor(name)) { + return host.createTaskExecutor(name); + } + } + return (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name)); + } + hasTaskExecutor(name) { + for (const host of this._hosts) { + if (host.hasTaskExecutor(name)) { + return true; + } + } + return false; + } +} +exports.FallbackEngineHost = FallbackEngineHost; |