@dnax/core 0.15.5 → 0.15.7
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/app/hono.ts +2 -3
- package/driver/mongo/rest.ts +3 -3
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -503,9 +503,8 @@ function HonoInstance(): typeof app {
|
|
|
503
503
|
|
|
504
504
|
// Obtenir le type MIME du fichier
|
|
505
505
|
const mimeType = mime.lookup(filePath);
|
|
506
|
-
|
|
507
506
|
// Si ce n'est pas une image, retourner le fichier original
|
|
508
|
-
if (!mimeType || !mimeType
|
|
507
|
+
if (!mimeType || !mimeType?.startsWith("image/")) {
|
|
509
508
|
const originalFile = fs.readFileSync(filePath);
|
|
510
509
|
return c.body(originalFile, 200, {
|
|
511
510
|
"Content-Type": mimeType || "application/octet-stream",
|
|
@@ -518,7 +517,7 @@ function HonoInstance(): typeof app {
|
|
|
518
517
|
.resize(width, height, {
|
|
519
518
|
fit: crop || "contain",
|
|
520
519
|
})
|
|
521
|
-
.
|
|
520
|
+
.png({ quality })
|
|
522
521
|
.toBuffer();
|
|
523
522
|
|
|
524
523
|
// Retourner l'image redimensionnée
|
package/driver/mongo/rest.ts
CHANGED
|
@@ -775,7 +775,7 @@ class useRest {
|
|
|
775
775
|
if (update?.$set) {
|
|
776
776
|
update.$set = deepSetId(
|
|
777
777
|
col,
|
|
778
|
-
omit(update.$set, ["createdAt", "updatedAt"])
|
|
778
|
+
omit(update.$set, ["createdAt", "updatedAt", "_id"])
|
|
779
779
|
);
|
|
780
780
|
update.$set = transformAllDate(update.$set);
|
|
781
781
|
update.$set = await hashPasswordAuto(update.$set, col);
|
|
@@ -783,7 +783,7 @@ class useRest {
|
|
|
783
783
|
//update.$set = deepSetId(col, update.$set);
|
|
784
784
|
var { valid, output, error } = this.validator(
|
|
785
785
|
collection,
|
|
786
|
-
dotJson.object(update
|
|
786
|
+
dotJson.object(update.$set),
|
|
787
787
|
{
|
|
788
788
|
partial: true,
|
|
789
789
|
}
|
|
@@ -1030,7 +1030,7 @@ class useRest {
|
|
|
1030
1030
|
if (update.$set) {
|
|
1031
1031
|
update.$set = deepSetId(
|
|
1032
1032
|
col,
|
|
1033
|
-
omit(update.$set, ["createdAt", "updatedAt"])
|
|
1033
|
+
omit(update.$set, ["createdAt", "updatedAt", "_id"])
|
|
1034
1034
|
);
|
|
1035
1035
|
update.$set = transformAllDate(update.$set);
|
|
1036
1036
|
update.$set = await hashPasswordAuto(update.$set, col);
|