uti 7.3.0 → 7.3.1

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": "uti",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/uti.mjs CHANGED
@@ -139,8 +139,22 @@ export class UTIController {
139
139
  * @return {string[]} UTI for the given fileName or undefined if no UTI is registerd for the file names extension
140
140
  */
141
141
  getUTIsForFileName(fileName) {
142
- const m = fileName.match(/(\.[a-zA-Z_0-9]+)$/);
143
- return m ? this.utiByFileNameExtension.get(m[1]) : [];
142
+ const m = fileName.match(/(\.[\.a-zA-Z_0-9]+)$/);
143
+
144
+ if (m) {
145
+ for (
146
+ let extension = m[1];
147
+ extension.length > 0;
148
+ extension = extension.replace(/^\.[a-zA-Z_0-9]+/, "")
149
+ ) {
150
+ const utis = this.utiByFileNameExtension.get(extension);
151
+ if (utis) {
152
+ return utis;
153
+ }
154
+ }
155
+ }
156
+
157
+ return [];
144
158
  }
145
159
 
146
160
  /**
@@ -230,7 +230,7 @@ export default [
230
230
  {
231
231
  name: "public.sourcemap",
232
232
  conformsTo: "public.json",
233
- fileNameExtension: ".js.map"
233
+ fileNameExtension: [".js.map", ".mjs.map"]
234
234
  },
235
235
  {
236
236
  name: "com.netscape.javascript-source",
@@ -423,10 +423,10 @@ export default [
423
423
  conformsTo: ["public.data", "public.composite-content"]
424
424
  },
425
425
  {
426
- name: "public.svg",
427
- conformsTo: ["public.image", "public.xml"],
428
- mimeType: "image/svg+xml",
429
- fileNameExtension: "*.svg"
426
+ name: "public.svg",
427
+ conformsTo: ["public.image", "public.xml"],
428
+ mimeType: "image/svg+xml",
429
+ fileNameExtension: ".svg"
430
430
  },
431
431
  {
432
432
  name: "public.jpeg",