uti 8.6.0 → 8.6.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/README.md +3 -3
- package/package.json +5 -5
- package/src/uti.mjs +7 -4
- package/src/well-known-utis.mjs +3 -3
- package/types/uti.d.mts +8 -8
- package/types/well-known-utis.d.mts +0 -22
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ Registers additional types.
|
|
|
148
148
|
|
|
149
149
|
#### Parameters
|
|
150
150
|
|
|
151
|
-
* `types` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[
|
|
151
|
+
* `types` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[UTI](#uti)>** 
|
|
152
152
|
|
|
153
153
|
### getUTI
|
|
154
154
|
|
|
@@ -174,7 +174,7 @@ Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Gl
|
|
|
174
174
|
|
|
175
175
|
Lookup a UTI for a file name.
|
|
176
176
|
First the file name extension is extracted.
|
|
177
|
-
Then a lookup in the
|
|
177
|
+
Then a lookup in the registered UTIs for file name extension is executed.
|
|
178
178
|
|
|
179
179
|
#### Parameters
|
|
180
180
|
|
|
@@ -203,7 +203,7 @@ Lookup a UTI for a file name and check conformance.
|
|
|
203
203
|
* `fileName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** file to detect UTI for
|
|
204
204
|
* `uti` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to check conformance against
|
|
205
205
|
|
|
206
|
-
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
206
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if utils for file name are conformant
|
|
207
207
|
|
|
208
208
|
### assignMimeTypes
|
|
209
209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uti",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"ava": "^6.1.3",
|
|
42
|
-
"browser-ava": "^2.2.
|
|
43
|
-
"c8": "^
|
|
42
|
+
"browser-ava": "^2.2.15",
|
|
43
|
+
"c8": "^10.1.0",
|
|
44
44
|
"documentation": "^14.0.3",
|
|
45
|
-
"semantic-release": "^
|
|
45
|
+
"semantic-release": "^24.0.0",
|
|
46
46
|
"typescript": "^5.4.5"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=20.
|
|
49
|
+
"node": ">=20.14.0",
|
|
50
50
|
"bun": ">=1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"repository": {
|
package/src/uti.mjs
CHANGED
|
@@ -9,6 +9,9 @@ import types from "./well-known-utis.mjs";
|
|
|
9
9
|
* @property {Set<UTI>} conforms
|
|
10
10
|
*/
|
|
11
11
|
class UTI {
|
|
12
|
+
/** @type {string} */ name;
|
|
13
|
+
/** @type {Set<UTI>} */ conforms;
|
|
14
|
+
|
|
12
15
|
/**
|
|
13
16
|
* Object representing a UTI.
|
|
14
17
|
* @param {string} name
|
|
@@ -24,7 +27,7 @@ class UTI {
|
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* Check for conformity.
|
|
27
|
-
* @param {UTI} other
|
|
30
|
+
* @param {UTI|undefined} other
|
|
28
31
|
* @return {boolean} true if other conforms to the receiver
|
|
29
32
|
*/
|
|
30
33
|
conformsTo(other) {
|
|
@@ -84,7 +87,7 @@ export class UTIController {
|
|
|
84
87
|
|
|
85
88
|
/**
|
|
86
89
|
* Registers additional types.
|
|
87
|
-
* @param {
|
|
90
|
+
* @param {UTI[]} types
|
|
88
91
|
*/
|
|
89
92
|
register(types) {
|
|
90
93
|
for (const u of types) {
|
|
@@ -146,7 +149,7 @@ export class UTIController {
|
|
|
146
149
|
/**
|
|
147
150
|
* Lookup a UTI for a file name.
|
|
148
151
|
* First the file name extension is extracted.
|
|
149
|
-
* Then a lookup in the
|
|
152
|
+
* Then a lookup in the registered UTIs for file name extension is executed.
|
|
150
153
|
* @param {string} fileName file to detect UTI for
|
|
151
154
|
* @return {string[]} UTIs for the given fileName
|
|
152
155
|
*/
|
|
@@ -185,7 +188,7 @@ export class UTIController {
|
|
|
185
188
|
* Lookup a UTI for a file name and check conformance.
|
|
186
189
|
* @param {string} fileName file to detect UTI for
|
|
187
190
|
* @param {string} uti to check conformance against
|
|
188
|
-
* @return {boolean}
|
|
191
|
+
* @return {boolean} true if utils for file name are conformant
|
|
189
192
|
*/
|
|
190
193
|
fileNameConformsTo(fileName, uti) {
|
|
191
194
|
const utis = this.getUTIsForFileName(fileName);
|
package/src/well-known-utis.mjs
CHANGED
|
@@ -573,19 +573,19 @@ export default [
|
|
|
573
573
|
{
|
|
574
574
|
name: "public.oci.image.layer.v1.tar",
|
|
575
575
|
conformsTo: "public.oci.image.layer.v1",
|
|
576
|
-
|
|
576
|
+
fileNameExtension: ".tar",
|
|
577
577
|
mimeType: "application/vnd.oci.image.layer.v1.tar"
|
|
578
578
|
},
|
|
579
579
|
{
|
|
580
580
|
name: "public.oci.image.layer.v1.tar.gzip",
|
|
581
581
|
conformsTo: "public.oci.image.layer.v1",
|
|
582
|
-
|
|
582
|
+
fileNameExtension: ".tar.gz",
|
|
583
583
|
mimeType: "application/vnd.oci.image.layer.v1.tar+gzip"
|
|
584
584
|
},
|
|
585
585
|
{
|
|
586
586
|
name: "public.oci.image.layer.v1.tar.zstd",
|
|
587
587
|
conformsTo: "public.oci.image.layer.v1",
|
|
588
|
-
|
|
588
|
+
fileNameExtension: ".tar.zstd",
|
|
589
589
|
mimeType: "application/vnd.oci.image.layer.v1.tar+zstd"
|
|
590
590
|
},
|
|
591
591
|
{
|
package/types/uti.d.mts
CHANGED
|
@@ -10,9 +10,9 @@ export class UTIController {
|
|
|
10
10
|
/** @type {Map<string,string[]>} */ utiByFileNameExtension: Map<string, string[]>;
|
|
11
11
|
/**
|
|
12
12
|
* Registers additional types.
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {UTI[]} types
|
|
14
14
|
*/
|
|
15
|
-
register(types:
|
|
15
|
+
register(types: UTI[]): void;
|
|
16
16
|
/**
|
|
17
17
|
* Lookup a given UTI.
|
|
18
18
|
* @param {string} name UTI
|
|
@@ -28,7 +28,7 @@ export class UTIController {
|
|
|
28
28
|
/**
|
|
29
29
|
* Lookup a UTI for a file name.
|
|
30
30
|
* First the file name extension is extracted.
|
|
31
|
-
* Then a lookup in the
|
|
31
|
+
* Then a lookup in the registered UTIs for file name extension is executed.
|
|
32
32
|
* @param {string} fileName file to detect UTI for
|
|
33
33
|
* @return {string[]} UTIs for the given fileName
|
|
34
34
|
*/
|
|
@@ -45,7 +45,7 @@ export class UTIController {
|
|
|
45
45
|
* Lookup a UTI for a file name and check conformance.
|
|
46
46
|
* @param {string} fileName file to detect UTI for
|
|
47
47
|
* @param {string} uti to check conformance against
|
|
48
|
-
* @return {boolean}
|
|
48
|
+
* @return {boolean} true if utils for file name are conformant
|
|
49
49
|
*/
|
|
50
50
|
fileNameConformsTo(fileName: string, uti: string): boolean;
|
|
51
51
|
/**
|
|
@@ -79,14 +79,14 @@ declare class UTI {
|
|
|
79
79
|
* @property {Set<UTI>} conforms
|
|
80
80
|
*/
|
|
81
81
|
constructor(name: string, conforms: Set<UTI>);
|
|
82
|
-
name: string;
|
|
83
|
-
conforms: Set<UTI>;
|
|
82
|
+
/** @type {string} */ name: string;
|
|
83
|
+
/** @type {Set<UTI>} */ conforms: Set<UTI>;
|
|
84
84
|
/**
|
|
85
85
|
* Check for conformity.
|
|
86
|
-
* @param {UTI} other
|
|
86
|
+
* @param {UTI|undefined} other
|
|
87
87
|
* @return {boolean} true if other conforms to the receiver
|
|
88
88
|
*/
|
|
89
|
-
conformsTo(other: UTI): boolean;
|
|
89
|
+
conformsTo(other: UTI | undefined): boolean;
|
|
90
90
|
/**
|
|
91
91
|
* name of the UTI.
|
|
92
92
|
* @returns {string}
|
|
@@ -3,102 +3,80 @@ declare const _default: ({
|
|
|
3
3
|
conformsTo?: undefined;
|
|
4
4
|
mimeType?: undefined;
|
|
5
5
|
fileNameExtension?: undefined;
|
|
6
|
-
filNameExtension?: undefined;
|
|
7
6
|
} | {
|
|
8
7
|
name: string;
|
|
9
8
|
conformsTo: string;
|
|
10
9
|
mimeType?: undefined;
|
|
11
10
|
fileNameExtension?: undefined;
|
|
12
|
-
filNameExtension?: undefined;
|
|
13
11
|
} | {
|
|
14
12
|
name: string;
|
|
15
13
|
conformsTo: string[];
|
|
16
14
|
mimeType: string;
|
|
17
15
|
fileNameExtension: string;
|
|
18
|
-
filNameExtension?: undefined;
|
|
19
16
|
} | {
|
|
20
17
|
name: string;
|
|
21
18
|
conformsTo: string[];
|
|
22
19
|
fileNameExtension: string;
|
|
23
20
|
mimeType?: undefined;
|
|
24
|
-
filNameExtension?: undefined;
|
|
25
21
|
} | {
|
|
26
22
|
name: string;
|
|
27
23
|
conformsTo: string[];
|
|
28
24
|
mimeType?: undefined;
|
|
29
25
|
fileNameExtension?: undefined;
|
|
30
|
-
filNameExtension?: undefined;
|
|
31
26
|
} | {
|
|
32
27
|
name: string;
|
|
33
28
|
conformsTo: string;
|
|
34
29
|
fileNameExtension: string;
|
|
35
30
|
mimeType: string;
|
|
36
|
-
filNameExtension?: undefined;
|
|
37
31
|
} | {
|
|
38
32
|
name: string;
|
|
39
33
|
conformsTo: string;
|
|
40
34
|
fileNameExtension: string;
|
|
41
35
|
mimeType?: undefined;
|
|
42
|
-
filNameExtension?: undefined;
|
|
43
36
|
} | {
|
|
44
37
|
name: string;
|
|
45
38
|
conformsTo: string;
|
|
46
39
|
fileNameExtension: string[];
|
|
47
40
|
mimeType: string;
|
|
48
|
-
filNameExtension?: undefined;
|
|
49
41
|
} | {
|
|
50
42
|
name: string;
|
|
51
43
|
conformsTo: string;
|
|
52
44
|
fileNameExtension: string;
|
|
53
45
|
mimeType: string[];
|
|
54
|
-
filNameExtension?: undefined;
|
|
55
46
|
} | {
|
|
56
47
|
name: string;
|
|
57
48
|
conformsTo: string;
|
|
58
49
|
mimeType: string;
|
|
59
50
|
fileNameExtension?: undefined;
|
|
60
|
-
filNameExtension?: undefined;
|
|
61
51
|
} | {
|
|
62
52
|
name: string;
|
|
63
53
|
conformsTo: string;
|
|
64
54
|
fileNameExtension: string[];
|
|
65
55
|
mimeType?: undefined;
|
|
66
|
-
filNameExtension?: undefined;
|
|
67
56
|
} | {
|
|
68
57
|
name: string;
|
|
69
58
|
conformsTo: string[];
|
|
70
59
|
fileNameExtension: string[];
|
|
71
60
|
mimeType: string[];
|
|
72
|
-
filNameExtension?: undefined;
|
|
73
61
|
} | {
|
|
74
62
|
name: string;
|
|
75
63
|
conformsTo: string;
|
|
76
64
|
fileNameExtension: string[];
|
|
77
65
|
mimeType: string[];
|
|
78
|
-
filNameExtension?: undefined;
|
|
79
66
|
} | {
|
|
80
67
|
name: string;
|
|
81
68
|
conformsTo: string[];
|
|
82
69
|
fileNameExtension: string[];
|
|
83
70
|
mimeType?: undefined;
|
|
84
|
-
filNameExtension?: undefined;
|
|
85
71
|
} | {
|
|
86
72
|
name: string;
|
|
87
73
|
conformsTo: string[];
|
|
88
74
|
mimeType: string;
|
|
89
75
|
fileNameExtension: string[];
|
|
90
|
-
filNameExtension?: undefined;
|
|
91
|
-
} | {
|
|
92
|
-
name: string;
|
|
93
|
-
conformsTo: string;
|
|
94
|
-
filNameExtension: string;
|
|
95
|
-
mimeType: string;
|
|
96
|
-
fileNameExtension?: undefined;
|
|
97
76
|
} | {
|
|
98
77
|
name: string;
|
|
99
78
|
fileNameExtension: string[];
|
|
100
79
|
conformsTo?: undefined;
|
|
101
80
|
mimeType?: undefined;
|
|
102
|
-
filNameExtension?: undefined;
|
|
103
81
|
})[];
|
|
104
82
|
export default _default;
|