stackseed 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stackseed",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "CLI-first backend boilerplate generator for production-ready Node.js applications",
5
5
  "bin": {
6
6
  "stackseed": "./dist/index.js"
@@ -11,13 +11,11 @@ import { ApiError } from '../utils/ApiError';
11
11
  export const validateDto = (dtoClass: any) => {
12
12
  return async (req: Request, res: Response, next: NextFunction) => {
13
13
  try {
14
- // Transform plain object to class instance
15
14
  const dtoInstance = plainToInstance(dtoClass, req.body);
16
15
 
17
- // Validate the instance
18
16
  const errors: ValidationError[] = await validate(dtoInstance, {
19
- whitelist: true, // Strip properties that don't have decorators
20
- forbidNonWhitelisted: true, // Throw error if non-whitelisted properties are present
17
+ whitelist: true,
18
+ forbidNonWhitelisted: true,
21
19
  skipMissingProperties: false,
22
20
  });
23
21