Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
22 lines
1.2 KiB
Plaintext
22 lines
1.2 KiB
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.buildFilteredServiceBindings = buildFilteredServiceBindings;
|
|
const buildInstanceBinding_1 = require("../../binding/calculations/buildInstanceBinding");
|
|
function buildFilteredServiceBindings(params, bindingConstraints, options) {
|
|
const serviceIdentifier = options?.customServiceIdentifier ?? bindingConstraints.serviceIdentifier;
|
|
const serviceBindings = options?.chained === true
|
|
? [...params.operations.getBindingsChained(serviceIdentifier)]
|
|
: [...(params.operations.getBindings(serviceIdentifier) ?? [])];
|
|
const filteredBindings = serviceBindings.filter((binding) => binding.isSatisfiedBy(bindingConstraints));
|
|
if (filteredBindings.length === 0 &&
|
|
params.autobindOptions !== undefined &&
|
|
typeof serviceIdentifier === 'function') {
|
|
const binding = (0, buildInstanceBinding_1.buildInstanceBinding)(params.autobindOptions, serviceIdentifier);
|
|
params.operations.setBinding(binding);
|
|
if (binding.isSatisfiedBy(bindingConstraints)) {
|
|
filteredBindings.push(binding);
|
|
}
|
|
}
|
|
return filteredBindings;
|
|
}
|
|
//# sourceMappingURL=buildFilteredServiceBindings.js.map |