@nestjs/common 11.0.19 → 11.0.20
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": "@nestjs/common",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.20",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"file-type": "20.4.1",
|
|
22
22
|
"iterare": "1.2.1",
|
|
23
|
+
"load-esm": "1.0.2",
|
|
23
24
|
"tslib": "2.8.1",
|
|
24
25
|
"uid": "2.0.2"
|
|
25
26
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileTypeValidator = void 0;
|
|
4
4
|
const file_validator_interface_1 = require("./file-validator.interface");
|
|
5
|
+
const load_esm_1 = require("load-esm");
|
|
5
6
|
/**
|
|
6
7
|
* Defines the built-in FileTypeValidator. It validates incoming files by examining
|
|
7
8
|
* their magic numbers using the file-type package, providing more reliable file type validation
|
|
@@ -30,7 +31,7 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
|
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
32
33
|
try {
|
|
33
|
-
const { fileTypeFromBuffer } =
|
|
34
|
+
const { fileTypeFromBuffer } = await (0, load_esm_1.loadEsm)('file-type');
|
|
34
35
|
const fileType = await fileTypeFromBuffer(file.buffer);
|
|
35
36
|
return (!!fileType && !!fileType.mime.match(this.validationOptions.fileType));
|
|
36
37
|
}
|