uti 7.3.0 → 7.4.0

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.4.0",
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",
@@ -272,6 +272,12 @@ export default [
272
272
  fileNameExtension: ".tar",
273
273
  mimeType: ["application/x-tar", "application/tar"]
274
274
  },
275
+ {
276
+ name: "public.brotli",
277
+ conformsTo: "public.archive",
278
+ fileNameExtension: ".br",
279
+ mimeType: "application/brotli"
280
+ },
275
281
  {
276
282
  name: "org.gnu.gnu-zip-archive",
277
283
  conformsTo: "public.archive",
@@ -423,10 +429,10 @@ export default [
423
429
  conformsTo: ["public.data", "public.composite-content"]
424
430
  },
425
431
  {
426
- name: "public.svg",
427
- conformsTo: ["public.image", "public.xml"],
428
- mimeType: "image/svg+xml",
429
- fileNameExtension: "*.svg"
432
+ name: "public.svg",
433
+ conformsTo: ["public.image", "public.xml"],
434
+ mimeType: "image/svg+xml",
435
+ fileNameExtension: ".svg"
430
436
  },
431
437
  {
432
438
  name: "public.jpeg",