@nestjs/common 12.0.0-alpha.2 → 12.0.0-alpha.4
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/Readme.md
CHANGED
|
@@ -29,7 +29,7 @@ Nest is a framework for building efficient, scalable <a href="https://nodejs.org
|
|
|
29
29
|
|
|
30
30
|
## Philosophy
|
|
31
31
|
|
|
32
|
-
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and
|
|
32
|
+
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.dev/" target="_blank">Angular</a>, <a href="https://react.dev/" target="_blank">React</a>, and <a href="https://vuejs.org/" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
|
|
33
33
|
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
|
|
34
34
|
|
|
35
35
|
## Getting started
|
|
@@ -95,6 +95,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
95
95
|
<td align="center" valign="middle"><a href="https://crawljobs.com" target="_blank"><img src="https://nestjs.com/img/logos/crawljobs-logo.svg" width="130" valign="middle" /></a></td>
|
|
96
96
|
</tr><tr>
|
|
97
97
|
<td align="center" valign="middle"><a href="https://pandektes.com" target="_blank"><img src="https://nestjs.com/img/logos/pandektes-logo.png" width="65" valign="middle" /></a></td>
|
|
98
|
+
<td align="center" valign="middle"><a href="https://www.fintechcrafts.com/" target="_blank"><img src="https://nestjs.com/img/logos/fintechcrafts-logo.svg" width="65" valign="middle" /></a></td>
|
|
98
99
|
</tr>
|
|
99
100
|
</table>
|
|
100
101
|
|
|
@@ -27,6 +27,7 @@ export function UsePipes(...pipes) {
|
|
|
27
27
|
return (target, key, descriptor) => {
|
|
28
28
|
const isPipeValid = (pipe) => pipe && (isFunction(pipe) || isFunction(pipe.transform));
|
|
29
29
|
if (descriptor) {
|
|
30
|
+
validateEach(target.constructor, pipes, isPipeValid, '@UsePipes', 'pipe');
|
|
30
31
|
extendArrayMetadata(PIPES_METADATA, pipes, descriptor.value);
|
|
31
32
|
return descriptor;
|
|
32
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/common",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"./*": "./*.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"file-type": "21.3.
|
|
29
|
+
"file-type": "21.3.4",
|
|
30
30
|
"iterare": "1.2.1",
|
|
31
31
|
"load-esm": "1.0.3",
|
|
32
32
|
"tslib": "2.8.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"optional": true
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "415e4d33707e74998d8456be7bd305cedb6508e3"
|
|
50
50
|
}
|
|
@@ -18,6 +18,18 @@ export class FileTypeValidator extends FileValidator {
|
|
|
18
18
|
? errorMessage({ file, config })
|
|
19
19
|
: errorMessage;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* If the file buffer is not available, and fallbackToMimetype is not enabled,
|
|
23
|
+
* we cannot perform magic number validation,
|
|
24
|
+
* so we return a specific error message indicating
|
|
25
|
+
* that validation could not be performed due to missing buffer.
|
|
26
|
+
*/
|
|
27
|
+
if (file?.mimetype &&
|
|
28
|
+
!file.buffer &&
|
|
29
|
+
!this.validationOptions?.fallbackToMimetype &&
|
|
30
|
+
!this.validationOptions?.skipMagicNumbersValidation) {
|
|
31
|
+
return `Validation failed (file buffer is not available; file type validation could not be performed; expected type is ${this.validationOptions.fileType})`;
|
|
32
|
+
}
|
|
21
33
|
if (file?.mimetype) {
|
|
22
34
|
const baseMessage = `Validation failed (current file type is ${file.mimetype}, expected type is ${this.validationOptions.fileType})`;
|
|
23
35
|
/**
|
package/pipes/parse-date.pipe.js
CHANGED
|
@@ -24,7 +24,7 @@ let ParseDatePipe = class ParseDatePipe {
|
|
|
24
24
|
if (this.options.optional && isNil(value)) {
|
|
25
25
|
return this.options.default ? this.options.default() : value;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
27
|
+
if (isNil(value) || value === '') {
|
|
28
28
|
throw this.exceptionFactory('Validation failed (no Date provided)');
|
|
29
29
|
}
|
|
30
30
|
const transformedValue = isString(value) || isNumber(value) || value instanceof Date
|
|
@@ -214,8 +214,36 @@ export declare class ConsoleLogger implements LoggerService {
|
|
|
214
214
|
protected formatTimestampDiff(timestampDiff: number): string;
|
|
215
215
|
protected getInspectOptions(): InspectOptions;
|
|
216
216
|
protected stringifyReplacer(key: string, value: unknown): unknown;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
protected getContextAndMessagesToPrint(args: unknown[]): {
|
|
218
|
+
messages: unknown[];
|
|
219
|
+
context: string | undefined;
|
|
220
|
+
params?: undefined;
|
|
221
|
+
} | {
|
|
222
|
+
messages: unknown[];
|
|
223
|
+
context: string | undefined;
|
|
224
|
+
params: any;
|
|
225
|
+
};
|
|
226
|
+
protected getContextAndStackAndMessagesToPrint(args: unknown[]): {
|
|
227
|
+
messages: unknown[];
|
|
228
|
+
stack: string;
|
|
229
|
+
context: string | undefined;
|
|
230
|
+
params?: undefined;
|
|
231
|
+
} | {
|
|
232
|
+
messages: unknown[];
|
|
233
|
+
context: string | undefined;
|
|
234
|
+
params?: undefined;
|
|
235
|
+
stack?: undefined;
|
|
236
|
+
} | {
|
|
237
|
+
messages: unknown[];
|
|
238
|
+
context: string | undefined;
|
|
239
|
+
params: any;
|
|
240
|
+
stack?: undefined;
|
|
241
|
+
} | {
|
|
242
|
+
stack: string | undefined;
|
|
243
|
+
messages: unknown[];
|
|
244
|
+
context: string | undefined;
|
|
245
|
+
params: any;
|
|
246
|
+
};
|
|
247
|
+
protected isStackFormat(stack: unknown): boolean;
|
|
248
|
+
protected getColorByLogLevel(level: LogLevel): (text: string) => string;
|
|
221
249
|
}
|