@orion-js/file-manager 3.9.2 → 3.9.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/lib/File/index.js +7 -2
- package/package.json +2 -2
package/lib/File/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const schema_1 = require("./schema");
|
|
|
11
11
|
const typed_model_1 = require("@orion-js/typed-model");
|
|
12
12
|
const isImage_1 = require("./resolvers/isImage");
|
|
13
13
|
const credentials_1 = require("../credentials");
|
|
14
|
+
const lodash_1 = require("lodash");
|
|
14
15
|
const schema = (0, typed_model_1.getModelForClass)(schema_1.FileSchema).getSchema();
|
|
15
16
|
exports.default = (0, models_1.createModel)({
|
|
16
17
|
name: 'File',
|
|
@@ -29,7 +30,9 @@ exports.default = (0, models_1.createModel)({
|
|
|
29
30
|
if (!file.resizedData && options.getResizedImages) {
|
|
30
31
|
try {
|
|
31
32
|
file.resizedData = await options.getResizedImages(file);
|
|
32
|
-
|
|
33
|
+
if (!(0, lodash_1.isEmpty)(file.resizedData)) {
|
|
34
|
+
await Files_1.Files.updateOne(file, { $set: { resizedData: file.resizedData } });
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
catch (error) {
|
|
35
38
|
console.error('Error getting resized images', error);
|
|
@@ -38,7 +41,9 @@ exports.default = (0, models_1.createModel)({
|
|
|
38
41
|
if (!file.colorsData && options.getImageColors) {
|
|
39
42
|
try {
|
|
40
43
|
file.colorsData = await options.getImageColors(file);
|
|
41
|
-
|
|
44
|
+
if (!(0, lodash_1.isEmpty)(file.colorsData)) {
|
|
45
|
+
await Files_1.Files.updateOne(file, { $set: { colorsData: file.colorsData } });
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
catch (error) {
|
|
44
49
|
console.error('Error getting image colors', error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/file-manager",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "57a7323d78585ce1d823548d464709f46aed84b7"
|
|
40
40
|
}
|