@volare.finance/nestjs.plugins
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,2 +6,3 @@ /** | ||
import { FilterDto } from './filter.dto'; | ||
export declare const LIMIT_MAX: number; | ||
export declare const DEFAULT_PROJECTION = "-_id -__v"; | ||
@@ -8,0 +9,0 @@ export declare const DEFAULT_PROJECTION_OBJECT: { |
@@ -7,3 +7,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MongoService = exports.DEFAULT_PROJECTION_OBJECT = exports.DEFAULT_PROJECTION = void 0; | ||
exports.MongoService = exports.DEFAULT_PROJECTION_OBJECT = exports.DEFAULT_PROJECTION = exports.LIMIT_MAX = void 0; | ||
const dotenv_1 = require("dotenv"); | ||
(0, dotenv_1.config)({ path: '.env', encoding: 'utf8' }); | ||
exports.LIMIT_MAX = Number(process.env.LIMIT_MAX) || 100; | ||
exports.DEFAULT_PROJECTION = '-_id -__v'; | ||
@@ -22,3 +25,3 @@ exports.DEFAULT_PROJECTION_OBJECT = { _id: 0, __v: 0 }; | ||
} | ||
query.limit(filter.limit && filter.limit < 100 ? filter.limit : 100); | ||
query.limit(filter.limit && filter.limit < exports.LIMIT_MAX ? filter.limit : exports.LIMIT_MAX); | ||
return query.select(filter.projection || exports.DEFAULT_PROJECTION).exec(); | ||
@@ -36,3 +39,3 @@ } | ||
} | ||
aggregate2.limit(filter.limit && filter.limit < 100 ? filter.limit : 100); | ||
aggregate2.limit(filter.limit && filter.limit < exports.LIMIT_MAX ? filter.limit : exports.LIMIT_MAX); | ||
return aggregate2.project(filter.projection || exports.DEFAULT_PROJECTION); | ||
@@ -39,0 +42,0 @@ } |
{ | ||
"name": "@volare.finance/nestjs.plugins", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "@volare.finance/nestjs.plugins", | ||
"keywords": ["nest.js", "plugin"], | ||
"keywords": [ | ||
"nest.js", | ||
"plugin" | ||
], | ||
"author": "volare-dev", | ||
@@ -21,2 +24,3 @@ "license": "MIT", | ||
"axios": "^1.6.1", | ||
"dotenv": "^16.4.0", | ||
"winston": "^3.12.0" | ||
@@ -23,0 +27,0 @@ }, |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
76015
1508
6
2
+ Addeddotenv@^16.4.0
+ Addeddotenv@16.4.7(transitive)