Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

sentry / @nestjs/core   js

Repository URL to install this package:

Version: 7.0.10 

/ injector / transient-instances.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const iterare_1 = require("iterare");
/**
 * Returns the instances which are transient
 * @param instances The instances which should be checked whether they are transcient
 */
function getTransientInstances(instances) {
    return iterare_1.iterate(instances)
        .filter(([_, wrapper]) => wrapper.isDependencyTreeStatic())
        .map(([_, wrapper]) => wrapper.getStaticTransientInstances())
        .flatten()
        .filter(item => !!item)
        .map(({ instance }) => instance)
        .toArray();
}
exports.getTransientInstances = getTransientInstances;
/**
 * Returns the instances which are not transient
 * @param instances The instances which should be checked whether they are transcient
 */
function getNonTransientInstances(instances) {
    return iterare_1.iterate(instances)
        .filter(([key, wrapper]) => wrapper.isDependencyTreeStatic() && !wrapper.isTransient)
        .map(([key, { instance }]) => instance)
        .toArray();
}
exports.getNonTransientInstances = getNonTransientInstances;