Socket
Socket
Sign inDemoInstall

@nestjs/common

Package Overview
Dependencies
Maintainers
1
Versions
364
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/common - npm Package Compare versions

Comparing version 4.5.1 to 4.5.2

1

constants.d.ts
export declare const metadata: {
MODULES: string;
IMPORTS: string;
COMPONENTS: string;

@@ -4,0 +5,0 @@ CONTROLLERS: string;

@@ -5,2 +5,3 @@ "use strict";

MODULES: 'modules',
IMPORTS: 'imports',
COMPONENTS: 'components',

@@ -7,0 +8,0 @@ CONTROLLERS: 'controllers',

6

decorators/core/component.decorator.js

@@ -40,4 +40,6 @@ "use strict";

function mixin(mixinClass) {
this.offset = this.offset ? ++this.offset : (Math.random() * 100);
Object.defineProperty(mixinClass, 'name', { value: JSON.stringify(this.offset) });
this.offset = this.offset ? ++this.offset : Math.random() * 100;
Object.defineProperty(mixinClass, 'name', {
value: JSON.stringify(this.offset),
});
Component()(mixinClass);

@@ -44,0 +46,0 @@ return mixinClass;

import 'reflect-metadata';
/**
* Defines the module
* - `modules` - the set of the 'imported' modules
* - `modules` - @deprecated the set of the 'imported' modules
* - `imports` - the set of the 'imported' modules
* - `controllers` - the list of controllers (e.g. HTTP controllers)

@@ -12,2 +13,3 @@ * - `components` - the list of components that belong to this module. They can be injected between themselves.

modules?: any[];
imports?: any[];
controllers?: any[];

@@ -14,0 +16,0 @@ components?: any[];

@@ -8,2 +8,3 @@ "use strict";

constants_1.metadata.MODULES,
constants_1.metadata.IMPORTS,
constants_1.metadata.EXPORTS,

@@ -14,4 +15,4 @@ constants_1.metadata.COMPONENTS,

const validateKeys = (keys) => {
const isKeyValid = (key) => metadataKeys.findIndex(k => k === key) < 0;
const validateKey = (key) => {
const isKeyValid = key => metadataKeys.findIndex(k => k === key) < 0;
const validateKey = key => {
if (isKeyValid(key)) {

@@ -25,3 +26,4 @@ throw new invalid_module_config_exception_1.InvalidModuleConfigException(key);

* Defines the module
* - `modules` - the set of the 'imported' modules
* - `modules` - @deprecated the set of the 'imported' modules
* - `imports` - the set of the 'imported' modules
* - `controllers` - the list of controllers (e.g. HTTP controllers)

@@ -35,2 +37,3 @@ * - `components` - the list of components that belong to this module. They can be injected between themselves.

validateKeys(propsKeys);
obj.modules = obj.imports && !obj.modules ? obj.imports : obj.modules;
return (target) => {

@@ -37,0 +40,0 @@ for (const property in obj) {

export declare class InvalidModuleConfigException extends Error {
constructor(property: string);
constructor(property: string);
}
export interface ExpressMiddleware {
(req?: any, res?: any, next?: any): void;
(req?: any, res?: any, next?: any): void;
}

@@ -74,3 +74,3 @@ import { INestMicroservice, ExceptionFilter, PipeTransform } from './index';

/**
* Returns underlying native HTTP server.
* Returns underlying, native HTTP server.
*

@@ -77,0 +77,0 @@ * @returns http.Server

{
"name": "@nestjs/common",
"version": "4.5.1",
"version": "4.5.2",
"description": "Nest - modern, fast, powerful node.js web framework (@common)",

@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec",

@@ -6,2 +6,4 @@ /**

*/
export declare function Bind(...decorators: any[]): (target: object, key: any, descriptor: any) => any;
export declare function Bind(
...decorators: any[]
): (target: object, key: any, descriptor: any) => any;

@@ -7,2 +7,4 @@ import { CustomParamFactory } from '../../interfaces/custom-route-param-factory.interface';

*/
export declare function createRouteParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator;
export declare function createRouteParamDecorator(
factory: CustomParamFactory,
): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator;

@@ -13,2 +13,4 @@ import 'reflect-metadata';

*/
export declare const UseFilters: (...filters: ExceptionFilter[]) => (target: object, key?: any, descriptor?: any) => any;
export declare const UseFilters: (
...filters: ExceptionFilter[]
) => (target: object, key?: any, descriptor?: any) => any;
export declare class InvalidModuleConfigException extends Error {
constructor(property: string);
constructor(property: string);
}

@@ -11,6 +11,6 @@ import 'reflect-metadata';

export declare function Module(obj: {
modules?: any[];
controllers?: any[];
components?: any[];
exports?: any[];
modules?: any[];
controllers?: any[];
components?: any[];
exports?: any[];
}): ClassDecorator;

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

*/
export declare const ReflectMetadata: (metadataKey: any, metadataValue: any) => (target: object, key?: any, descriptor?: any) => any;
export declare const ReflectMetadata: (
metadataKey: any,
metadataValue: any,
) => (target: object, key?: any, descriptor?: any) => any;
import 'reflect-metadata';
import { RequestMappingMetadata } from '../../interfaces/request-mapping-metadata.interface';
export declare const RequestMapping: (metadata?: RequestMappingMetadata) => MethodDecorator;
export declare const RequestMapping: (
metadata?: RequestMappingMetadata,
) => MethodDecorator;
/**

@@ -5,0 +7,0 @@ * Routes HTTP POST requests to the specified path.

@@ -5,6 +5,6 @@ import 'reflect-metadata';

export interface RouteParamsMetadata {
[prop: number]: {
index: number;
data?: ParamData;
};
[prop: number]: {
index: number;
data?: ParamData;
};
}

@@ -18,10 +18,19 @@ export declare const Request: () => ParameterDecorator;

export declare function Query(...pipes: PipeTransform<any>[]): any;
export declare function Query(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Query(
property: string,
...pipes: PipeTransform<any>[]
): any;
export declare function Body(): any;
export declare function Body(...pipes: PipeTransform<any>[]): any;
export declare function Body(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Body(
property: string,
...pipes: PipeTransform<any>[]
): any;
export declare function Param(): any;
export declare function Param(...pipes: PipeTransform<any>[]): any;
export declare function Param(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Param(
property: string,
...pipes: PipeTransform<any>[]
): any;
export declare const Req: () => ParameterDecorator;
export declare const Res: () => ParameterDecorator;

@@ -11,2 +11,4 @@ /**

*/
export declare function UseGuards(...guards: any[]): (target: object, key?: any, descriptor?: any) => any;
export declare function UseGuards(
...guards: any[]
): (target: object, key?: any, descriptor?: any) => any;

@@ -11,2 +11,4 @@ /**

*/
export declare function UseInterceptors(...interceptors: any[]): (target: object, key?: any, descriptor?: any) => any;
export declare function UseInterceptors(
...interceptors: any[]
): (target: object, key?: any, descriptor?: any) => any;

@@ -12,2 +12,4 @@ import { PipeTransform } from '../../interfaces/index';

*/
export declare function UsePipes(...pipes: PipeTransform<any>[]): (target: object, key?: any, descriptor?: any) => any;
export declare function UsePipes(
...pipes: PipeTransform<any>[]
): (target: object, key?: any, descriptor?: any) => any;

@@ -8,4 +8,4 @@ "use strict";

exports.isConstructor = (fn) => fn === 'constructor';
exports.validatePath = (path) => (path.charAt(0) !== '/') ? '/' + path : path;
exports.validatePath = (path) => path.charAt(0) !== '/' ? '/' + path : path;
exports.isNil = (obj) => exports.isUndefined(obj) || obj === null;
exports.isEmpty = (array) => !(array && array.length > 0);
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