uti 8.4.1 → 8.5.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/README.md CHANGED
@@ -52,9 +52,11 @@ public.plain-text
52
52
  * [Properties](#properties)
53
53
  * [conformsTo](#conformsto)
54
54
  * [Parameters](#parameters-1)
55
+ * [toString](#tostring)
55
56
  * [toJSON](#tojson)
56
57
  * [UTIController](#uticontroller)
57
58
  * [Properties](#properties-1)
59
+ * [registry](#registry)
58
60
  * [utiByMimeType](#utibymimetype)
59
61
  * [utiByFileNameExtension](#utibyfilenameextension)
60
62
  * [register](#register)
@@ -69,6 +71,10 @@ public.plain-text
69
71
  * [Parameters](#parameters-6)
70
72
  * [fileNameConformsTo](#filenameconformsto)
71
73
  * [Parameters](#parameters-7)
74
+ * [assignMimeTypes](#assignmimetypes)
75
+ * [Parameters](#parameters-8)
76
+ * [assignExtensions](#assignextensions)
77
+ * [Parameters](#parameters-9)
72
78
 
73
79
  ## UTI
74
80
 
@@ -94,6 +100,12 @@ Check for conformity.
94
100
 
95
101
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if other conforms to the receiver
96
102
 
103
+ ### toString
104
+
105
+ name of the UTI.
106
+
107
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
108
+
97
109
  ### toJSON
98
110
 
99
111
  Deliver JSON representation of the UTI.
@@ -106,7 +118,7 @@ Sample result
106
118
  }
107
119
  ```
108
120
 
109
- Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** json representation of the UTI
121
+ Returns **{name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), conforms: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>}** json representation of the UTI
110
122
 
111
123
  ## UTIController
112
124
 
@@ -118,6 +130,10 @@ Registry of UTIs.
118
130
  * `utiByMimeType` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [UTI](#uti)>**&#x20;
119
131
  * `utiByFileNameExtension` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [UTI](#uti)>**&#x20;
120
132
 
133
+ ### registry
134
+
135
+ Type: [Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [UTI](#uti)>
136
+
121
137
  ### utiByMimeType
122
138
 
123
139
  Type: [Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>>
@@ -142,7 +158,7 @@ Lookup a given UTI.
142
158
 
143
159
  * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** UTI
144
160
 
145
- Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** UTI for the given name or undefined if UTI is not present.
161
+ Returns **([UTI](#uti) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** UTI for the given name or undefined if UTI is not present.
146
162
 
147
163
  ### getUTIsForMimeType
148
164
 
@@ -189,6 +205,24 @@ Lookup a UTI for a file name and check conformance.
189
205
 
190
206
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ture if utils for file name are conformant
191
207
 
208
+ ### assignMimeTypes
209
+
210
+ Assign mime types to a UTI
211
+
212
+ #### Parameters
213
+
214
+ * `uti` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
215
+ * `mimeTypes` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
216
+
217
+ ### assignExtensions
218
+
219
+ Assign mime types to a UTI
220
+
221
+ #### Parameters
222
+
223
+ * `uti` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
224
+ * `extensions` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
225
+
192
226
  # install
193
227
 
194
228
  With [npm](http://npmjs.org) do:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uti",
3
- "version": "8.4.1",
3
+ "version": "8.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -27,7 +27,7 @@
27
27
  "license": "BSD-2-Clause",
28
28
  "scripts": {
29
29
  "prepare": "npm run prepare:typescript",
30
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
30
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
31
31
  "test": "npm run test:browser-ava && npm run test:ava",
32
32
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
33
33
  "test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
@@ -35,18 +35,18 @@
35
35
  "docs": "documentation readme --section=API ./src/**/*.mjs",
36
36
  "lint": "npm run lint:docs && npm run lint:typescript",
37
37
  "lint:docs": "documentation lint ./src/**/*.mjs",
38
- "lint:typescript": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
38
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
39
39
  },
40
40
  "devDependencies": {
41
- "ava": "^6.1.2",
42
- "browser-ava": "^2.2.2",
41
+ "ava": "^6.1.3",
42
+ "browser-ava": "^2.2.13",
43
43
  "c8": "^9.1.0",
44
44
  "documentation": "^14.0.3",
45
- "semantic-release": "^23.0.2",
46
- "typescript": "^5.4.2"
45
+ "semantic-release": "^23.1.1",
46
+ "typescript": "^5.4.5"
47
47
  },
48
48
  "engines": {
49
- "node": ">=20.11.1",
49
+ "node": ">=20.13.1",
50
50
  "bun": ">=1.0.0"
51
51
  },
52
52
  "repository": {
@@ -546,6 +546,18 @@ export default [
546
546
  fileNameExtension: [".md", ".markdown"],
547
547
  mimeType: "text/markdown"
548
548
  },
549
+ {
550
+ name: "public.jsx",
551
+ conformsTo: "public.source-code",
552
+ fileNameExtension: [".jsx"],
553
+ mimeType: "text/jsx"
554
+ },
555
+ {
556
+ name: "public.mdx",
557
+ conformsTo: ["net.daringfireball.markdown","public.jsx"],
558
+ fileNameExtension: [".mdx"],
559
+ mimeType: "text/mdx"
560
+ },
549
561
  {
550
562
  name: "com.apple.disk-image",
551
563
  conformsTo: "public.disk-image",