uti 7.1.1 → 7.1.2

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.1.1",
3
+ "version": "7.1.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -31,10 +31,10 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "ava": "^5.2.0",
34
- "browser-ava": "^1.3.30",
34
+ "browser-ava": "^1.3.38",
35
35
  "c8": "^7.13.0",
36
36
  "documentation": "^14.0.1",
37
- "semantic-release": "^21.0.0"
37
+ "semantic-release": "^21.0.1"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=14.18.3"
package/src/uti.mjs CHANGED
@@ -146,11 +146,7 @@ export class UTIController {
146
146
  */
147
147
  getUTIsForFileName(fileName) {
148
148
  const m = fileName.match(/(\.[a-zA-Z_0-9]+)$/);
149
- if (m) {
150
- return this.utiByFileNameExtension.get(m[1]);
151
- }
152
-
153
- return [];
149
+ return m ? this.utiByFileNameExtension.get(m[1]) : [];
154
150
  }
155
151
 
156
152
  /**
@@ -173,12 +169,11 @@ export class UTIController {
173
169
  */
174
170
  fileNameConformsTo(fileName, uti) {
175
171
  const utis = this.getUTIsForFileName(fileName);
176
- if (utis === undefined) {
177
- return false;
178
- }
179
- for (const u of utis) {
180
- if (this.conformsTo(u, uti)) {
181
- return true;
172
+ if (utis !== undefined) {
173
+ for (const u of utis) {
174
+ if (this.conformsTo(u, uti)) {
175
+ return true;
176
+ }
182
177
  }
183
178
  }
184
179
  return false;
@@ -524,14 +524,14 @@ export default [
524
524
  {
525
525
  name: "public.x-pkcs12",
526
526
  conformsTo: "public.data",
527
- fileNameExtension: ".pem",
528
- mimeType: "application/x-pem-file"
527
+ fileNameExtension: [".p12", ".pfx"],
528
+ mimeType: "application/x-pkcs12"
529
529
  },
530
530
  {
531
531
  name: "public.x-pem-file",
532
532
  conformsTo: "public.data",
533
- fileNameExtension: [".p12", ".pfx"],
534
- mimeType: "application/x-pkcs12"
533
+ fileNameExtension: ".pem",
534
+ mimeType: "application/x-pem-file"
535
535
  },
536
536
  {
537
537
  name: "public.x-pkcs7-certificates",