uti 7.2.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 +1 -1
- package/src/uti.mjs +16 -2
- package/src/well-known-utis.mjs +5 -3
package/package.json
CHANGED
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
|
-
|
|
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
|
/**
|
package/src/well-known-utis.mjs
CHANGED
|
@@ -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,8 +423,10 @@ export default [
|
|
|
423
423
|
conformsTo: ["public.data", "public.composite-content"]
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
|
-
name: "public.
|
|
427
|
-
conformsTo: ["public.
|
|
426
|
+
name: "public.svg",
|
|
427
|
+
conformsTo: ["public.image", "public.xml"],
|
|
428
|
+
mimeType: "image/svg+xml",
|
|
429
|
+
fileNameExtension: ".svg"
|
|
428
430
|
},
|
|
429
431
|
{
|
|
430
432
|
name: "public.jpeg",
|