Skip to content

Commit 349b216

Browse files
authored
switch out mime-types for mime (#334)
1 parent 5a096f6 commit 349b216

File tree

4 files changed

+45
-13
lines changed

4 files changed

+45
-13
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Fixed
10+
- Switch out `mime-types` for `mime` ([#334](https://github.com/cucumber/react-components/pull/334))
911

1012
## [21.1.0] - 2023-07-13
1113
### Added

package-lock.json

+39-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"elasticlunr": "0.9.5",
4141
"hast-util-sanitize": "3.0.2",
4242
"highlight-words": "1.2.1",
43-
"mime-types": "^2.1.35",
43+
"mime": "^3.0.0",
4444
"react-accessible-accordion": "5.0.0",
4545
"react-markdown": "6.0.3",
4646
"rehype-raw": "5.1.0",
@@ -66,7 +66,7 @@
6666
"@types/glob": "8.0.0",
6767
"@types/jest": "^29.0.0",
6868
"@types/jsdom": "20.0.1",
69-
"@types/mime-types": "^2.1.1",
69+
"@types/mime": "^3.0.1",
7070
"@types/node": "18.11.18",
7171
"@types/react": "^18.0.26",
7272
"@types/react-dom": "^18.0.9",

src/components/gherkin/attachmentFilename.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Attachment } from '@cucumber/messages'
2-
import mimeTypes from 'mime-types'
2+
import mimeTypes from 'mime'
33

44
export function attachmentFilename(attachment: Attachment): string {
55
if (attachment.fileName) {
66
return attachment.fileName
77
}
8-
const extension = mimeTypes.extension(attachment.mediaType)
8+
const extension = mimeTypes.getExtension(attachment.mediaType)
99
if (extension) {
1010
return `attachment.${extension}`
1111
}

0 commit comments

Comments
 (0)