uti 7.1.1 → 7.1.3

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
@@ -1,6 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/uti.svg)](https://www.npmjs.com/package/uti)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
- [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/?q=uti)
3
+ [![bundlejs](https://deno.bundlejs.com/?q=uti\&badge=detailed)](https://bundlejs.com/?q=uti)
4
4
  [![downloads](http://img.shields.io/npm/dm/uti.svg?style=flat-square)](https://npmjs.org/package/uti)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/uti.svg?style=flat-square)](https://github.com/arlac77/uti/issues)
6
6
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Futi%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/uti/goto)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uti",
3
- "version": "7.1.1",
3
+ "version": "7.1.3",
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.2"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=14.18.3"
package/src/uti.mjs CHANGED
@@ -10,14 +10,8 @@ import types from "./well-known-utis.mjs";
10
10
  */
11
11
  class UTI {
12
12
  constructor(name, conforms) {
13
- Object.defineProperties(this, {
14
- name: {
15
- value: name
16
- },
17
- conforms: {
18
- value: conforms
19
- }
20
- });
13
+ this.name = name;
14
+ this.conforms = conforms;
21
15
  }
22
16
 
23
17
  /**
@@ -146,11 +140,7 @@ export class UTIController {
146
140
  */
147
141
  getUTIsForFileName(fileName) {
148
142
  const m = fileName.match(/(\.[a-zA-Z_0-9]+)$/);
149
- if (m) {
150
- return this.utiByFileNameExtension.get(m[1]);
151
- }
152
-
153
- return [];
143
+ return m ? this.utiByFileNameExtension.get(m[1]) : [];
154
144
  }
155
145
 
156
146
  /**
@@ -173,12 +163,11 @@ export class UTIController {
173
163
  */
174
164
  fileNameConformsTo(fileName, uti) {
175
165
  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;
166
+ if (utis !== undefined) {
167
+ for (const u of utis) {
168
+ if (this.conformsTo(u, uti)) {
169
+ return true;
170
+ }
182
171
  }
183
172
  }
184
173
  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",