@bgord/tools 1.1.15 → 1.1.17

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/dist/mime.vo.js CHANGED
@@ -10,12 +10,11 @@ export class Mime {
10
10
  this.subtype = subtype;
11
11
  }
12
12
  static fromString(candidate) {
13
- const { type, subtype } = MimeValue.parse(candidate);
13
+ const { type, subtype } = MimeValue.parse(candidate.split(";")[0].trim());
14
14
  return new Mime(type, subtype);
15
15
  }
16
16
  static fromExtension(extension) {
17
- const { type, subtype } = MimeValue.parse(String(mime.contentType(extension)));
18
- return new Mime(type, subtype);
17
+ return Mime.fromString(String(mime.contentType(extension)));
19
18
  }
20
19
  isSatisfiedBy(another) {
21
20
  if (!(this.type === another.type || this.type === "*"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/tools",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bartosz Gordon",
@@ -22,13 +22,13 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@biomejs/biome": "2.3.8",
25
- "@commitlint/cli": "20.1.0",
26
- "@commitlint/config-conventional": "20.0.0",
27
- "@types/bun": "1.3.3",
25
+ "@commitlint/cli": "20.2.0",
26
+ "@commitlint/config-conventional": "20.2.0",
27
+ "@types/bun": "1.3.4",
28
28
  "@types/mime-types": "3.0.1",
29
29
  "cspell": "9.4.0",
30
- "knip": "5.71.0",
31
- "lefthook": "2.0.7",
30
+ "knip": "5.73.0",
31
+ "lefthook": "2.0.9",
32
32
  "only-allow": "1.2.2",
33
33
  "shellcheck": "4.1.0",
34
34
  "typescript": "5.9.3",
package/readme.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Clone the repository
6
6
 
7
7
  ```
8
- git clone git@github.com:bgord/journal.git --recurse-submodules
8
+ git clone git@github.com:bgord/bgord-tools.git --recurse-submodules
9
9
  ```
10
10
 
11
11
  Install packages
package/src/mime.vo.ts CHANGED
@@ -11,15 +11,13 @@ export class Mime {
11
11
  ) {}
12
12
 
13
13
  static fromString(candidate: string): Mime {
14
- const { type, subtype } = MimeValue.parse(candidate);
14
+ const { type, subtype } = MimeValue.parse(candidate.split(";")[0].trim());
15
15
 
16
16
  return new Mime(type, subtype);
17
17
  }
18
18
 
19
19
  static fromExtension(extension: ExtensionType): Mime {
20
- const { type, subtype } = MimeValue.parse(String(mime.contentType(extension)));
21
-
22
- return new Mime(type, subtype);
20
+ return Mime.fromString(String(mime.contentType(extension)));
23
21
  }
24
22
 
25
23
  isSatisfiedBy(another: Mime): boolean {