Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@golevelup/nestjs-discovery

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@golevelup/nestjs-discovery - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [2.2.1](https://github.com/WonderPanda/nestjs-plus/compare/@golevelup/nestjs-discovery@2.2.0...@golevelup/nestjs-discovery@2.2.1) (2019-12-14)
### Bug Fixes
- **discovery:** discovery of components/providers in lazy way ([8a6fa7f](https://github.com/WonderPanda/nestjs-plus/commit/8a6fa7f))
# 2.2.0 (2019-11-09)

@@ -8,0 +14,0 @@

5

lib/discovery.service.d.ts

@@ -19,4 +19,4 @@ import { ModulesContainer } from '@nestjs/core/injector/modules-container';

private readonly metadataScanner;
private readonly discoveredControllers;
private readonly discoveredProviders;
private discoveredControllers?;
private discoveredProviders?;
constructor(modulesContainer: ModulesContainer, metadataScanner: MetadataScanner);

@@ -70,3 +70,4 @@ /**

private extractMethodMetaAtKey;
private discover;
}
//# sourceMappingURL=discovery.service.d.ts.map

28

lib/discovery.service.js

@@ -49,15 +49,2 @@ "use strict";

this.metadataScanner = metadataScanner;
const modulesMap = [...this.modulesContainer.entries()];
this.discoveredControllers = Promise.all(lodash_1.flatMap(modulesMap, ([key, nestModule]) => {
const components = [...nestModule.routes.values()];
return components
.filter(component => component.scope !== common_1.Scope.REQUEST)
.map(component => this.toDiscoveredClass(nestModule, component));
}));
this.discoveredProviders = Promise.all(lodash_1.flatMap(modulesMap, ([key, nestModule]) => {
const components = [...nestModule.components.values()];
return components
.filter(component => component.scope !== common_1.Scope.REQUEST)
.map(component => this.toDiscoveredClass(nestModule, component));
}));
}

@@ -69,2 +56,5 @@ /**

async providers(filter) {
if (!this.discoveredProviders) {
this.discoveredProviders = this.discover('providers');
}
return (await this.discoveredProviders).filter(x => filter(x));

@@ -102,2 +92,5 @@ }

async controllers(filter) {
if (!this.discoveredControllers) {
this.discoveredControllers = this.discover('controllers');
}
return (await this.discoveredControllers).filter(x => filter(x));

@@ -179,2 +172,11 @@ }

}
async discover(component) {
const modulesMap = [...this.modulesContainer.entries()];
return Promise.all(lodash_1.flatMap(modulesMap, ([key, nestModule]) => {
const components = [...nestModule[component].values()];
return components
.filter(component => component.scope !== common_1.Scope.REQUEST)
.map(component => this.toDiscoveredClass(nestModule, component));
}));
}
};

@@ -181,0 +183,0 @@ DiscoveryService = __decorate([

{
"name": "@golevelup/nestjs-discovery",
"version": "2.2.0",
"version": "2.2.1",
"description": "A Badass NestJS module for querying your app's controllers, providers and handlers",

@@ -51,3 +51,3 @@ "keywords": [

},
"gitHead": "f6eba82698bb356bb8a4c3cdddd070d7868a38fb"
"gitHead": "a34a5bf28fa0c651c37fd62a47bab76bcda853d4"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc