@dnax/core 0.9.6 → 0.9.8

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 CHANGED
@@ -564,6 +564,7 @@ function HonoInstance(): typeof app {
564
564
  const width = parseInt(c.req.query("w")) || null;
565
565
  const height = parseInt(c.req.query("h")) || null;
566
566
  const quality = parseInt(c.req.query("q")) || 80;
567
+ const crop = c.req.query("fit") || "contain";
567
568
  // Vérifier si le fichier existe
568
569
  if (!fs.existsSync(filePath)) {
569
570
  return c.text("file not found", 404);
@@ -583,7 +584,9 @@ function HonoInstance(): typeof app {
583
584
  try {
584
585
  // Redimensionner l'image avec Sharp
585
586
  const buffer = await sharp(filePath)
586
- .resize(width, height)
587
+ .resize(width, height, {
588
+ fit: crop || "contain",
589
+ })
587
590
  .jpeg({ quality })
588
591
  .toBuffer();
589
592
 
package/lib/schema.ts CHANGED
@@ -18,7 +18,7 @@ function buildSchema(col: Collection) {
18
18
  propertySchema[f.name] = v.array();
19
19
  }
20
20
 
21
- if (f?.type == "uuid" && f?.random?.toNumber) {
21
+ if (f?.type == "uuid") {
22
22
  propertySchema[f.name] = v.string();
23
23
  }
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/types/index.ts CHANGED
@@ -306,6 +306,7 @@ export type loggerFunction = (
306
306
  action?: string;
307
307
  collection?: string;
308
308
  cleanDeep?: boolean;
309
+
309
310
  useCache?: boolean;
310
311
  method: string;
311
312
  url?: string;