uti 6.9.2 → 7.0.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/LICENSE +1 -1
- package/package.json +5 -6
- package/src/uti.mjs +7 -4
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uti",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"sideEffects": false,
|
|
8
7
|
"exports": {
|
|
9
8
|
".": "./src/uti.mjs"
|
|
10
9
|
},
|
|
@@ -31,18 +30,18 @@
|
|
|
31
30
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"ava": "^5.1.
|
|
35
|
-
"browser-ava": "^1.3.
|
|
33
|
+
"ava": "^5.1.1",
|
|
34
|
+
"browser-ava": "^1.3.19",
|
|
36
35
|
"c8": "^7.12.0",
|
|
37
36
|
"documentation": "^14.0.1",
|
|
38
|
-
"semantic-release": "^
|
|
37
|
+
"semantic-release": "^20.0.4"
|
|
39
38
|
},
|
|
40
39
|
"engines": {
|
|
41
40
|
"node": ">=14.18.3"
|
|
42
41
|
},
|
|
43
42
|
"repository": {
|
|
44
43
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/arlac77/uti
|
|
44
|
+
"url": "https://github.com/arlac77/uti"
|
|
46
45
|
},
|
|
47
46
|
"bugs": {
|
|
48
47
|
"url": "https://github.com/arlac77/uti/issues"
|
package/src/uti.mjs
CHANGED
|
@@ -72,8 +72,7 @@ export class UTIController {
|
|
|
72
72
|
utiByMimeType = new Map();
|
|
73
73
|
utiByFileNameExtension = new Map();
|
|
74
74
|
|
|
75
|
-
constructor()
|
|
76
|
-
{
|
|
75
|
+
constructor() {
|
|
77
76
|
this.register(types);
|
|
78
77
|
}
|
|
79
78
|
|
|
@@ -147,7 +146,11 @@ export class UTIController {
|
|
|
147
146
|
*/
|
|
148
147
|
getUTIsForFileName(fileName) {
|
|
149
148
|
const m = fileName.match(/(\.[a-zA-Z_0-9]+)$/);
|
|
150
|
-
|
|
149
|
+
if (m) {
|
|
150
|
+
return this.utiByFileNameExtension.get(m[1]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return [];
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
/**
|
|
@@ -163,7 +166,7 @@ export class UTIController {
|
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
/**
|
|
166
|
-
* Lookup a UTI for a file name and check conformance
|
|
169
|
+
* Lookup a UTI for a file name and check conformance.
|
|
167
170
|
* @param {string} fileName file to detect UTI for
|
|
168
171
|
* @param {string} uti to check conformance egainst
|
|
169
172
|
* @return {boolean} ture if utils for file name are conformant
|