uti 8.7.1 → 8.7.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/LICENSE CHANGED
@@ -1,5 +1,12 @@
1
- Copyright (C) 2015-2024 by arlac77
1
+ Copyright (C) 2015-2025 by arlac77
2
2
 
3
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted.
4
5
 
5
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
7
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
11
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
12
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![npm](https://img.shields.io/npm/v/uti.svg)](https://www.npmjs.com/package/uti)
2
- [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://spdx.org/licenses/0BSD.html)
2
+ [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
3
3
  [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
4
4
  [![bundlejs](https://deno.bundlejs.com/?q=uti\&badge=detailed)](https://bundlejs.com/?q=uti)
5
5
  [![downloads](http://img.shields.io/npm/dm/uti.svg?style=flat-square)](https://npmjs.org/package/uti)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uti",
3
- "version": "8.7.1",
3
+ "version": "8.7.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -8,8 +8,8 @@
8
8
  "types": "./types/uti.d.mts",
9
9
  "exports": {
10
10
  ".": {
11
- "default": "./src/uti.mjs",
12
- "types": "./types/uti.d.mts"
11
+ "types": "./types/uti.d.mts",
12
+ "default": "./src/uti.mjs"
13
13
  }
14
14
  },
15
15
  "description": "javascript implementation of a \"Uniform Type Identifier\" (UTI)",
@@ -27,26 +27,26 @@
27
27
  "license": "0BSD",
28
28
  "scripts": {
29
29
  "prepare": "node --run prepare:typescript",
30
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
30
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
31
31
  "test": "node --run test:browser-ava && node --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",
34
34
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
35
- "docs": "documentation readme --section=API ./src/**/*.mjs",
35
+ "docs": "documentation readme --section=API ./src**/*.mjs",
36
36
  "lint": "node --run lint:docs && node --run lint:typescript",
37
- "lint:docs": "documentation lint ./src/**/*.mjs",
38
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
37
+ "lint:docs": "documentation lint ./src**/*.mjs",
38
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
39
39
  },
40
40
  "devDependencies": {
41
41
  "ava": "^6.2.0",
42
- "browser-ava": "^2.3.4",
42
+ "browser-ava": "^2.3.23",
43
43
  "c8": "^10.1.3",
44
44
  "documentation": "^14.0.3",
45
- "semantic-release": "^24.2.0",
46
- "typescript": "^5.7.2"
45
+ "semantic-release": "^24.2.3",
46
+ "typescript": "^5.8.3"
47
47
  },
48
48
  "engines": {
49
- "node": ">=22.12.0",
49
+ "node": ">=22.15.0",
50
50
  "bun": ">=1.0.0"
51
51
  },
52
52
  "repository": {
package/src/uti.mjs CHANGED
@@ -1,5 +1,13 @@
1
1
  import types from "./well-known-utis.mjs";
2
2
 
3
+ /**
4
+ * @typedef {Object} UTIDeclaration
5
+ * @property {string} name
6
+ * @property {string|string[]} [conformsTo]
7
+ * @property {string|string[]} [mimeType]
8
+ * @property {string|string[]} [fileNameExtension]
9
+ */
10
+
3
11
  /**
4
12
  * Object representing a UTI.
5
13
  * @param {string} name
@@ -87,7 +95,7 @@ export class UTIController {
87
95
 
88
96
  /**
89
97
  * Registers additional types.
90
- * @param {UTI[]} types
98
+ * @param {UTIDeclaration[]} types
91
99
  */
92
100
  register(types) {
93
101
  for (const u of types) {
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 {UTI[]} types
13
+ * @param {UTIDeclaration[]} types
14
14
  */
15
- register(types: UTI[]): void;
15
+ register(types: UTIDeclaration[]): void;
16
16
  /**
17
17
  * Lookup a given UTI.
18
18
  * @param {string} name UTI
@@ -61,6 +61,19 @@ export class UTIController {
61
61
  */
62
62
  assignExtensions(uti: string, extensions: string[]): void;
63
63
  }
64
+ export type UTIDeclaration = {
65
+ name: string;
66
+ conformsTo?: string | string[];
67
+ mimeType?: string | string[];
68
+ fileNameExtension?: string | string[];
69
+ };
70
+ /**
71
+ * @typedef {Object} UTIDeclaration
72
+ * @property {string} name
73
+ * @property {string|string[]} [conformsTo]
74
+ * @property {string|string[]} [mimeType]
75
+ * @property {string|string[]} [fileNameExtension]
76
+ */
64
77
  /**
65
78
  * Object representing a UTI.
66
79
  * @param {string} name