@opengis/fastify-table 2.0.87 → 2.0.88

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.
@@ -1 +1 @@
1
- {"version":3,"file":"allowedExtensions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/file/utils/allowedExtensions.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,GAAG,EAAE,MAAM,EAsChB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,MAAM,EAUnB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,MAAM,EAA0B,CAAC;AAE/C,QAAA,MAAM,SAAS,EAAE,MAAM,EAatB,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;;;;;;;AAE1C,wBAKE"}
1
+ {"version":3,"file":"allowedExtensions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/file/utils/allowedExtensions.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,GAAG,EAAE,MAAM,EAsChB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,MAAM,EAInB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,MAAM,EAEnB,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,MAAM,EAetB,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;;;;;;;AAE1C,wBAKE"}
@@ -1,4 +1,7 @@
1
- const all = [
1
+ const envExtensions = process.env.allowedExtensions?.startsWith?.("[")
2
+ ? JSON.parse(process.env.allowedExtensions)
3
+ : process.env.allowedExtensions?.split?.(",");
4
+ const all = envExtensions || [
2
5
  "jpg",
3
6
  "jpeg",
4
7
  "png",
@@ -37,19 +40,9 @@ const all = [
37
40
  "heic",
38
41
  "webp",
39
42
  ];
40
- const images = [
41
- "jpg",
42
- "jpeg",
43
- "png",
44
- "tiff",
45
- "tif",
46
- "ico",
47
- "svg",
48
- "heic",
49
- "webp",
50
- ];
51
- const videos = ["mp4", "mov", "avi"];
52
- const documents = [
43
+ const images = all.filter((ext) => ["jpg", "jpeg", "png", "tiff", "tif", "ico", "svg", "heic", "webp"].includes(ext));
44
+ const videos = all.filter((ext) => ["mp4", "mov", "avi"].includes(ext));
45
+ const documents = all.filter((ext) => [
53
46
  "pdf",
54
47
  "doc",
55
48
  "docx",
@@ -62,7 +55,7 @@ const documents = [
62
55
  "xml",
63
56
  "ppt",
64
57
  "pptx",
65
- ];
58
+ ].includes(ext));
66
59
  export { all, images, videos, documents };
67
60
  export default {
68
61
  all,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.87",
3
+ "version": "2.0.88",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [